home *** CD-ROM | disk | FTP | other *** search
/ Computer Music Interacti…pecial Edition 2000 April / cd.iso / pc / PC / Compression / Petite / Info.txt < prev    next >
Encoding:
Text File  |  1999-12-15  |  14.3 KB  |  375 lines

  1. Petite 2.2 - Copyright (c) 1998-99 Ian Luck. All rights reserved.
  2. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  3.  
  4. Files that you should have found in the Petite package
  5. ======================================================
  6. PETITE.EXE    The Petite executable (console version)
  7. PETGUI.EXE    The Petite executable (GUI version)
  8. PETITE.TXT    This file
  9. REGISTER.TXT  Registration details
  10. FILE_ID.DIZ   BBS description file
  11.  
  12.  
  13. What's the point?
  14. =================
  15. Petite is a Windows 9x/NT executable (EXE/DLL/etc...) compressor. It
  16. allows compression of the whole executable - code, data and resources.
  17. Petite automatically decides which parts of the executable can be
  18. compressed and which parts need to be left as they are. The compressed
  19. output executable can be run as if it was the original uncompressed
  20. version.
  21.  
  22.  
  23. Why "Petite"?
  24. =============
  25. The file format of Win32 (Windows 9x/NT) executables is called the
  26. "Portable Executable" file format, "PE" for short. Petite means "of
  27. small and dainty build", which kind of describes the executables
  28. after they've been compressed! And, Petite obviously begins with "PE"!
  29. Clever huh? :)
  30.  
  31.  
  32. Main Features
  33. =============
  34. * Compresses all Win32 PE files
  35. - including EXE, DLL, DRV etc...
  36.  
  37. * Automatic compression decision making
  38. - decides which parts are compressable and which are not
  39.  
  40. * Resource compression
  41. - user selectable which resource types to compress
  42.  
  43. * 100% Assembler decompression code
  44. - no noticeable delay at load time in most cases
  45.  
  46. * Virus/tampering checking
  47. - the compressed files automatically check themselves when executed
  48.  
  49. * Very small memory requirements
  50. - only 4-8k image overhead
  51.  
  52. * Command-line version...
  53. - allows use from within compilers and makefiles
  54.  
  55. * ... and a GUI version
  56. - quick and easy to use
  57.  
  58.  
  59. Command-Line Options (console version)
  60. ======================================
  61. -i     Display file information:
  62.        Displays a list of the sections in the file and a list of the
  63.        resource types used. Also displays information on how much of
  64.        the file is compressable.
  65. -<0-9> Set the compression level
  66.        As the level gets higher the compression gets better, but you'll
  67.        need a fast computer (or a lot of time) when using the highest
  68.        levels! (default: 0) NOTE: The compression level has no effect
  69.                                   on the decompression speed.
  70. -o<file> Set output filename:
  71.        Sets the compressed output filename.
  72. -b<0|1> switch: Backup original file:
  73.        Renames the original file to "file.BAK". Backups are disabled
  74.        when the "-o" option is used. 0=OFF, 1=ON (default: ON)
  75. -t<0|1> switch: Compress import tables
  76.        If files don't work after compression, try switching this OFF.
  77.        0=OFF, 1=ON (default: ON)
  78. -e<0|1|2> switch: Compress exports
  79.        If files don't work after compression, then try switching this.
  80.        0=OFF, 1=ON, 2=ON+EXE TABLES (default: ON)
  81.          ON: The exports are compressed, but not the export table.
  82.          ON+EXE TABLES: The exports AND export table are compressed when
  83.                         compressing EXEs. The table is never compressed
  84.                         in DLLs as the DLLs would then not be importable.
  85. -s<0|1|2> switch: Strip relocations
  86.        0=OFF, 1=EXE ONLY, 2=ALWAYS (default: EXE ONLY)
  87.          OFF: The relocation information is retained.
  88.          EXE ONLY: Any relocation information is stripped from EXEs,
  89.                    but retained in DLLs.
  90.          ALWAYS: The relocation information is always stripped. Only
  91.                  use this when you are sure that a DLL will never need
  92.                  to be relocated.
  93. -r<res1,res2,res3...> Select resource types for compression:
  94.        (default: NONE) ... SEE BELOW FOR DETAILS
  95. -x<res1,res2,res3...> Select resource types for NON-compression:
  96.        Excludes the selected resource types from compression, this is
  97.        only really useful when using the "-r*" option.
  98. -m<0|1> switch: Mangle import tables
  99.        Messes up the import tables during run-time. This may not work with
  100.        files that import data items. 0=OFF, 1=ON (default: ON)
  101. -v<0|1> switch: Virus checking
  102.        Makes the compressed files check themselves for virus infection
  103.        every time they are executed. 0=OFF, 1=ON (default: ON)
  104. -a     Align the file to 4k boundary
  105.        This improves loading speed in Windows 98, but it also increases
  106.        the size... not recommended for use with small files.
  107. -p<0|1> switch: Display compression progress:
  108.        Disables/enables the displaying of the compression progress
  109.        counter. 0=OFF, 1=ON (default: ON)
  110. -y     Overwrite existing files
  111. -n     Don't overwrite existing files
  112. -shell Register shell extension
  113.        This allows you to compress an EXE/DLL file by simply right-clicking
  114.        on it in Windows Explorer. You may also choose the options to be used,
  115.        by specifying them at the same time as this option... For example,
  116.        "Petite -shell -b0" will register the shell extension, and when used,
  117.        Petite will not create backups.
  118. -shellx Unregister shell extension
  119.  
  120. NOTE: You can use wildcards and multiple filenames in the command-line.
  121.       If you use a filename with any spaces then the whole filename must
  122.       be enclosed in quotes.
  123.       Valid examples:
  124.                petite *.exe -b0 -r* -xTYPELIB
  125.                petite "my file.dll" -ob.dll
  126.                petite a.drv b* c.exe -1
  127.                petite -y "*.dll" -b0 -5
  128.                petite a*.exe b.exe -p0 -e2
  129.  
  130. TIP: To produce the smallest files, use the "-r**" and "-e2" command-line
  131.      options. Obviously, using higher compression levels also produces
  132.      smaller files.
  133.  
  134.  
  135. Compressing Resources
  136. =====================
  137. All resources are grouped into types, which can be either a number or a
  138. word. To see a list of the resource types used in a file you should run
  139. Petite using the "-i" (display information) and "-r" (compress resources)
  140. options. eg: petite blah.exe -i -r
  141.  
  142. The resource types selected for compression must be seperated by a comma
  143. without any spaces.   Valid examples:
  144.          petite ... -r2          compress only bitmaps
  145.          petite ... -r2,10       compress bitmaps and user data
  146.          petite ... -rmytype     compress "mytype" resources
  147.          petite ... -r2,mytype   compress bitmaps and "mytype" res
  148.          petite ... -r*          compress all resources except 3,14,22,16
  149.  
  150. Common resource types are listed below. It is recommended that you don't
  151. compress icon resources (types 3,14,22), otherwise the program's icon will
  152. not be visible in the Start menu or a directory listing. Also, version
  153. information (type 16) should not be compressed as it would be needed if a
  154. program wanted to check the version of the file. "*" can be used to
  155. respresent all resource types other than version information and icons
  156. (types 3,14,22,16). "**" can be used to represent all resource types other
  157. than version information and all but the 1st icon. You can also use the
  158. "-x" option to select other types to exclude from compression.
  159.  
  160. Whichever resources you choose to compress, you should make sure the new
  161. compressed file loads properly before deleting the original file. It is
  162. probably wise to be on the safe side and test all files you compress with
  163. Petite before deleting the original.
  164.  
  165. Standard Resource Types
  166. -----------------------
  167. 1    Cursor
  168. 2    Bitmap
  169. 3    Icon
  170. 4    Menu
  171. 5    Dialog
  172. 6    String
  173. 7    Font directory
  174. 8    Font
  175. 9    Accelerator
  176. 10   User resource data
  177. 11   Message table
  178. 12   Cursor directory
  179. 14   Icon directory
  180. 16   Version info
  181. 21   Animated cursor
  182. 22   Animated icon
  183.  
  184.  
  185. Building an excutable with Petite
  186. =================================
  187. Because Petite is command-line driven it can easily be used within a
  188. compiler's build process or makefile. The only extra things you have
  189. to do is use the "-p0" (progress off) option and possibly the "-y"
  190. (overwrite) option.
  191.  
  192. Using Petite with Visual C++
  193. ----------------------------
  194. 1) Open the "Project Settings" dialog (press Alt-F7) and select the
  195.    project configuration you wish to produce a compressed executable.
  196. 2) Goto the "Link" page and remove the ".exe" extension from the
  197.    "Output file name". eg: "Release/blah.exe" -> "Release/blah"
  198. 3) Goto the "Custom Build" page and enter the following "Build command":
  199.      "petite -p0 -y $(InputPath) -o$(InputPath).exe" (+extra options)
  200. 4) Enter the following "Output file":
  201.      "$(InputPath).exe"
  202.  
  203. If you wish to compress a DLL, rather than an EXE, then replace all cases
  204. of "exe" above with "dll".
  205.  
  206. NOTE: You should make sure Petite is in the path. This is most easily
  207.       achieved by copying PETITE.EXE into the Windows directory.
  208.  
  209.  
  210. Compressed files not working?
  211. =============================
  212. Some compressed files may not work, there are a few possible reasons for
  213. this. If you do find a file that does not work after compression, try
  214. checking these causes. If you know that none of these cases apply to the
  215. file in question, then please send details (email at end of this file).
  216.  
  217. Extra data attached (not fixable)
  218. ---------------------------------
  219. Some files, noteably installation packages, have data attached to the
  220. end of the file. This data is stripped by Petite as it is not part of
  221. the EXE structure. If the extra data is of importance to the file, not
  222. debug info or other unnecessary data, then this may mean that the
  223. compressed file does not work. Petite will display a warning message
  224. if it finds any additional data at the end of a file.
  225.  
  226. Exports called before decompression (possibly fixable)
  227. ------------------------------------------------------
  228. Sometimes, very rarely, an EXE will link to a DLL that will inturn call
  229. back a function in the EXE. The problem is that the DLL is linked to the
  230. EXE by the system before the EXE can decompress itself. Obviously, if
  231. the EXE has not yet been decompressed, the DLL ends up calling a load of
  232. rubbish and the program will crash.
  233.  
  234. You can try switching off "Export Compression" ("-e0" option). This may
  235. vastly reduce the compression results, and the compressed program may
  236. still not work if the function that's called back needs to access data
  237. from a compressed part of the file.
  238.  
  239. Resources accessed before decompression (always fixable)
  240. --------------------------------------------------------
  241. This problem is similar to the previous exports problem, except this time
  242. a linked DLL is trying to access a resource before it's been decompressed.
  243. Obviously, this can only be a problem if you have compressed a resource
  244. that the DLL is trying to access. 
  245.  
  246. Unlike the exports problem, this problem is always fixable. You should try
  247. without compressing resources, if the compressed file works then you should
  248. try to find which resource is causing the problems. You can do this by
  249. compressing the different resources one by one and seeing which ones stop
  250. the file working. Then simply compress the file, without compressing the
  251. problem resource(s).
  252.  
  253. If the problem file has a resource type called "TYPELIB", then try without
  254. compressing this resource type first.
  255.  
  256. Modification detection (not fixable)
  257. ------------------------------------
  258. If the EXE has some built-in modification detection, then the chances are
  259. it will detect that the file has been "modified", and it will probably
  260. refuse to work. Obviously, there are no fixes to this and these files are
  261. uncompressable.
  262.  
  263. Data item importing (always fixable)
  264. ------------------------------------
  265. If the file imports data items from a DLL, then import table mangling could
  266. cause problems. Try disabling the import mangling option.
  267.  
  268.  
  269. Decompression?
  270. ==============
  271. There is no Petite decompressor. So if it is not possible for you to
  272. re-install or re-compile a file, then you should keep a backup of the
  273. original incase you should want to go back to it at any time.
  274.  
  275.  
  276. Latest Version
  277. ==============
  278. The latest version of Petite can always be found at the Petite homepage:
  279.  
  280.     http://www.un4seen.com/petite/
  281.  
  282.  
  283. Credits
  284. =======
  285. Parts of the compression system used in Petite are developed from the
  286. ZLIB library by Jean-loup Gailly & Mark Adler.
  287.  
  288.  
  289. Copyright, Disclaimer etc...
  290. ============================
  291. Petite is not free, it is SHAREWARE. You are allowed 21 days to
  292. evaluate it and decide if it's of any use to you. If you want to
  293. continue using it after this period you must register. See
  294. REGISTER.TXT for details.
  295.  
  296. This software is provided as-is, without warranty of ANY KIND,
  297. either expressed or implied, including but not limited to the implied
  298. warranties of merchantability and/or fitness for a particular purpose.
  299. The author shall NOT be held liable for ANY damage to you, your
  300. computer, or to anyone or anything else, that may result from its use,
  301. or misuse. Basically, you use it at YOUR OWN RISK.
  302.  
  303. Use of this software indicates that you agree to the above conditions.
  304.  
  305. You may freely copy and distribute Petite as long as NO FEE is charged
  306. and all the files remain intact AND unmodified.
  307.  
  308. All trademarks and other registered names contained in the Petite
  309. package are the property of their respective owners.
  310.  
  311.  
  312. History
  313. =======
  314. 2.2 - 15/12/99
  315. --------------
  316. * GUI version
  317. * "-r**" compress all but 1st icon option
  318. * "-s" strip relocations option
  319. * "-m" mangle imports option
  320. * A few more improvements/fixes
  321.  
  322. 2.1 - 13/5/99
  323. -------------
  324. * A few improvements/fixes
  325.  
  326. 2.0 - 19/4/99
  327. -------------
  328. * Improved ratios
  329. * Shell extension
  330. * "-e2" (ON+EXE TABLES) exports option
  331. * "-a" alignment option
  332. * "-l" option removed
  333. * A load of other little improvements
  334.  
  335. 1.4 - 27/1/99
  336. -------------
  337. * Improved ratios
  338. * Reduced image overhead
  339.  
  340. 1.3a - 13/11/98
  341. ---------------
  342. * A couple of bug fixes
  343.  
  344. 1.3 - 8/11/98
  345. -------------
  346. * More re-structuring
  347. * "-f" option removed, now permanently ON
  348. * Virus/tampering checking
  349. * "-x" option
  350. * A few other minor improvements/fixes
  351.  
  352. 1.2 - 25/6/98
  353. -------------
  354. * Further optimized decompression code
  355. * Petite becomes a Win32 only executable (no longer DOS)
  356. * Fixed NT bug, and a few other special case bugs
  357.  
  358. 1.1 - 27/5/98
  359. -------------
  360. * Data moving
  361. * Resource type "*"
  362. * Fixed occasional section joining bug
  363.  
  364. 1.0 - 22/5/98
  365. -------------
  366. First Release
  367.  
  368.  
  369. Bug Reports, Suggestions, Coments, Problems etc...
  370. ==================================================
  371. If you have any of the aforementioned you can email:
  372.  
  373.         petite@un4seen.com
  374.  
  375.