home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / DIVERSEN / PREXCM55 / PROTEXCM.DOC < prev    next >
Text File  |  1995-03-22  |  22KB  |  555 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                       Protect! EXE/COM v5.5
  7.                   (C) 1993-1995 Jeremy Lilley, 
  8.                        All Rights Reserved
  9.  
  10.                          March 22, 1995
  11.  
  12.  
  13.                       Program Documentation
  14.                       =====================
  15.  
  16.  
  17.  
  18. Contents:
  19. ---------
  20.  
  21. What is Protect! EXE/COM v5.5 ? ................ 1
  22. Some Improvements, Briefly ..................... 2
  23. Requirements ................................... 2
  24. How To Use Protect! EXE/COM .................... 2
  25. Which Files Can't Be Protected ................. 4
  26. Legal Terms / Disclaimer ....................... 4
  27. License ........................................ 5
  28. Protect! EXE/COM Vs. Other Utilities ........... 5
  29. Comments on Hacking Protect! ................... 6
  30. Technical Notes ................................ 6
  31. Compression Notes .............................. 7
  32. What's The Mutation Engine? .................... 8
  33. Closing ........................................ 9
  34. Address ........................................ 9
  35.  
  36.  
  37.  
  38.  
  39.  
  40. What is Protect! EXE/COM v5.5 ?
  41. -------------------------------
  42.  
  43.  
  44.      Protect! EXE/COM is a protection, encryption, and
  45. compression utility that has protected programs from tampering
  46. and reverse-engineering for the last two years (and counting). 
  47. By attaching a strong security envelope to your DOS EXE
  48. and COM files, the resulting files run normally but look like a
  49. random series of instructions and garbage bytes. This version  
  50. provides compression as well as encryption, so your final files
  51. will be smaller. You can still use any other compression program
  52. with Protect! and you may turn off the integrated compression 
  53. altogether if you want to. Most importantly, a modification check
  54. using a high-speed CRC, which can be customized by registered 
  55. users, prevents the program from running if it has been tampered 
  56. with by hackers, viruses, or simply by accident. That way, you can 
  57. be pretty certain that your program will come up with all the 
  58. proper screens without crashing or hanging due to unwanted 
  59. modification. Your program's underlying data will not be left in 
  60. the open (to any Dick or Jane with a hex editor or disassembler) and 
  61. your code will be safer from others' eyes.
  62.  
  63.  
  64.                                                                 Page 2
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. Some Improvements, Briefly
  74. --------------------------
  75.  
  76.  
  77.      In preparing this new version, I (again) rewrote just about
  78. everything in order to speed execution, to stop hacking programs,
  79. and to integrate the compression. Loading overhead from Protect! 
  80. should be slightly lower, particularly for files that are not 
  81. compressed. The encryption itself is much more random now due to 
  82. some new techniques that I learned. I also took out some anti-
  83. debugging traps that occasionally presented problems under OS/2 
  84. (mostly when loading files in the background). The older version 
  85. also could cause user's clock to lose a few seconds whenever a 
  86. Protected program was run (seconds can add up quickly), but that 
  87. is taken care of. Most importantly, the few circulating unProtect 
  88. programs will no longer work with Protect! v5.5.
  89.  
  90.  
  91.  
  92.  
  93.  
  94. Requirements
  95. ------------
  96.  
  97.  
  98.      Protected programs will basically run on any system that the
  99. normal file would run on. Protect! itself requires DOS 3.x or above 
  100. and 64k of memory to run in. The files themselves must be below 600k 
  101. because Protect! cannot accommodate large overlay files (actually, 
  102. many overlaid files may present a problem for Protect! because the 
  103. overlaid data would not be able to be encrypted) in memory. You may 
  104. still want to have and use a compression utility such as LZEXE or 
  105. PKLite (R) in some circumstances, especially if you are using files
  106. over 300-350k (the relocation tables in Protect! get filled usually
  107. around then, so precompressing those files may be most efficient).
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. How To Use Protect! EXE/COM
  115. ---------------------------
  116.  
  117.  
  118.      The command-line syntax for Protect! EXE/COM v5.5
  119. (ProtExCm.EXE) can be summarized here:
  120.  
  121.      ProtExCm filename[.EXT] [* CRC_Msg.Fil - Registered*] [-N] 
  122.  
  123.  
  124.                                                                 Page 3
  125.  
  126.  
  127.  
  128.  
  129.      The first and only necessary component is the file's name,
  130. with or without the extension (if you have MyProg.EXE and
  131. MyProg.COM, it will do the EXE file if no extension is named).
  132.  
  133.      The modification error message, which is available only to
  134. registered users, is displayed by the file if it has been
  135. modified or tampered with. Unregistered users have a message
  136. stating that the file has been modified but that it was Protected
  137. with an unlicensed copy of Protect! -- a message that you might 
  138. not like to place in a file for distribution. Registered users can 
  139. save time by putting a message in a file called CRC.MSG or 
  140. MODIFIED.MSG (it *must* be in your current directory) and it
  141. will be used unless you specifically specify another file. The
  142. file can be up to 4k and can basically contain any characters
  143. except for the ASCII 0.
  144.  
  145.      Finally, the -N switch prevents Protect! from trying to
  146. compress the file. You may want to use this if compression is not
  147. significantly reducing the file size or if compression is causing
  148. a noticeable loading delay. If your file has been compressed
  149. previously with LZEXE or PKLite, for example, you would probably
  150. want to use this option to save the time it takes to attempt to
  151. compress the file unsuccessfully.
  152.  
  153.      Here are some usage examples:
  154.  
  155.           ProtExCm MyProg.EXE
  156.           (To Protect MyProg.EXE)
  157.  
  158.           ProtExCm MyProg
  159.           (To Protect either MyProg.EXE or MyProg.COM)
  160.  
  161.           ProtExCm MyProg.EXE -N
  162.           (To Protect MyProg.EXE without trying to compress)
  163.  
  164.           ProtExCm MyProg.EXE MyProg.Msg
  165.           (To Protect MyProg.EXE using the contents of MyProg.Msg
  166.           for the modification error message)
  167.  
  168.  
  169.      As you can see, adding the security that Protect! provides
  170. is not a difficult task. It might be also helpful to know that if
  171. the Protected file is modified Protect, it returns with an
  172. errorlevel of 250 to DOS.
  173.  
  174.      Remember that the security of Protect! *depends* on the fact
  175. that a Protected file CANNOT be expanded by Protect! after being
  176. Protected (you can probably see why). The backup file (.OLD) is
  177. provided just in case there is a problem with the Protected file.
  178. If there is a problem, you might want to try to reProtect the
  179. original again or to turn on/off compression.
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.                                                                 Page 4
  187.  
  188.  
  189.  
  190.  
  191. Which Files Can't Be Protected
  192. ------------------------------
  193.  
  194.  
  195.      Protect! EXE/COM cannot Protect Windows (R) and OS/2 (R) EXE
  196. files because the formats for these files are substantially
  197. different and more complex than the regular DOS EXE format. For
  198. your information, a Windows EXE basically starts out looking
  199. (from Protect's perspective) like a small DOS EXE that can only
  200. display a message that "This file requires Windows." There is a
  201. pointer to a Windows New EXE header, which Windows finds and uses
  202. as the Windows file. I have written a freeware program called
  203. EXE-Combine that exploits this and allows you to attach a DOS
  204. program to a Windows program. Protect! will now automatically
  205. detect if a file is for Windows or OS/2 so that you don't waste
  206. your time trying to Protect them. 
  207.  
  208.      Also, due to the structure of Protect!, files larger than
  209. the 600k neighborhood can't be Protected (because the entire file
  210. has to be able to all fit in memory a once when it loads). This
  211. fact, of course, makes Protect! worthless for xBase files where
  212. the basic "Hello World" EXE can be over a meg. Don't try to
  213. Protect COMMAND.COM, etc.
  214.  
  215.  
  216.  
  217.  
  218.  
  219. Legal Terms / Disclaimer
  220. ------------------------
  221.  
  222.  
  223.      The only guarantee behind Protect! EXE/COM v5.5 ("Protect!")
  224. is that it has the ability to alter EXE and COM files. The
  225. problem is that Protect! may not always alter every possible file
  226. correctly, and as the author (Jeremy Lilley), I cannot be sued
  227. for problems due to use and misuse of Protect. Protect! is
  228. provided "as is," and, as the user, you have been warned that
  229. using Protect! implies that you understand that compatibility
  230. problems may arise. You, as the user, are responsible for any
  231. damage caused by using or misusing Protect!, and under no
  232. circumstances may the author be held liable for loss of profits
  233. or any other damages arising from Protect. Also, it is your
  234. responsibility to use Protect! only in a lawful manner. No other
  235. warranties or guarantees, express or implied, exist with Protect!,
  236. especially for this evaluation copy.
  237.  
  238.      Risk of damage resulting from Protect!'s use is actually
  239. pretty small, as long as you use it correctly. However, if you
  240. try to make it mess up, it probably will. Just remember that it
  241. isn't my fault if you misuse my program.
  242.  
  243.      Also, all trademarks used are the property of their 
  244. respective owners.
  245.  
  246.  
  247.  
  248.  
  249.  
  250.                                                                 Page 5
  251.  
  252.  
  253.  
  254.  
  255.  
  256. License
  257. -------
  258.  
  259.  
  260.      You may use Protect! EXE/COM for the purposes of evaluating
  261. it (after understanding the disclaimer and the documentation) for
  262. 30 days. No files protected by Protect! during this trial period
  263. may be distributed to other computers, commercially or non-
  264. commercially. If you find Protect! to be of use to you, you must
  265. register Protect! with the author ($25). Government, educational,
  266. and commercial institutions must register this program with the
  267. author prior to use (please contact me for quantity discounts). 
  268.  
  269.      Sysops, user groups, disk vendors, CD-ROM vendors and other
  270. similar organizations may distribute Protect! provided that no
  271. files are excluded from the distribution and that no more that
  272. $10 (except for CD-ROM) is charged for distribution.
  273.  
  274.      Much of Protect!'s protection and encryption capability
  275. comes from its anti-debugging and anti-hacking code. In order to
  276. keep loading time to a minimum (yes, 1000-bit, military-grade 
  277. decryption keys *do* take a while to process), the encryption key 
  278. length is nothing (some advanced math with 32-bit numbers) compared 
  279. to the encryption keys regulated for export from the US. In 
  280. addition, since the decryption mechanism is and needs to be located 
  281. on the file, the Protected files themselves are not subject to US
  282. export restrictions. However, the ProtExCm.EXE and this Protect! 
  283. EXE/COM package should be kept away from Iran, Libya, and communist/
  284. communist-nostalgic nations that the US has normal trade restrictions
  285. with.
  286.  
  287.  
  288.  
  289.  
  290.  
  291. Protect! EXE/COM Vs. Other Utilities
  292. ------------------------------------
  293.  
  294.  
  295.      Protect! EXE/COM's first concern is security. No other
  296. program emphasizes the modification checking using a CRC to the
  297. extent that Protect! does. Try PKLITing an EXE file and change a
  298. byte or two in the middle of the file (find parts of text that
  299. you can still recognize slightly). As long as the program doesn't
  300. crash (it may if you've messed too much with the code portions),
  301. PKLITE won't notice your changes at all. A hacker can also
  302. decompress a program compressed with PKLITE or LZEXE quite easily
  303. -- even if a program is compressed with the "invincible" -E
  304. option on the professional version of PKLITE. After
  305. decompressing, any hacker can change your program (remove
  306. copyright screens, disassemble code, etc...), compress it
  307. again, and spread it around, possibly damaging your profits, your
  308. reputation, and others' computers (I hope you have a good
  309. disclaimer...). Fortunately, hacking is not quite that rampant,
  310.  
  311.  
  312.                                                                 Page 6
  313.  
  314.  
  315.  
  316. but it still is a possibility and a risk, and it is much better
  317. to pay a few dollars up-front to be safe than to be sorry in the
  318. future. 
  319.  
  320.  
  321.  
  322.  
  323.  
  324. Comments on Hacking Protect!
  325. ----------------------------
  326.  
  327.  
  328.      Some users of Protect! EXE/COM have pointed out files,
  329. mostly found on illegal bulletin boards, that have been able to
  330. remove the protection from previous versions of Protect. It is
  331. sometimes interesting to read their documentations ("aNArky Rulz,
  332. d00Dz") and even more interesting to watch them fail the majority
  333. of the time. The programs themselves often spread viruses to the
  334. curious user. After watching some security mechanisms work better
  335. than others (it will be fun to see the reactions of some hackers 
  336. who discover some of the new traps and ideas), I know that no 
  337. software-only program (or even hardware-based) is fool-proof,
  338. but Protect! v5.5 puts together some of the toughest combinations
  339. of traps that will work compatibly under the DOS (and Windows/
  340. OS/2) environment.
  341.  
  342.      To put the security capability into a better perspective, an
  343. apt analogy for Protect! EXE/COM would be to an automotive anti-
  344. theft device. The anti-theft device helps deter thieves from
  345. breaking in (most thieves just get the next car over) and also
  346. makes it difficult once they try to get in to drive the car off.
  347. Yet, it is entirely possible for the best of professional thieves
  348. to disable the device (yes, I know somebody who had his car
  349. stolen even with "the Club"), but 99% find another car and won't
  350. go to those lengths. As far as Protect! is concerned, it is just
  351. about the best, least-intrusive, anti-hacking software solution
  352. (just read the documentation files written by some of the hackers
  353. of previous versions of Protect! -- many admit that Protect! was
  354. quite a challenge to break through). Protect! may not be 100%
  355. fool-proof, but it has evolved quite significantly after some
  356. "cat-and-mouse" and it stands before you as the best lock to
  357. prevent people from breaking in to your programs.
  358.  
  359.  
  360.  
  361.  
  362. Technical Notes
  363. ---------------
  364.  
  365.  
  366.      First of all, thank you to everyone who contributed anti-
  367. debug ideas for this version of Protect. All these new ideas have
  368. helped make Protect! more secure and faster. I have again
  369. rewritten the "mutation engine" (now it is much more random-
  370. looking). There are a few techniques such as prefetch queue
  371. tricks (trying to write to a memory location stored in a
  372.  
  373.  
  374.                                                                 Page 7
  375.  
  376.  
  377.  
  378. processor's instruction prefetch area, which kills debuggers) and
  379. using 386 debugging registers to kill debuggers like SoftIce that
  380. I have not used because they are incompatible with some systems
  381. (like OS/2 -- which really helped in writing Protect).
  382.  
  383.      Protect! v5.5 adds about 1k to a file with an average-sized
  384. modification error message. The mutation engine can vary the size
  385. somewhat, and Protect! will usually be able to take a few hundred
  386. bytes from the file header on EXE's. The encryption is no longer
  387. anything closely resembling a simple-XOR sequence, and having a
  388. string of constant bytes does not necessarily mean constant bytes
  389. in the result file, with or without compression. The compression
  390. is a simple derivative of the Lempel-Ziv algorithm, but it is
  391. nothing compared to the complexity of the compression used in
  392. PKLite. You may layer multiple copies of Protect! on top of each
  393. other, but that will start to cause noticeable delays in loading.
  394.  
  395.      Like v.4.0 and unlike versions before that, Protect! is
  396. written entirely in assembly language, mostly with the A86
  397. assembler. I write and test Protect! on both my 486 DX/2-66
  398. running OS/2 and my not-yet-buried 4.77/10 mhz switchable "turbo"
  399. XT. Protect! has been around for a while, with many people
  400. pitching in ideas to make it more secure. If you have any
  401. suggestions, questions, comments, etc. about Protect!, you can
  402. easily contact me through Compuserve/Internet e-mail (my PGP 2.6
  403. key is available upon request), or if nothing else, postal "snail
  404. mail" and I am usually pretty open to your comments.
  405.  
  406.  
  407.  
  408.  
  409.  
  410. Compression Notes
  411. -----------------
  412.  
  413.  
  414.      One of the improvements to this version of Protect! EXE/COM
  415. is the integrated compression. By using a derivation of the
  416. Lempel-Ziv compression algorithm, both EXE and COM files can
  417. occupy less disk space in addition to being encrypted. One of the
  418. biggest reasons for doing this is to make your files more
  419. secure -- the images of popular code compressors like LZEXE,
  420. PKLITE (R), and TinyProg are all well-known. It is easier for a
  421. hacker or hacking program to trace for or into known code (like
  422. LZEXE's decompressor) than for it to trace directly into the
  423. program or into another layer of Protect. There is also something
  424. to be said for reducing redundant expressions in the code, and
  425. the new encryption algorithms in this version also help hide
  426. redundancy.
  427.  
  428.      You can opt not try attempt to compress a specific file by
  429. putting a "-N" at the end of the command line. You may want to do
  430. this if you are using another compressor with Protect!
  431. (Protect!'s compression ratios may not be as good as those found
  432. in dedicated compressors due to speed considerations). Also, if
  433. you have an especially large file that is only compacted by a few
  434.  
  435.  
  436.                                                                 Page 8
  437.  
  438.  
  439.  
  440. percent, you may want to turn the compression off to eliminate
  441. some loading time overhead. If a file is too small to benefit from
  442. compression or shrinks by less than 5%, it won't be used. For most 
  443. files, any compression overhead is unnoticeable, and in general, 
  444. leaving Protect! to try to compress files is the best idea. 
  445.  
  446.  
  447.  
  448.  
  449.  
  450. What's The Mutation Engine?
  451. ---------------------------
  452.  
  453.  
  454.      A portion of Protect! EXE/COM that is largely responsible
  455. for keeping people from making master unProtect programs is the
  456. "mutation engine." It is basically the "front door" that keeps
  457. master unProtects out.
  458.  
  459.      Many utilities that can attach an envelope on an EXE (such
  460. as LZEXE or other file compression utilities) have are the same
  461. every time. That is why UNLZEXE or generic unprotect-type
  462. utilities are pretty easy to make. When an unprotection utility
  463. (such as UNP) unprotects a file, it creates a virtual-DOS
  464. environment for the file to run in until the file finishes
  465. decrypting itself. When it is done decrypting itself, the
  466. unprotect utility simply writes what's in memory to disk and you
  467. have your unprotected file. (not that difficult, right ?) The
  468. program may use a different key every time and even encrypt
  469. itself, but all the unprotect program has to do is just trace
  470. through that until it gets to the original entry point, and all
  471. of that is for naught. 
  472.  
  473.      One of the tricks for foiling unprotection utilities and
  474. debuggers lies is the fact that the unprotector must always have
  475. control over the Protected program in order to stop it when it is
  476. decrypted in memory. If you remove the unprotector's control and
  477. subvert it without harming the operating system or other
  478. concurrently-running applications, you are one step ahead in
  479. protecting your programs. However, an unprotect program author
  480. can just instruct his utility to detect the type of file and
  481. blank out the bytes that would kill it when it gets to them. This
  482. would result into a high-tech cat-and-mouse game.
  483.  
  484.      The reason that it isn't too difficult to make normal
  485. unprotects stems from the fact that the protector's security
  486. envelope is the *same every time*. I coded a mutation engine for
  487. Protect! to make sure that the security envelopes wouldn't be the
  488. same every single time a new one is encoded. Instead of being
  489. able to "trace in" a definite number of bytes every time and
  490. being able to blank out a certain number of bytes every time,
  491. these figures will have to vary between each and every different
  492. file that is Protected. If you get one original file and Protect
  493. on several different occasions, it will never be the same length
  494. or have the same content every time (there are thousands and
  495. thousands of different combinations). My mutation engine randomly
  496. decides which machine code instructions to use every time: it may
  497.  
  498.  
  499.                                                                 Page 9
  500.  
  501.  
  502.  
  503. use a 3 or 4 byte equivalent of a 2 byte instruction or vice-
  504. versa in any order that works. Because there are definite rules
  505. for this mutation, it will work every time. Since the mutated
  506. portion is relatively small (but effective), an extra byte or two
  507. in a spot will not adversely affect the performance of your
  508. Protected files. Garbage code and other distractions make it even
  509. more difficult for a hacker to write a master unProtect. Protect!
  510. uses both a mutation engine and a variety of anti-debug tricks
  511. interspersed throughout to help attain maximum security for your
  512. files.
  513.  
  514.  
  515.  
  516.  
  517.  
  518. Closing
  519. -------
  520.  
  521.  
  522.      There is no doubt that Protect! EXE/COM can save you time,
  523. effort, energy, and money in securing your files. There are NO
  524. "run-time fees" or royalties for Protect! EXE/COM; you can
  525. Protect and distribute any number of files (legally, that is)
  526. once you register. The cost is $25 per copy of Protect! EXE/COM
  527. per machine. The registered version will allow you to specify
  528. your own modification error messages and comes without the "beg
  529. screen." Protect! EXE/COM is not "crippleware," so you are
  530. basically on your honor to register before you distribute
  531. Protected files. 
  532.  
  533.  
  534.      There is a definite threat of hackers and viruses on the
  535. loose and it is your responsibility to protect your programs.
  536. What other utilities try, Protect! does. With powerful
  537. encryption, compression, anti-debugging, and modification-
  538. detection abilities, Protect! EXE/COM has the ability to provide
  539. your programs solid protection.
  540.  
  541.      Thank you for evaluating Protect! EXE/COM!
  542.  
  543.  
  544. Address
  545. -------
  546.  
  547.  
  548.                Jeremy Lilley
  549.                Protect! EXE/COM
  550.                2711 Oak View Circle
  551.                Medford, Oregon 97504
  552.                Compuserve: 75060,2074
  553.                Internet: 75060.2074@compuserve.com
  554.  
  555.