📄 upx.doc
字号:
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 The UPX stub is about 1700 bytes long, partly written in assembler and only uses kernel syscalls. It is not linked against any libc. Specific drawbacks: - 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. - 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. - 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). - 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 :-). Extra options available for this executable format: --force-execve Force the use of the generic linux/386 "execve" format, i.e. do not try the linux/elf386 and linux/sh386 formats. NOTES FOR PS1/EXE 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 of nostalgic feelings of one of the authors. Packed programs will be byte-identical to the original after uncompression, until further notice. Maximum uncompressed size: ~1998848 bytes. Notes: - UPX creates as default a 'CD-Rom only' PS1/PS2 compatible executable. For transfer between client/target use options below. - 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. 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. --boot-only The format will only run from a CD and may slightly improves the compression ratio. The decompression routines are faster than default ones. But it cannot be used for host/client transfer ! --no-align This option disables CD mode 2 data sector format alignment. May slightly improves the compression ratio, but the compressed executable will not boot from a CD. Use it for client/target transfer only ! NOTES FOR RTM32/PE and ARM/PE Same as win32/pe. NOTES FOR TMT/ADAM This format is used by the TMT Pascal compiler - see http://www.tmt.com/ . 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. --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. NOTES FOR VMLINUZ/386 The vmlinuz/386 and bvmlinuz/386 formats take a gzip-compressed bootable Linux kernel image ("vmlinuz", "zImage", "bzImage"), gzip-decompress it and re-compress it with the UPX compression method. vmlinuz/386 is completely unrelated to the other Linux executable formats, and it does not share any of their drawbacks. Notes: - 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. Benefits: - 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. 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"] - Much faster decompression at kernel boot time (but kernel decompression speed is not really an issue these days). Drawbacks: (none) 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. --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. NOTES FOR WATCOM/LE UPX 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). DLLs and the LX format are not supported. Extra options available for this executable format: --le Produce an unbound LE output instead of keeping the current stub. NOTES FOR WIN32/PE The PE support in UPX is quite stable now, but probably there are still some incompabilities with some files. Because of the way UPX (and other packers for this format) works, you can see increased memory usage of your compressed files because the whole program is loaded into memory at startup. If you start several instances of huge compressed programs you're wasting memory because the common segements of the program won't get shared across the instances. On the other hand if you're compressing only smaller programs, or running only one instance of larger programs, then this penalty is smaller, but it's still there. If you're running executables from network, then compressed programs will load faster, and require less bandwidth during execution. DLLs are supported. But UPX compressed DLLs can not share common data and code when they got used by multiple applications. So compressing msvcrt.dll is a waste of memory, but compressing the dll plugins of a particular application may be a better idea. Screensavers are supported, with the restriction that the filename must end with ".scr" (as screensavers are handled slightly different than normal exe files). UPX compressed PE files has some minor memory overhead (usually in the 10 - 30 kbytes range) which can be seen by specifying the "-i" command line switch during compression. Extra options available for this executable format: --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. --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] --compress-resources=0 Don't compress any resources at all. --keep-resource=list Don't compress resources specified by the list. The members of the list are separated by commas. A list member has the following format: I<type[/name]>. I<Type> is the type of the resource. Standard types must be specified as decimal numbers, user types can be specified by decimal IDs or strings. I<Name> is the identifier of the resource. It can be a decimal number or a string. For example: --keep-resource=2/MYBITMAP,5,6/12345 UPX won't compress the named bitmap resource "MYBITMAP", it leaves every dialog (5) resource uncompressed, and it won't touch the string table resource with identifier 12345. --force Force compression even when there is an unexpected value in a header field. Use with care. --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. --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.DIAGNOSTICS Exit status is normally 0; if an error occurs, exit status is 1. If a warning occurs, exit status is 2. UPX's diagnostics are intended to be self-explanatory.BUGS Please report all bugs immediately to the authors.AUTHORS Markus F.X.J. Oberhumer <markus@oberhumer.com> http://www.oberhumer.com Laszlo Molnar <ml1050@users.sourceforge.net> John F. Reiser <jreiser@BitWagon.com> Jens Medoch <jssg@users.sourceforge.net>COPYRIGHT Copyright (C) 1996-2006 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2006 Laszlo Molnar Copyright (C) 2000-2006 John F. Reiser Copyright (C) 2002-2006 Jens Medoch 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.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -