📄 upx.pod
字号:
=head1 NAMEupx - compress or expand executable files=head1 SYNOPSISB<upx> S<[ I<command> ]> S<[ I<options> ]> I<filename>...=head1 ABSTRACT The Ultimate Packer for eXecutables Copyright (c) 1996-2007 Markus Oberhumer, Laszlo Molnar & John Reiser http://upx.sourceforge.netB<UPX> is a portable, extendable, high-performance executable packer forseveral different executable formats. It achieves an excellent compressionratio and offers I<*very*> fast decompression. Your executables sufferno memory overhead or other drawbacks for most of the formats supported,because of in-place decompression.While you may use B<UPX> freely for both non-commercial and commercialexecutables (for details see the file LICENSE), we would highlyappreciate if you credit B<UPX> and ourselves in the documentation,possibly including a reference to the B<UPX> home page. Thanks.[ Using B<UPX> in non-OpenSource applications without proper creditsis considered not politically correct ;-) ]=head1 DISCLAIMERB<UPX> comes with ABSOLUTELY NO WARRANTY; for details see the file LICENSE.This is the first production quality release, and we plan that future 1.xxreleases will be backward compatible with this version.Please report all problems or suggestions to the authors. Thanks.=head1 DESCRIPTIONB<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 an ancient Pentium 133, about 200 MB/sec on an Athlon XP 2000+. - no memory overhead for your compressed executables for most of the supported formats - 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: * atari/tos * bvmlinuz/386 [bootable Linux kernel] * djgpp2/coff * dos/com * dos/exe * dos/sys * linux/386 * linux/elf386 * linux/sh386 * ps1/exe * rtm32/pe * tmt/adam * vmlinuz/386 [bootable Linux kernel] * vmlinux/386 * watcom/le (supporting DOS4G, PMODE/W, DOS32a and CauseWay) * win32/pe (exe and dll) * arm/pe (exe and dll) * linux/elfamd64 * linux/elfppc32 * mach/elfppc32 - portable: UPX is written in portable endian-neutral C++ - 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 from version 0.99 the full source code of UPX is released under the GNU General Public License (GPL) !You probably understand now why we call B<UPX> the "I<ultimate>"executable packer.=head1 COMMANDS=head2 CompressThis is the default operation, eg. B<upx yourfile.exe> will compress the filespecified on the command line.=head2 DecompressAll B<UPX> supported file formats can be unpacked using the B<-d> switch, eg.B<upx -d yourfile.exe> will uncompress the file you've just compressed.=head2 TestThe B<-t> command tests the integrity of the compressed and uncompresseddata, eg. B<upx -t yourfile.exe> check whether your file can be safelydecompressed. Note, that this command doesn't check the whole file, onlythe part that will be uncompressed during program execution. This meansthat you should not use this command instead of a virus checker.=head2 ListThe B<-l> command prints out some information about the compressed filesspecified on the command line as parameters, eg B<upx -l yourfile.exe>shows the compressed / uncompressed size and the compression ratio ofI<yourfile.exe>.=head1 OPTIONSB<-q>: be quiet, suppress warningsB<-q -q> (or B<-qq>): be very quiet, suppress errorsB<-q -q -q> (or B<-qqq>): produce no output at allB<--help>: prints the helpB<--version>: print the version of B<UPX>B<--exact>: when compressing, require to be able to get a byte-identical fileafter decompression with option B<-d>. [NOTE: this is work in progress and isnot supported for all formats yet. If you do care, as a workaround you cancompress and then decompress your program a first time - any furthercompress-decompress steps should then yield byte-identical resultsas compared to the first decompressed version.][ ...to be written... - type `B<upx --help>' for now ]=head1 COMPRESSION LEVELS & TUNINGB<UPX> offers ten different compression levels from B<-1> to B<-9>,and B<--best>. The default compression level is B<-8> for filessmaller than 512 kB, and B<-7> otherwise.=over 4=item *Compression levels 1, 2 and 3 are pretty fast.=item *Compression levels 4, 5 and 6 achieve a good time/ratio performance.=item *Compression levels 7, 8 and 9 favor compression ratio over speed.=item *Compression level B<--best> may take a long time.=backNote that compression level B<--best> can be somewhat slow for largefiles, but you definitely should use it when releasing a final versionof your program.Quick info for achieving the best compression ratio:=over 4=item *Try B<upx --brute myfile.exe> or even B<upx --ultra-brute myfile.exe>.=item *Try if B<--overlay=strip> works.=item *For win32/pe programs there's B<--strip-relocs=0>. See notes below.=back=head1 OVERLAY HANDLING OPTIONSInfo: An "overlay" means auxiliary data attached after the logical end ofan executable, and it often contains application specific data(this is a common practice to avoid an extra data file, thoughit would be better to use resource sections).B<UPX> handles overlays like many other executable packers do: it simplycopies the overlay after the compressed image. This works with somefiles, but doesn't work with others, depending on how an applicationactually accesses this overlayed data. --overlay=copy Copy any extra data attached to the file. [DEFAULT] --overlay=strip Strip any overlay from the program instead of copying it. Be warned, this may make the compressed program crash or otherwise unusable. --overlay=skip Refuse to compress any program which has an overlay.=head1 ENVIRONMENTThe environment variable B<UPX> can hold a set of defaultoptions for B<UPX>. These options are interpreted first andcan be overwritten by explicit command line parameters.For example: for DOS/Windows: set UPX=-9 --compress-icons#0 for sh/ksh/zsh: UPX="-9 --compress-icons=0"; export UPX for csh/tcsh: setenv UPX "-9 --compress-icons=0"Under DOS/Windows you must use '#' instead of '=' when setting theenvironment variable because of a COMMAND.COM limitation.Not all of the options are valid in the environment variable -B<UPX> will tell you.You can explicitly use the B<--no-env> option to ignore theenvironment variable.=head1 NOTES FOR THE SUPPORTED EXECUTABLE FORMATS=head2 NOTES FOR ATARI/TOSThis is the executable format used by the Atari ST/TT, a Motorola 68000based personal computer which was popular in the late '80s. Supportof this format is only because of nostalgic feelings of one ofthe authors and serves no practical purpose :-).See http://www.freemint.de for more info.Packed programs will be byte-identical to the original after uncompression.All debug information will be stripped, though.Extra options available for this executable format: --all-methods Compress the program several times, using all available compression methods. This may improve the compression ratio in some cases, but usually the default method gives the best results anyway.=head2 NOTES FOR BVMLINUZ/I386Same as vmlinuz/i386.=head2 NOTES FOR DOS/COMObviously B<UPX> won't work with executables that want to read data fromthemselves (like some commandline utilities that ship with Win95/98/ME).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. --all-methods Compress the program several times, using all available compression methods. This may improve the compression ratio in some cases, but usually the default method gives the best results anyway. --all-filters Compress the program several times, using all available preprocessing filters. This may improve the compression ratio in some cases, but usually the default filter gives the best results anyway.=head2 NOTES FOR DOS/EXEdos/exe stands for all "normal" 16-bit DOS executables.Obviously B<UPX> won't work with executables that want to read data fromthemselves (like some command line utilities that ship with Win95/98/ME).Compressed programs only work on a 286+.Extra options available for this executable format: --8086 Create an executable that works on any 8086 CPU. --no-reloc Use no relocation records in the exe header. --all-methods Compress the program several times, using all available compression methods. This may improve the compression ratio in some cases, but usually the default method gives the best results anyway.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -