___.__ _.____.___ __/\__ __/\__ \ | ____ __/\__\. \ / \/ ___\| \| < | / | < < T < | /_.___| /__._/ /__.__\_ __.__\ l_.___\ /__.___\ /______| l___.__\ \/ /_______\AnG .:the:smaller:the:better:. Copyright (c) 1997-99 by ÄúJibzúÄ All Rights Reserved ...aBOUT....................... ...aPACK "LIMITATIONS"......... ...aRGUMENTS................... ...a GUIDE TO aPACK............ ...aLGORITHM................... ...aRCHITECTURE................ ...aPPRECIATION................ ...aLWAYS THE NEWEST VERSION... ...aND HOW TO REACH ME......... aBOUT: ÄÄÄÄÄÄ Humm .. well .. nothing much to say yet .. the whole idea behind this packer is to make executable files (especially small ones) as small as possible (hence the slogan).. Exe-packers like LZEXE are ok for small files .. but the depacker takes up 330 bytes... WWPACK is great for medium and large files because its compression is great ;) .. but _at_least_ 380 bytes for a depacker is way too much for 4k intros and BBS-intros (IMHO ;).. The depacker in aPACK is between 136 and 315 bytes long (depending on the input file). I have put a lot of work into making it as small as possible. Compression ratio is mostly better than UPX and WWPACK (if you want your file to be as small as possible, try them all :) Check out the following chart (if you find an error, or you think I have left out a good packer, or you don't want your packer here - tell me): EXE-file Orig. COMPACK UCEXE WWPACK PKSMART UPX aPACK ------------------------------------------------------------------------- trifill 1,969 1,505 1,664 1,528 1,440 1,322 1,175 ask 2,707 2,026 2,304 2,167 2,070 1,997 1,822 fakecd 8,944 5,290 5,568 5,312 5,180 5,183 4,865 rm 15,296 9,978 10,224 9,811 9,605 9,684 8,973 gifblast 52,395 24,778 24,461 23,950 23,567 23,486 22,818 go32 78,826 47,082 46,925 45,377 45,035 44,779 41,561 dcf 84,726 47,738 47,149 46,151 45,755 45,749 43,755 dvpeg 119,842 66,954 66,029 64,284 63,669 63,642 62,146 ncmain 213,669 111,674 109,621 106,543 105,780 105,764 99,500 gws 341,444 133,994 129,125 125,405 124,025 120,424 117,372 total 919,818 451,019 443,070 430,528 426,126 422,030 403,987 COM-file Orig. COMPACK UCEXE WWPACK PKSMART UPX aPACK ------------------------------------------------------------------------- headrush 5,682 3,864 4,164 4,057 3,875 3,550 3,480 thedream 7,119 4,094 4,404 4,243 4,056 3,827 3,714 2m 14,688 9,612 9,716 9,456 9,180 9,001 8,958 list 41,169 27,184 27,457 26,591 26,317 25,780 25,200 total 68,658 44,754 45,508 45,741 43,428 42,158 41,352 Versions used: COMPACK v5.1 UCEXE v2.4 WWPACK v3.04a (v3.05b5 for ncmain and gws because the ratio was better) PKSMART v1.0b UPX v0.50 (-9 option for all files) aPACK v0.96b So far aPACK is GREET-WARE for non-profitable use (if nobody charges money for programs that are packed with it) which means that if you use it, then you must greet me in your files or docs (well, ain't that cheap!). If you (or anybody else) plans to sell a program packed with aPACK then contact me (look at the end of this file). You may not distribute aPACK without the rest of the files (aPACK.DOC, REGISTER.FRM and WHATS.NEW). And you may not edit any of the files or sell aPACK for money (except for charging for the media). Feel free to upload aPACK to any BBS or site, or including it on a CD.. #ifndef _COMMON_SENCE *** This software is provided "as is". In no event shall I, the author, *** be liable for any kind of loss or damage arising out of the use, *** abuse or the inability to use this software. USE IT ENTIRELY AT *** YOUR OWN RISK! *** This software comes without any kind of warranty, either expressed *** or implied, including, but not limited to the implied warranties of *** merchantability or fitness for any particular purpose. *** If you don't agree with these terms or if your juristdiction does *** not allow the exclusion of warranty and liability as stated above *** you are NOT allowed to use this software at all. #else Bla bla bla .. the usual stuff - you know it anyway: If anything goes even remotely wrong - blame _yourself_, NOT me! #endif aPACK "LIMITATIONS": ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ I do NOT zero any registers in the depacker .. if you need any registers to be zero, then zero them in your code (the packed file will be smaller that way ;). aRGUMENTS: ÄÄÄÄÄÄÄÄÄÄ These are the switches and arguments for aPACK: Syntax: aPACK [options] [output file] General options: EXE-specific: -i Invert literals -d Don't save DS and ES -f Fast packing -h Don't use any relocations -x XT compatible depacker -m NO code mover COM-specific: -v Be verbose -p Leave segment of PSP in DS and ES The switches can be given anywhere in the argument-list, in any case and in any order you like. Input- and output file should be pretty self- explanatory. The switches work like this: -i : Invert literals - this inverts all literals that are transmitted. This makes it somewhat more difficult to read text-strings using an hex-editor or some other viewer (unless of course you invert them back :) .. This is NOT meant to be any kind of protection - it merely makes the exe-file look more uninviting ;) It costs you 3 bytes. -f : Fast packing - disables some time-consuming parts of the packer, but makes the compression ratio worse (I added this again ONLY because I have added some stuff to the packer that realy slows it down, and I might just remove it again :). -x : Will produce a XT-compatible depacker. Will cost you 0 - 3 bytes. -m : Do NOT move packed data and depack to original location - this removes the code to move the packed data, and depack to the original location. This is less compatible (since the code is not depacked back to right after the PSP) and requires more memory - but it will save you 32 - 42 bytes (except for small com files!), so try it out! -v : Be verbose -- output more info while packing. -d : Don't save DS and ES - if you do not need anything from the PSP in your program, then use this switch. It makes the depacker 4 bytes smaller. -h : Don't use any relocations - normaly aPACK uses a single relocation for the EXE-depacker. This switch makes a depacker that does not use any relocations. It costs a few bytes. -p : Leave segment of PSP in DS and ES - this will give you easy access to the PSP from COM-files, and it is compatible with EXE-files converted to COM-files with exe2bin. a GUIDE TO aPACK: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This is a short guide on how to get the most out of aPACK. Fast packing (-f switch) should never be used (I just put it in because most packers seem to have one ;). Normaly code is added to move the data forward and depack it back to the load address. If your program does not require too much memory it may be a good idea to try the '-m' switch. This just depacks the data to right after the packed data and hence requires more memory. It is also less compatible since some programs use the fact that the PSP is right in front of the program. The most common problems with the '-m' switch are addressing the PSP through CS and using a 'ret' to exit from a COM file. COM-files: If you do not exit with a 'ret', and you do not access the PSP, you should try the '-m' switch (but only on files bigger than 27k). If you use '-m' and still want easy access to the PSP, try the '-p' switch. EXE-files: If your program does not require too much memory, you should try the '-m' switch. Most EXE files do not require the PSP to be right in front of the code. If you do not use the PSP, you could further use the '-d' switch. aLGORITHM: ÄÄÄÄÄÄÄÄÄÄ aPACK uses my own version of the LZ algorithm with 57300 bytes lookback and lazy-matching. Tag-bits are inserted in the data to distinguish literal bytes from code-pairs. Code-pairs are encoded using my own version of Gamma-encoding. aRCHITECTURE: ÄÄÄÄÄÄÄÄÄÄÄÄÄ aPACK should run on a 386+ with at least 4mb ram. Files packed with aPACK should run on a 286+. With the -x switch the files should be able to depack on a 8086. aPPRECIATION: ÄÄÄÄÄÄÄÄÄÄÄÄÄ .. goes out to the following people: * Dmitry Bortoq (d'b) for our great discussions of compression techniques :) * "Jurik" for discussing the mysteries of Gamma-encoding with me * The people who made the Epsilon Compression Page * Pasi 'Albert' Ojala for his info on PuCrunch * Piotr Warezak and Rafal Wierzbicki, for making a truly great exe-packer * RIT Research Labs for making Dos Navigator .. it's the BEST! * LiuTaoTao for making TR .. one of the best debuggers around! * Eugene Suslikov (SEN) for making HIEW .. it ROCKS! * Charles Scheffold and Thomas Pytel for making PMODE/W * Michael Tippach (Wuschel) for making WDOSX * Netscape for making the best internet browser (and releasing the source) * All other people who make good software freely available for non- commercial use! A special thanks to the beta-testers: * x-otic (thx mate ;) * Oleg Prokhorov (great optimizations and bug repports!) * METALBRAIN * eL PuSHeR * Elli aLWAYS THE NEWEST VERSION: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ You can find it at: http://apack.home.ml.org/ http://members.xoom.com/jibz/apack/news.htm Or the SAC archive: ftp://ftp.elf.stuba.sk/pub/pc/pack/ aND HOW TO REACH ME: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Well, if you have any questions, suggestions or bug-reports about aPACK (or you just like chatting), this email-address should work: jibz@hotmail.com If you think that aPACK is a good utility and you like using it - feel free to send a money donation to me (will make me work harder ;-). Address at the end of this document, and in REGISTER.FRM. If you want to register aPACK in order to use it commercially fill out the registration form in REGISTER.FRM and mail it to me (if you want a company or site license email me). When you register you will receive a registration key file valid for all updates up to and including the v1.00 release version (if any). Joergen Ibsen Post Danmark Poste Restante Veri Centret Posthus DK - 8240 Risskov Denmark.