📄 upx.html
字号:
may not like the kernel's choice of which to kill. Running /usr/bin/top is one way to check on the usage of swap space.</pre><p>Extra options available for this executable format:</p><pre> (none)</pre><p></p><h2><a name="notes_for_linux_386">NOTES FOR LINUX/386</a></h2><p>Please read the general Linux description first.</p><p>The generic linux/386 format decompresses to /tmp and needs/proc filesystem support. It starts the decompressed programvia the <code>execve()</code> syscall.</p><p>Linux/386 is only selected if the specialized linux/elf386and linux/sh386 won't recognize a file.</p><p>Packed programs will be byte-identical to the original after uncompression.</p><p>How it works:</p><pre> For files which are not ELF and not a script for a known "-c" shell, UPX uses kernel execve(), which first requires decompressing to a temporary file in the filesystem. Interestingly - because of the good memory management of the Linux kernel - this often does not introduce a noticable delay, and in fact there will be no disk access at all if you have enough free memory as the entire process takes places within the filesystem buffers.</pre><pre> A compressed executable consists of the UPX stub and an overlay which contains the original program in a compressed form.</pre><pre> The UPX stub is a statically linked ELF executable and does the following at program startup:</pre><pre> 1) decompress the overlay to a temporary location in /tmp 2) open the temporary file for reading 3) try to delete the temporary file and start (execve) the uncompressed program in /tmp using /proc/<pid>/fd/X as attained by step 2) 4) if that fails, fork off a subprocess to clean up and start the program in /tmp in the meantime</pre><pre> The UPX stub is about 1700 bytes long, partly written in assembler and only uses kernel syscalls. It is not linked against any libc.</pre><p>Specific drawbacks:</p><pre> - You need additional free disk space for the uncompressed program in your /tmp directory. This program is deleted immediately after decompression, but you still need it for the full execution time of the program.</pre><pre> - You must have /proc filesystem support as the stub wants to open /proc/<pid>/exe and needs /proc/<pid>/fd/X. This also means that you cannot compress programs that are used during the boot sequence before /proc is mounted.</pre><pre> - Utilities like `top' will display numerical values in the process name field. This is because Linux computes the process name from the first argument of the last execve syscall (which is typically something like /proc/<pid>/fd/3).</pre><pre> - Because of temporary decompression to disk the decompression speed is not as fast as with the other executable formats. Still, I can see no noticable delay when starting programs like my ~3 MB emacs (which is less than 1 MB when compressed :-).</pre><p>Extra options available for this executable format:</p><pre> --force-execve Force the use of the generic linux/386 "execve" format, i.e. do not try the linux/elf386 and linux/sh386 formats.</pre><p></p><h2><a name="notes_for_ps1_exe">NOTES FOR PS1/EXE</a></h2><p>This is the executable format used by the Sony PlayStation (PSone),a Mips R3000 based gaming console which is popular since the late '90s.Support of this format is very similar to the Atari one, because ofnostalgic feelings of one of the authors, but this format maybe servesa practical purpose ;-).</p><p>Packed programs will be byte-identical to the original after uncompression.</p><p>Maximum uncompressed size: ~1998848 bytes.</p><p>Notes:</p><pre> - UPX creates as default a 'CD-Rom only' PS1/PS2 compatible executable. For transfer between client/target use options below.</pre><pre> - Normally the packed files use the same memory areas like the uncompressed versions, so they will not override other memory areas while unpacking. If this isn't possible UPX will abort showing a 'packed data overlap' error. With the "--force" option UPX will set a few 'bytes higher' loading offset for the packed file, but this isn't a real problem if it is a single or boot-only executable.</pre><p>Extra options available for this executable format:</p><pre> --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.</pre><pre> --console-run This enables client/target transfer compatibility. This format also run from a CD, except the "--no-align" option is used. Upto 2024 bytes larger files than [default] will be the result, also a slower decompression speed can be expected.</pre><pre> --no-align This option disables CD mode 2 data sector format alignment, and enables "--console-run". This will slightly improve the compression ratio, but the compressed executable will not boot from a CD. So use it for client/target transfer only!.</pre><p></p><h2><a name="notes_for_rtm32_pe">NOTES FOR RTM32/PE</a></h2><p>Same as win32/pe.</p><p></p><h2><a name="notes_for_tmt_adam">NOTES FOR TMT/ADAM</a></h2><p>This format is used by the TMT Pascal compiler - see <a href="http://www.tmt.com/">http://www.tmt.com/</a> .</p><p>Extra options available for this executable format:</p><pre> --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.</pre><pre> --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.</pre><p></p><h2><a name="notes_for_vmlinuz_386">NOTES FOR VMLINUZ/386</a></h2><p>The vmlinuz/386 and bvmlinuz/386 formats take a gzip-compressedbootable Linux kernel image (``vmlinuz'', ``zImage'', ``bzImage''),gzip-decompress it and re-compress it with the <strong>UPX</strong> compression method.</p><p>vmlinuz/386 is completely unrelated to the other Linux executableformats, and it does not share any of their drawbacks.</p><p>Notes:</p><pre> - Be sure that "vmlinuz/386" or "bvmlinuz/386" is displayed during compression - otherwise a wrong executable format may have been used, and the kernel won't boot.</pre><p>Benefits:</p><pre> - Better compression (but note that the kernel was already compressed, so the improvement is not as large as with other formats). Still, the bytes saved may be essential for special needs like bootdisks.</pre><pre> For example, this is what I get for my 2.2.16 kernel: 1589708 vmlinux 641073 bzImage [original] 560755 bzImage.upx [compressed by "upx -9"]</pre><pre> - Much faster decompression at kernel boot time (but kernel decompression speed is not really an issue these days).</pre><p>Drawbacks:</p><pre> (none)</pre><p>Extra options available for this executable format:</p><pre> --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.</pre><pre> --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.</pre><p></p><h2><a name="notes_for_watcom_le">NOTES FOR WATCOM/LE</a></h2><p><strong>UPX</strong> has been successfully tested with the following extenders: DOS4G, DOS4GW, PMODE/W, DOS32a, CauseWay. The WDOS/X extender is partly supported (for details see the file bugs BUGS).</p><p>DLLs and the LX format are not supported.</p><p>Extra options available for this executable format:</p><pre> --le Produce an unbound LE output instead of keeping the current stub.</pre><p></p><h2><a name="notes_for_win32_pe">NOTES FOR WIN32/PE</a></h2><p>The PE support in <strong>UPX</strong> is quite stable now, but probably there arestill some incompabilities with some files.</p><p>Because of the way <strong>UPX</strong> (and other packers for this format) works, youcan see increased memory usage of your compressed files. If you startseveral instances of huge compressed programs you're wasting memorybecause the common segements of the program won't get sharedacross the instances.On the other hand if you're compressing only smaller programs, orrunning only one instance of larger programs, then this penalty issmaller, but it's still there.</p><p>If you're running executables from network, then compressed programswill load faster, and require less bandwidth during execution.</p><p>DLLs are supported.</p><p>Screensavers are supported, with the restriction that the filenamemust end in ``.scr'' (as screensavers are handled slightly differentthan normal exe files).</p><p>Extra options available for this executable format:</p><pre> --compress-exports=0 Don't compress the export section. Use this if you plan to run the compressed program under Wine. --compress-exports=1 Compress the export section. [DEFAULT] Compression of the export section can improve the compression ratio quite a bit but may not work with all programs (like winword.exe). UPX never compresses the export section of a DLL regardless of this option.</pre><pre> --compress-icons=0 Don't compress any icons. --compress-icons=1 Compress all but the first icon. --compress-icons=2 Compress all icons which are not in the first icon directory. [DEFAULT]</pre><pre> --compress-resources=0 Don't compress any resources at all.</pre><pre> --force Force compression even when there is an unexpected value in a header field. Use with care.</pre><pre> --strip-loadconf=0 Don't strip Structured Exception Handling load config [DEFAULT]. --strip-loadconf=1 Strip Structured Exception Handling load config.</pre><pre> --strip-relocs=0 Don't strip relocation records. --strip-relocs=1 Strip relocation records. [DEFAULT] This option only works on executables with base address greater or equal to 0x400000. Usually the compressed files becomes smaller, but some files may become larger. Note that the resulting file will not work under Windows 3.x (Win32s). UPX never strips relocations from a DLL regardless of this option.</pre><pre> --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.</pre><pre> --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.</pre><p></p><hr /><h1><a name="diagnostics">DIAGNOSTICS</a></h1><p>Exit status is normally 0; if an error occurs, exit statusis 1. If a warning occurs, exit status is 2.</p><p><strong>UPX</strong>'s diagnostics are intended to be self-explanatory.</p><p></p><hr /><h1><a name="bugs">BUGS</a></h1><p>Please report all bugs immediately to the authors.</p><p></p><hr /><h1><a name="authors">AUTHORS</a></h1><pre> Markus F.X.J. Oberhumer <markus@oberhumer.com> <a href="http://www.oberhumer.com">http://www.oberhumer.com</a></pre><pre> Laszlo Molnar <ml1050@users.sourceforge.net></pre><pre> John F. Reiser <jreiser@BitWagon.com></pre><pre> Jens Medoch <jssg@users.sourceforge.net></pre><p></p><hr /><h1><a name="copyright">COPYRIGHT</a></h1><p>Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer</p><p>Copyright (C) 1996-2004 Laszlo Molnar</p><p>Copyright (C) 2000-2004 John F. Reiser</p><p>Copyright (C) 2002-2004 Jens Medoch</p><p>This program may be used freely, and you are welcome toredistribute it under certain conditions.</p><p>This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<strong>UPX License Agreement</strong> for more details.</p><p>You should have received a copy of the UPX License Agreement alongwith this program; see the file LICENSE. If not, visit the UPX home page.</p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -