ooooo ooo ooooooooo. ooooooo ooooo `888' `8' `888 `Y88. `8888 d8' 888 8 888 .d88' Y888..8P 888 8 888ooo88P' `8888' 888 8 888 .8PY888. `88. .8' 888 d8' `888b `YbodP' o888o o888o o88888o The Ultimate Packer for eXecutables Copyright (c) 1996-1999 Markus Oberhumer & Laszlo Molnar http://cdata.tvnet.hu/~ml/upx.html http://wildsau.idv.uni-linz.ac.at/mfx/upx.html Table of Contents ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Abstract Disclaimer Introduction Usage Commands Options Notes for the supported executable formats Notes for dos/exe Notes for dos/com Notes for dos/sys Notes for djgpp2/coff Notes for watcom/le Notes for win32/pe Notes for rtm32/pe Notes for tmt/adam Notes for atari/tos Thanks Copyright .__.. , , [__]|_ __-+-._. _. _.-+- | |[_)_) | [ (_](_. | ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ UPX is a portable, extendable, high-performance executable packer for several different executable formats. It achieves an excellent compression ratio and offers *very* fast decompression. Your executables suffer no memory overhead or other drawbacks. While you may use UPX freely for both non-commercial and commercial executables (for details see the file LICENSE), we would highly appreciate if you credit UPX and ourselves in the documentation, possibly including a reference to the UPX home page. Thanks. [ Using UPX in non-OpenSource applications without proper credits is considered not politically correct ;-) ] .__ . | \* __ _.| _.*._ _ _ ._. |__/|_) (_.|(_]|[ | )(/,[ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This is a beta-test release, so DO NOT USE THIS VERSION EXCEPT FOR TESTING. Only compress backups of your executables. Be prepared for crashes and other nasty surprises. This version is not compatible with any previous or future release ! UPX comes with ABSOLUTELY NO WARRANTY; for details see the file LICENSE. Having said that, we think that UPX is quite stable. Indeed we have compressed lots of files without any problems. Also, the current version has undergone several months of beta testing - acutally it's now more than 9 months since our first public beta. Please report all problems or suggestions to the authors. Thanks. ._. , . , | ._ -+-._. _ _|. . _.-+-* _ ._ _|_[ ) | [ (_)(_](_|(_. | |(_)[ ) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ UPX is a versatile executable packer with the following features: - excellent compression ratio: compresses better than zip/gzip, use UPX to decrease the size of your distribution ! - very fast decompression: about 10 MB/sec on a P133 - no memory overhead for your compressed executables - safe: you can list, test and unpack your executables Also, a checksum of both the compressed and uncompressed file is maintained internally. - universal: UPX can pack a number of executable formats: * dos/exe * dos/sys * dos/com * djgpp2/coff * watcom/le (supporting DOS4G, PMODE/W, DOS32a and CauseWay) * win32/pe * rtm32/pe * tmt/adam * atari/tos - portable: UPX is written in portable endian-neutral C++ (the official version is compiled with djgpp, but we are indeed partly developing it under Linux + dosemu) - extendable: because of the class layout it's very easy to support new executable formats or add new compression algorithms - free: UPX can be distributed and used freely. And possibly we will release the final version under the GNU General Public License (GPL)... You probably understand now why we call UPX the "ultimate" executable packer. __ . / ` _ ._ _ ._ _ _.._ _| __ \__.(_)[ | )[ | )(_][ )(_]_) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ [ main commands are compress, decompress, test and list ] [ about the compression levels ] UPX offers nine different compression levels from `-1' to `-9'. The default compression level is `-7'. Compression levels 1, 2 and 3 are pretty fast. Compression levels 4, 5 and 6 achieve a good time/ratio preformance. Compression levels 7, 8 and 9 favor compression ratio over speed. Note that compression level `-9' can be quite slow for some large files, but you definitely should use it when releasing a final version of your program. (E.g. it took about 15 minutes to compress the almost 5 MB MAME 0.34 with `-9' on my P133, but the resulting executable was still ~40 kB smaller than when using `-7'.) [ ...to be written... ] .__. , | |._ -+-* _ ._ __ |__|[_) | |(_)[ )_) ÄÄÄ |ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ `-q': be quiet, suppress warnings `-q -q' (or `-qq'): be very quiet, suppress errors [ ...to be written... ] . . , ._ . / |\ | _ -+- _ __ |, _ ._. _| _ __ / _ \./ _ | \|(_) | (/,_) | (_)[ (_](_)_) / (/,/'\(/, ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ dos/exe stands for all "normal" 16-bit DOS executables. UPX handles overlays like other exepackers do: it simply copies the overlay after the compressed image. This works with some files, but doesn't work with others. Obviously UPX won't work with executables that want to read data from themselves (like some commandline utilities that ship with Win95). Compressed programs only work on a 386+. Extra options available for this executable format: --8086 Create an executable that works on any 8086 CPU. --strip-overlay Strip any overlay from the program instead of copying it. Be warned, this will usually make the compressed program crash or otherwise unusable ! . . , ._ . / |\ | _ -+- _ __ |, _ ._. _| _ __ / _. _ ._ _ | \|(_) | (/,_) | (_)[ (_](_)_) / (_.(_)[ | ) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Obviously UPX won't work with executables that want to read data from themselves (like some commandline utilities that ship with Win95). Compressed programs only work on a 286+. Packed programs will be byte-identical to the original after uncompression. Maximum uncompressed size: ~65100 bytes. Extra options available for this executable format: --8086 Create an executable that works on any 8086 CPU. . . , ._ . / |\ | _ -+- _ __ |, _ ._. _| _ __ / __ . __ | \|(_) | (/,_) | (_)[ (_](_)_) / _) \_|_) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ _| ÄÄ You can only compress plain sys files, sys/exe (two in one) combos not supported. Compressed programs only work on a 286+. Packed programs will be byte-identical to the original after uncompression. Maximum uncompressed size: ~65350 bytes. Extra options available for this executable format: --8086 Create an executable that works on any 8086 CPU. . . , ._ . _, / ._._ |\ | _ -+- _ __ |, _ ._. _| * _ ._ ._ '_) / _. _ |,|, | \|(_) | (/,_) | (_)[ (_] |(_][_)[_)/_. / (_.(_)| | ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ._|._|| | ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ It is recommended to use UPX *instead* of strip - strip has the very bad habit of replacing your stub with it's own (old) version. Also, UPX corrects a bug/feature in strip v2.8 and higher: it will fix the 4 KByte aligment of the stub. UPX includes the full functionality of stubify. This means it will automatically stubify your COFF files. Use the option `--coff' to disable this behaviour (see below). UPX handles Allegro packfiles. The DLM format (a rather exotic shared library extension) is not supported. Packed programs will be byte-identical to the original after uncompression. All debug information and trailing garbage will be stripped, though. Maximum .text section size is 16 MBytes. Extra options available for this executable format: --coff Produce COFF output instead of EXE. By default UPX keeps your current stub. BTW, UPX is the successor of the DJP executable packer. . . , ._ , / . |\ | _ -+- _ __ |, _ ._. . , _.-+- _. _ ._ _ / | _ | \|(_) | (/,_) | (_)[ \/\/ (_] | (_.(_)[ | )/ |(/, ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ UPX has been successfully tested with the following extenders: DOS4G, DOS4GW, PMODE/W, DOS32a, CauseWay. The WDOS/X extender isn't supported yet. Yes, you can use your compressed executables with DOS4GW. UPX compresses *much* better than PMWLITE. Try it ! The LX format is not yet supported. Maximum code object size is 16 MBytes. DLLs are not supported. Extra options available for this executable format: --le Produce an unbound LE output instead of keeping the current stub. . . , ._ _, _, / |\ | _ -+- _ __ |, _ ._. . ,*._ '_) '_) / ._ _ | \|(_) | (/,_) | (_)[ \/\/ |[ )._) /_. / [_)(/, ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ | ÄÄÄÄ The PE support in UPX is new and experimental, so there are possibly lots of bugs in it. Also, uncompression is not yet supported. Compression ratio is the best among other PE packers (see A.C.T. at http://act.by.net/ ). DLLs are supported. Data not in any PE section will be silently dropped. Extra options available for this executable format: --compress-exports Compress the export section. This can improve the compression ratio quite a bit but may not work with all programs. UPX never compresses the export section of a DLL regardless of this option. --compress-icons Compress all but the first icon. --force-compress Force compression even when there is an unexpected value in a header field. Be careful, your compressed executable might not work if you use this option. . . , ._ , _, _, / |\ | _ -+- _ __ |, _ ._. ._.-+-._ _ '_) '_) / ._ _ | \|(_) | (/,_) | (_)[ [ | [ | )._) /_. / [_)(/, ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ | ÄÄÄÄ Same as win32/pe. . . , ._ , , / . |\ | _ -+- _ __ |, _ ._. -+-._ _ -+- / _. _| _.._ _ | \|(_) | (/,_) | (_)[ | [ | ) | / (_](_](_][ | ) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This format is used by the TMT Pascal compiler (http://www.tmt.com/). Since we are no Pascal programmers ;-), this format is fairly untested. Please test it, and report any problem. Extra options available for this executable format: (none) . . , ._ , / , |\ | _ -+- _ __ |, _ ._. _.-+- _.._.* / -+- _ __ | \|(_) | (/,_) | (_)[ (_] | (_][ |/ | (_)_) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This is the excutable format used by the Atari ST, a 68000 based personal computer which was popular in the late '80s. Support of this format is only because of nostalgic feelings of one of the Authors and serves no practical purpose :-). [ Any feedback - postive or negative - on the functionality of this format is highly welcome because the whole stuff was written and tested using the STonX emulator without access to real hardware. ] Packed programs will be byte-identical to the original after uncompression. All debug information and trailing garbage will be stripped, though. Extra options available for this executable format: --strip-overlay Strip any overlay from the program. By default UPX refuses to pack executables that seem to have data appended after the relocation table. As overlays are not widely used on the Atari this could be some extra debug information, and so there's a good chance that the compressed program will work. --copy-overlay Try this option if programs after --strip-overlay don't work. .___.. . | |_ _.._ ;_/ __ | [ )(_][ )| \_) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Charles W. Sandmann for the ideas with the stubless decompressor in djgpp2/coff. Joergen Ibsen for the address optimization idea. Salvador Eduardo Tropea for the beta testing. Ralph Roth for reporting several bugs. Lukundoo for beta testing. The WINE project (http://www.winehq.com/) for lots of useful information found in their PE loader sources. DJ Delorie for djgpp. Linus for Linux. Natascha __ . , / ` _ ._ .._.* _ |_ -+- \__.(_)[_)\_|[ |(_][ ) | ÄÄÄÄÄÄ |ÄÄ._|ÄÄÄÄ._|ÄÄÄÄÄ Copyright (C) 1996-1999 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-1999 Laszlo Molnar This program may be used freely, and you are welcome to redistribute it under certain conditions. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the UPX License Agreement for more details. You should have received a copy of the UPX License Agreement along with this program; see the file LICENSE. If not, visit the UPX home page. Spread and enjoy, Markus & Laszlo Markus F.X.J. Oberhumer Laszlo Molnar markus.oberhumer@jk.uni-linz.ac.at ml1050@cdata.tvnet.hu