1UPX(1)                                                                  UPX(1)
2
3
4

NAME

6       upx - compress or expand executable files
7

SYNOPSIS

9       upx [ command ] [ options ] filename...
10

ABSTRACT

12                           The Ultimate Packer for eXecutables
13          Copyright (c) 1996-2009 Markus Oberhumer, Laszlo Molnar & John Reiser
14                               http://upx.sourceforge.net
15
16       UPX is a portable, extendable, high-performance executable packer for
17       several different executable formats. It achieves an excellent
18       compression ratio and offers *very* fast decompression. Your
19       executables suffer no memory overhead or other drawbacks for most of
20       the formats supported, because of in-place decompression.
21
22       While you may use UPX freely for both non-commercial and commercial
23       executables (for details see the file LICENSE), we would highly
24       appreciate if you credit UPX and ourselves in the documentation,
25       possibly including a reference to the UPX home page. Thanks.
26
27       [ Using UPX in non-OpenSource applications without proper credits is
28       considered not politically correct ;-) ]
29

DISCLAIMER

31       UPX comes with ABSOLUTELY NO WARRANTY; for details see the file
32       LICENSE.
33
34       This is the first production quality release, and we plan that future
35       1.xx releases will be backward compatible with this version.
36
37       Please report all problems or suggestions to the authors. Thanks.
38

DESCRIPTION

40       UPX is a versatile executable packer with the following features:
41
42         - excellent compression ratio: compresses better than zip/gzip,
43             use UPX to decrease the size of your distribution !
44
45         - very fast decompression: about 10 MiB/sec on an ancient Pentium 133,
46             about 200 MiB/sec on an Athlon XP 2000+.
47
48         - no memory overhead for your compressed executables for most of the
49             supported formats
50
51         - safe: you can list, test and unpack your executables
52             Also, a checksum of both the compressed and uncompressed file is
53             maintained internally.
54
55         - universal: UPX can pack a number of executable formats:
56             * atari/tos
57             * bvmlinuz/386    [bootable Linux kernel]
58             * djgpp2/coff
59             * dos/com
60             * dos/exe
61             * dos/sys
62             * linux/386
63             * linux/elf386
64             * linux/sh386
65             * ps1/exe
66             * rtm32/pe
67             * tmt/adam
68             * vmlinuz/386     [bootable Linux kernel]
69             * vmlinux/386
70             * watcom/le (supporting DOS4G, PMODE/W, DOS32a and CauseWay)
71             * win32/pe (exe and dll)
72             * arm/pe (exe and dll)
73             * linux/elfamd64
74             * linux/elfppc32
75             * mach/elfppc32
76
77         - portable: UPX is written in portable endian-neutral C++
78
79         - extendable: because of the class layout it's very easy to support
80             new executable formats or add new compression algorithms
81
82         - free: UPX can be distributed and used freely. And from version 0.99
83             the full source code of UPX is released under the GNU General Public
84             License (GPL) !
85
86       You probably understand now why we call UPX the "ultimate" executable
87       packer.
88

COMMANDS

90   Compress
91       This is the default operation, eg. upx yourfile.exe will compress the
92       file specified on the command line.
93
94   Decompress
95       All UPX supported file formats can be unpacked using the -d switch, eg.
96       upx -d yourfile.exe will uncompress the file you've just compressed.
97
98   Test
99       The -t command tests the integrity of the compressed and uncompressed
100       data, eg. upx -t yourfile.exe check whether your file can be safely
101       decompressed. Note, that this command doesn't check the whole file,
102       only the part that will be uncompressed during program execution. This
103       means that you should not use this command instead of a virus checker.
104
105   List
106       The -l command prints out some information about the compressed files
107       specified on the command line as parameters, eg upx -l yourfile.exe
108       shows the compressed / uncompressed size and the compression ratio of
109       yourfile.exe.
110

OPTIONS

112       -q: be quiet, suppress warnings
113
114       -q -q (or -qq): be very quiet, suppress errors
115
116       -q -q -q (or -qqq): produce no output at all
117
118       --help: prints the help
119
120       --version: print the version of UPX
121
122       --exact: when compressing, require to be able to get a byte-identical
123       file after decompression with option -d. [NOTE: this is work in
124       progress and is not supported for all formats yet. If you do care, as a
125       workaround you can compress and then decompress your program a first
126       time - any further compress-decompress steps should then yield byte-
127       identical results as compared to the first decompressed version.]
128
129       [ ...to be written... - type `upx --help' for now ]
130

COMPRESSION LEVELS & TUNING

132       UPX offers ten different compression levels from -1 to -9, and --best.
133       The default compression level is -8 for files smaller than 512 KiB, and
134       -7 otherwise.
135
136       ·   Compression levels 1, 2 and 3 are pretty fast.
137
138       ·   Compression levels 4, 5 and 6 achieve a good time/ratio
139           performance.
140
141       ·   Compression levels 7, 8 and 9 favor compression ratio over speed.
142
143       ·   Compression level --best may take a long time.
144
145       Note that compression level --best can be somewhat slow for large
146       files, but you definitely should use it when releasing a final version
147       of your program.
148
149       Quick info for achieving the best compression ratio:
150
151       ·   Try upx --brute myfile.exe or even upx --ultra-brute myfile.exe.
152
153       ·   Try if --overlay=strip works.
154
155       ·   For win32/pe programs there's --strip-relocs=0. See notes below.
156

OVERLAY HANDLING OPTIONS

158       Info: An "overlay" means auxiliary data attached after the logical end
159       of an executable, and it often contains application specific data (this
160       is a common practice to avoid an extra data file, though it would be
161       better to use resource sections).
162
163       UPX handles overlays like many other executable packers do: it simply
164       copies the overlay after the compressed image. This works with some
165       files, but doesn't work with others, depending on how an application
166       actually accesses this overlayed data.
167
168         --overlay=copy    Copy any extra data attached to the file. [DEFAULT]
169
170         --overlay=strip   Strip any overlay from the program instead of
171                           copying it. Be warned, this may make the compressed
172                           program crash or otherwise unusable.
173
174         --overlay=skip    Refuse to compress any program which has an overlay.
175

ENVIRONMENT

177       The environment variable UPX can hold a set of default options for UPX.
178       These options are interpreted first and can be overwritten by explicit
179       command line parameters.  For example:
180
181           for DOS/Windows:   set UPX=-9 --compress-icons#0
182           for sh/ksh/zsh:    UPX="-9 --compress-icons=0"; export UPX
183           for csh/tcsh:      setenv UPX "-9 --compress-icons=0"
184
185       Under DOS/Windows you must use '#' instead of '=' when setting the
186       environment variable because of a COMMAND.COM limitation.
187
188       Not all of the options are valid in the environment variable - UPX will
189       tell you.
190
191       You can explicitly use the --no-env option to ignore the environment
192       variable.
193

NOTES FOR THE SUPPORTED EXECUTABLE FORMATS

195   NOTES FOR ATARI/TOS
196       This is the executable format used by the Atari ST/TT, a Motorola 68000
197       based personal computer which was popular in the late '80s. Support of
198       this format is only because of nostalgic feelings of one of the authors
199       and serves no practical purpose :-).  See http://www.freemint.de for
200       more info.
201
202       Packed programs will be byte-identical to the original after
203       uncompression.  All debug information will be stripped, though.
204
205       Extra options available for this executable format:
206
207         --all-methods       Compress the program several times, using all
208                             available compression methods. This may improve
209                             the compression ratio in some cases, but usually
210                             the default method gives the best results anyway.
211
212   NOTES FOR BVMLINUZ/I386
213       Same as vmlinuz/i386.
214
215   NOTES FOR DOS/COM
216       Obviously UPX won't work with executables that want to read data from
217       themselves (like some commandline utilities that ship with
218       Win95/98/ME).
219
220       Compressed programs only work on a 286+.
221
222       Packed programs will be byte-identical to the original after
223       uncompression.
224
225       Maximum uncompressed size: ~65100 bytes.
226
227       Extra options available for this executable format:
228
229         --8086              Create an executable that works on any 8086 CPU.
230
231         --all-methods       Compress the program several times, using all
232                             available compression methods. This may improve
233                             the compression ratio in some cases, but usually
234                             the default method gives the best results anyway.
235
236         --all-filters       Compress the program several times, using all
237                             available preprocessing filters. This may improve
238                             the compression ratio in some cases, but usually
239                             the default filter gives the best results anyway.
240
241   NOTES FOR DOS/EXE
242       dos/exe stands for all "normal" 16-bit DOS executables.
243
244       Obviously UPX won't work with executables that want to read data from
245       themselves (like some command line utilities that ship with
246       Win95/98/ME).
247
248       Compressed programs only work on a 286+.
249
250       Extra options available for this executable format:
251
252         --8086              Create an executable that works on any 8086 CPU.
253
254         --no-reloc          Use no relocation records in the exe header.
255
256         --all-methods       Compress the program several times, using all
257                             available compression methods. This may improve
258                             the compression ratio in some cases, but usually
259                             the default method gives the best results anyway.
260
261   NOTES FOR DOS/SYS
262       Compressed programs only work on a 286+.
263
264       Packed programs will be byte-identical to the original after
265       uncompression.
266
267       Maximum uncompressed size: ~65350 bytes.
268
269       Extra options available for this executable format:
270
271         --8086              Create an executable that works on any 8086 CPU.
272
273         --all-methods       Compress the program several times, using all
274                             available compression methods. This may improve
275                             the compression ratio in some cases, but usually
276                             the default method gives the best results anyway.
277
278         --all-filters       Compress the program several times, using all
279                             available preprocessing filters. This may improve
280                             the compression ratio in some cases, but usually
281                             the default filter gives the best results anyway.
282
283   NOTES FOR DJGPP2/COFF
284       First of all, it is recommended to use UPX *instead* of strip. strip
285       has the very bad habit of replacing your stub with its own (outdated)
286       version.  Additionally UPX corrects a bug/feature in strip v2.8.x: it
287       will fix the 4 KiB alignment of the stub.
288
289       UPX includes the full functionality of stubify. This means it will
290       automatically stubify your COFF files. Use the option --coff to disable
291       this functionality (see below).
292
293       UPX automatically handles Allegro packfiles.
294
295       The DLM format (a rather exotic shared library extension) is not
296       supported.
297
298       Packed programs will be byte-identical to the original after
299       uncompression.  All debug information and trailing garbage will be
300       stripped, though.
301
302       Extra options available for this executable format:
303
304         --coff              Produce COFF output instead of EXE. By default
305                             UPX keeps your current stub.
306
307         --all-methods       Compress the program several times, using all
308                             available compression methods. This may improve
309                             the compression ratio in some cases, but usually
310                             the default method gives the best results anyway.
311
312         --all-filters       Compress the program several times, using all
313                             available preprocessing filters. This may improve
314                             the compression ratio in some cases, but usually
315                             the default filter gives the best results anyway.
316
317   NOTES FOR LINUX [general]
318       Introduction
319
320         Linux/386 support in UPX consists of 3 different executable formats,
321         one optimized for ELF executables ("linux/elf386"), one optimized
322         for shell scripts ("linux/sh386"), and one generic format
323         ("linux/386").
324
325         We will start with a general discussion first, but please
326         also read the relevant docs for each of the individual formats.
327
328         Also, there is special support for bootable kernels - see the
329         description of the vmlinuz/386 format.
330
331       General user's overview
332
333         Running a compressed executable program trades less space on a
334         ``permanent'' storage medium (such as a hard disk, floppy disk,
335         CD-ROM, flash memory, EPROM, etc.) for more space in one or more
336         ``temporary'' storage media (such as RAM, swap space, /tmp, etc.).
337         Running a compressed executable also requires some additional CPU
338         cycles to generate the compressed executable in the first place,
339         and to decompress it at each invocation.
340
341         How much space is traded?  It depends on the executable, but many
342         programs save 30% to 50% of permanent disk space.  How much CPU
343         overhead is there?  Again, it depends on the executable, but
344         decompression speed generally is at least many megabytes per second,
345         and frequently is limited by the speed of the underlying disk
346         or network I/O.
347
348         Depending on the statistics of usage and access, and the relative
349         speeds of CPU, RAM, swap space, /tmp, and file system storage, then
350         invoking and running a compressed executable can be faster than
351         directly running the corresponding uncompressed program.
352         The operating system might perform fewer expensive I/O operations
353         to invoke the compressed program.  Paging to or from swap space
354         or /tmp might be faster than paging from the general file system.
355         ``Medium-sized'' programs which access about 1/3 to 1/2 of their
356         stored program bytes can do particularly well with compression.
357         Small programs tend not to benefit as much because the absolute
358         savings is less.  Big programs tend not to benefit proportionally
359         because each invocation may use only a small fraction of the program,
360         yet UPX decompresses the entire program before invoking it.
361         But in environments where disk or flash memory storage is limited,
362         then compression may win anyway.
363
364         Currently, executables compressed by UPX do not share RAM at runtime
365         in the way that executables mapped from a file system do.  As a
366         result, if the same program is run simultaneously by more than one
367         process, then using the compressed version will require more RAM and/or
368         swap space.  So, shell programs (bash, csh, etc.)  and ``make''
369         might not be good candidates for compression.
370
371         UPX recognizes three executable formats for Linux: Linux/elf386,
372         Linux/sh386, and Linux/386.  Linux/386 is the most generic format;
373         it accommodates any file that can be executed.  At runtime, the UPX
374         decompression stub re-creates in /tmp a copy of the original file,
375         and then the copy is (re-)executed with the same arguments.
376         ELF binary executables prefer the Linux/elf386 format by default,
377         because UPX decompresses them directly into RAM, uses only one
378         exec, does not use space in /tmp, and does not use /proc.
379         Shell scripts where the underlying shell accepts a ``-c'' argument
380         can use the Linux/sh386 format.  UPX decompresses the shell script
381         into low memory, then maps the shell and passes the entire text of the
382         script as an argument with a leading ``-c''.
383
384       General benefits:
385
386         - UPX can compress all executables, be it AOUT, ELF, libc4, libc5,
387           libc6, Shell/Perl/Python/... scripts, standalone Java .class
388           binaries, or whatever...
389           All scripts and programs will work just as before.
390
391         - Compressed programs are completely self-contained. No need for
392           any external program.
393
394         - UPX keeps your original program untouched. This means that
395           after decompression you will have a byte-identical version,
396           and you can use UPX as a file compressor just like gzip.
397           [ Note that UPX maintains a checksum of the file internally,
398             so it is indeed a reliable alternative. ]
399
400         - As the stub only uses syscalls and isn't linked against libc it
401           should run under any Linux configuration that can run ELF
402           binaries.
403
404         - For the same reason compressed executables should run under
405           FreeBSD and other systems which can run Linux binaries.
406           [ Please send feedback on this topic ]
407
408       General drawbacks:
409
410         - It is not advisable to compress programs which usually have many
411           instances running (like `sh' or `make') because the common segments of
412           compressed programs won't be shared any longer between different
413           processes.
414
415         - `ldd' and `size' won't show anything useful because all they
416           see is the statically linked stub.  Since version 0.82 the section
417           headers are stripped from the UPX stub and `size' doesn't even
418           recognize the file format.  The file patches/patch-elfcode.h has a
419           patch to fix this bug in `size' and other programs which use GNU BFD.
420
421       General notes:
422
423         - As UPX leaves your original program untouched it is advantageous
424           to strip it before compression.
425
426         - If you compress a script you will lose platform independence -
427           this could be a problem if you are using NFS mounted disks.
428
429         - Compression of suid, guid and sticky-bit programs is rejected
430           because of possible security implications.
431
432         - For the same reason there is no sense in making any compressed
433           program suid.
434
435         - Obviously UPX won't work with executables that want to read data
436           from themselves. E.g., this might be a problem for Perl scripts
437           which access their __DATA__ lines.
438
439         - In case of internal errors the stub will abort with exitcode 127.
440           Typical reasons for this to happen are that the program has somehow
441           been modified after compression.
442           Running `strace -o strace.log compressed_file' will tell you more.
443
444   NOTES FOR LINUX/ELF386
445       Please read the general Linux description first.
446
447       The linux/elf386 format decompresses directly into RAM, uses only one
448       exec, does not use space in /tmp, and does not use /proc.
449
450       Linux/elf386 is automatically selected for Linux ELF executables.
451
452       Packed programs will be byte-identical to the original after
453       uncompression.
454
455       How it works:
456
457         For ELF executables, UPX decompresses directly to memory, simulating
458         the mapping that the operating system kernel uses during exec(),
459         including the PT_INTERP program interpreter (if any).
460         The brk() is set by a special PT_LOAD segment in the compressed
461         executable itself.  UPX then wipes the stack clean except for
462         arguments, environment variables, and Elf_auxv entries (this is
463         required by bugs in the startup code of /lib/ld-linux.so as of
464         May 2000), and transfers control to the program interpreter or
465         the e_entry address of the original executable.
466
467         The UPX stub is about 1700 bytes long, partly written in assembler
468         and only uses kernel syscalls. It is not linked against any libc.
469
470       Specific drawbacks:
471
472         - For linux/elf386 and linux/sh386 formats, you will be relying on
473           RAM and swap space to hold all of the decompressed program during
474           the lifetime of the process.  If you already use most of your swap
475           space, then you may run out.  A system that is "out of memory"
476           can become fragile.  Many programs do not react gracefully when
477           malloc() returns 0.  With newer Linux kernels, the kernel
478           may decide to kill some processes to regain memory, and you
479           may not like the kernel's choice of which to kill.  Running
480           /usr/bin/top is one way to check on the usage of swap space.
481
482       Extra options available for this executable format:
483
484         (none)
485
486   NOTES FOR LINUX/SH386
487       Please read the general Linux description first.
488
489       Shell scripts where the underling shell accepts a ``-c'' argument can
490       use the Linux/sh386 format.  UPX decompresses the shell script into low
491       memory, then maps the shell and passes the entire text of the script as
492       an argument with a leading ``-c''.  It does not use space in /tmp, and
493       does not use /proc.
494
495       Linux/sh386 is automatically selected for shell scripts that use a
496       known shell.
497
498       Packed programs will be byte-identical to the original after
499       uncompression.
500
501       How it works:
502
503         For shell script executables (files beginning with "#!/" or "#! /")
504         where the shell is known to accept "-c <command>", UPX decompresses
505         the file into low memory, then maps the shell (and its PT_INTERP),
506         and passes control to the shell with the entire decompressed file
507         as the argument after "-c".  Known shells are sh, ash, bash, bsh, csh,
508         ksh, tcsh, pdksh.  Restriction: UPX cannot use this method
509         for shell scripts which use the one optional string argument after
510         the shell name in the script (example: "#! /bin/sh option3\n".)
511
512         The UPX stub is about 1700 bytes long, partly written in assembler
513         and only uses kernel syscalls. It is not linked against any libc.
514
515       Specific drawbacks:
516
517         - For linux/elf386 and linux/sh386 formats, you will be relying on
518           RAM and swap space to hold all of the decompressed program during
519           the lifetime of the process.  If you already use most of your swap
520           space, then you may run out.  A system that is "out of memory"
521           can become fragile.  Many programs do not react gracefully when
522           malloc() returns 0.  With newer Linux kernels, the kernel
523           may decide to kill some processes to regain memory, and you
524           may not like the kernel's choice of which to kill.  Running
525           /usr/bin/top is one way to check on the usage of swap space.
526
527       Extra options available for this executable format:
528
529         (none)
530
531   NOTES FOR LINUX/386
532       Please read the general Linux description first.
533
534       The generic linux/386 format decompresses to /tmp and needs /proc file
535       system support. It starts the decompressed program via the execve()
536       syscall.
537
538       Linux/386 is only selected if the specialized linux/elf386 and
539       linux/sh386 won't recognize a file.
540
541       Packed programs will be byte-identical to the original after
542       uncompression.
543
544       How it works:
545
546         For files which are not ELF and not a script for a known "-c" shell,
547         UPX uses kernel execve(), which first requires decompressing to a
548         temporary file in the file system.  Interestingly -
549         because of the good memory management of the Linux kernel - this
550         often does not introduce a noticeable delay, and in fact there
551         will be no disk access at all if you have enough free memory as
552         the entire process takes places within the file system buffers.
553
554         A compressed executable consists of the UPX stub and an overlay
555         which contains the original program in a compressed form.
556
557         The UPX stub is a statically linked ELF executable and does
558         the following at program startup:
559
560           1) decompress the overlay to a temporary location in /tmp
561           2) open the temporary file for reading
562           3) try to delete the temporary file and start (execve)
563              the uncompressed program in /tmp using /proc/<pid>/fd/X as
564              attained by step 2)
565           4) if that fails, fork off a subprocess to clean up and
566              start the program in /tmp in the meantime
567
568         The UPX stub is about 1700 bytes long, partly written in assembler
569         and only uses kernel syscalls. It is not linked against any libc.
570
571       Specific drawbacks:
572
573         - You need additional free disk space for the uncompressed program
574           in your /tmp directory. This program is deleted immediately after
575           decompression, but you still need it for the full execution time
576           of the program.
577
578         - You must have /proc file system support as the stub wants to open
579           /proc/<pid>/exe and needs /proc/<pid>/fd/X. This also means that you
580           cannot compress programs that are used during the boot sequence
581           before /proc is mounted.
582
583         - Utilities like `top' will display numerical values in the process
584           name field. This is because Linux computes the process name from
585           the first argument of the last execve syscall (which is typically
586           something like /proc/<pid>/fd/3).
587
588         - Because of temporary decompression to disk the decompression speed
589           is not as fast as with the other executable formats. Still, I can see
590           no noticeable delay when starting programs like my ~3 MiB emacs (which
591           is less than 1 MiB when compressed :-).
592
593       Extra options available for this executable format:
594
595         --force-execve      Force the use of the generic linux/386 "execve"
596                             format, i.e. do not try the linux/elf386 and
597                             linux/sh386 formats.
598
599   NOTES FOR PS1/EXE
600       This is the executable format used by the Sony PlayStation (PSone), a
601       Mips R3000 based gaming console which is popular since the late '90s.
602       Support of this format is very similar to the Atari one, because of
603       nostalgic feelings of one of the authors.
604
605       Packed programs will be byte-identical to the original after
606       uncompression, until further notice.
607
608       Maximum uncompressed size: ~1.89 / ~7.60 MiB.
609
610       Notes:
611
612         - UPX creates as default a suitable executable for CD-Mastering
613           and console transfer. For a CD-Master main executable you could also try
614           the special option "--boot-only" as described below.
615           It has been reported that upx packed executables are fully compatible with
616           the Sony PlayStation 2 (PS2, PStwo) and Sony PlayStation Portable (PSP) in
617           Sony PlayStation (PSone) emulation mode.
618
619         - Normally the packed files use the same memory areas like the uncompressed
620           versions, so they will not override other memory areas while unpacking.
621           If this isn't possible UPX will abort showing a 'packed data overlap'
622           error. With the "--force" option UPX will relocate the loading address
623           for the packed file, but this isn't a real problem if it is a single or
624           the main executable.
625
626       Extra options available for this executable format:
627
628         --all-methods       Compress the program several times, using all
629                             available compression methods. This may improve
630                             the compression ratio in some cases, but usually
631                             the default method gives the best results anyway.
632
633         --8-bit             Uses 8 bit size compression [default: 32 bit]
634
635         --8mib-ram          PSone has 8 MiB ram available [default: 2 MiB]
636
637         --boot-only         This format is for main exes and CD-Mastering only !
638                             It may slightly improve the compression ratio,
639                             decompression routines are faster than default ones.
640                             But it cannot be used for console transfer !
641
642         --no-align          This option disables CD mode 2 data sector format
643                             alignment. May slightly improves the compression ratio,
644                             but the compressed executable will not boot from a CD.
645                             Use it for console transfer only !
646
647   NOTES FOR RTM32/PE and ARM/PE
648       Same as win32/pe.
649
650   NOTES FOR TMT/ADAM
651       This format is used by the TMT Pascal compiler - see
652       http://www.tmt.com/ .
653
654       Extra options available for this executable format:
655
656         --all-methods       Compress the program several times, using all
657                             available compression methods. This may improve
658                             the compression ratio in some cases, but usually
659                             the default method gives the best results anyway.
660
661         --all-filters       Compress the program several times, using all
662                             available preprocessing filters. This may improve
663                             the compression ratio in some cases, but usually
664                             the default filter gives the best results anyway.
665
666   NOTES FOR VMLINUZ/386
667       The vmlinuz/386 and bvmlinuz/386 formats take a gzip-compressed
668       bootable Linux kernel image ("vmlinuz", "zImage", "bzImage"), gzip-
669       decompress it and re-compress it with the UPX compression method.
670
671       vmlinuz/386 is completely unrelated to the other Linux executable
672       formats, and it does not share any of their drawbacks.
673
674       Notes:
675
676         - Be sure that "vmlinuz/386" or "bvmlinuz/386" is displayed
677         during compression - otherwise a wrong executable format
678         may have been used, and the kernel won't boot.
679
680       Benefits:
681
682         - Better compression (but note that the kernel was already compressed,
683         so the improvement is not as large as with other formats).
684         Still, the bytes saved may be essential for special needs like
685         boot disks.
686
687            For example, this is what I get for my 2.2.16 kernel:
688               1589708  vmlinux
689                641073  bzImage        [original]
690                560755  bzImage.upx    [compressed by "upx -9"]
691
692         - Much faster decompression at kernel boot time (but kernel
693           decompression speed is not really an issue these days).
694
695       Drawbacks:
696
697         (none)
698
699       Extra options available for this executable format:
700
701         --all-methods       Compress the program several times, using all
702                             available compression methods. This may improve
703                             the compression ratio in some cases, but usually
704                             the default method gives the best results anyway.
705
706         --all-filters       Compress the program several times, using all
707                             available preprocessing filters. This may improve
708                             the compression ratio in some cases, but usually
709                             the default filter gives the best results anyway.
710
711   NOTES FOR WATCOM/LE
712       UPX has been successfully tested with the following extenders:
713         DOS4G, DOS4GW, PMODE/W, DOS32a, CauseWay.
714         The WDOS/X extender is partly supported (for details
715         see the file bugs BUGS).
716
717       DLLs and the LX format are not supported.
718
719       Extra options available for this executable format:
720
721         --le                Produce an unbound LE output instead of
722                             keeping the current stub.
723
724   NOTES FOR WIN32/PE
725       The PE support in UPX is quite stable now, but probably there are still
726       some incompatibilities with some files.
727
728       Because of the way UPX (and other packers for this format) works, you
729       can see increased memory usage of your compressed files because the
730       whole program is loaded into memory at startup.  If you start several
731       instances of huge compressed programs you're wasting memory because the
732       common segments of the program won't get shared across the instances.
733       On the other hand if you're compressing only smaller programs, or
734       running only one instance of larger programs, then this penalty is
735       smaller, but it's still there.
736
737       If you're running executables from network, then compressed programs
738       will load faster, and require less bandwidth during execution.
739
740       DLLs are supported. But UPX compressed DLLs can not share common data
741       and code when they got used by multiple applications. So compressing
742       msvcrt.dll is a waste of memory, but compressing the dll plugins of a
743       particular application may be a better idea.
744
745       Screensavers are supported, with the restriction that the filename must
746       end with ".scr" (as screensavers are handled slightly different than
747       normal exe files).
748
749       UPX compressed PE files have some minor memory overhead (usually in the
750       10 - 30 KiB range) which can be seen by specifying the "-i" command
751       line switch during compression.
752
753       Extra options available for this executable format:
754
755        --compress-exports=0 Don't compress the export section.
756                             Use this if you plan to run the compressed
757                             program under Wine.
758        --compress-exports=1 Compress the export section. [DEFAULT]
759                             Compression of the export section can improve the
760                             compression ratio quite a bit but may not work
761                             with all programs (like winword.exe).
762                             UPX never compresses the export section of a DLL
763                             regardless of this option.
764
765         --compress-icons=0  Don't compress any icons.
766         --compress-icons=1  Compress all but the first icon.
767         --compress-icons=2  Compress all icons which are not in the
768                             first icon directory. [DEFAULT]
769         --compress-icons=3  Compress all icons.
770
771         --compress-resources=0  Don't compress any resources at all.
772
773         --keep-resource=list Don't compress resources specified by the list.
774                             The members of the list are separated by commas.
775                             A list member has the following format: I<type[/name]>.
776                             I<Type> is the type of the resource. Standard types
777                             must be specified as decimal numbers, user types can be
778                             specified by decimal IDs or strings. I<Name> is the
779                             identifier of the resource. It can be a decimal number
780                             or a string. For example:
781
782                             --keep-resource=2/MYBITMAP,5,6/12345
783
784                             UPX won't compress the named bitmap resource "MYBITMAP",
785                             it leaves every dialog (5) resource uncompressed, and
786                             it won't touch the string table resource with identifier
787                             12345.
788
789         --force             Force compression even when there is an
790                             unexpected value in a header field.
791                             Use with care.
792
793         --strip-relocs=0    Don't strip relocation records.
794         --strip-relocs=1    Strip relocation records. [DEFAULT]
795                             This option only works on executables with base
796                             address greater or equal to 0x400000. Usually the
797                             compressed files becomes smaller, but some files
798                             may become larger. Note that the resulting file will
799                             not work under Windows 3.x (Win32s).
800                             UPX never strips relocations from a DLL
801                             regardless of this option.
802
803         --all-methods       Compress the program several times, using all
804                             available compression methods. This may improve
805                             the compression ratio in some cases, but usually
806                             the default method gives the best results anyway.
807
808         --all-filters       Compress the program several times, using all
809                             available preprocessing filters. This may improve
810                             the compression ratio in some cases, but usually
811                             the default filter gives the best results anyway.
812

DIAGNOSTICS

814       Exit status is normally 0; if an error occurs, exit status is 1. If a
815       warning occurs, exit status is 2.
816
817       UPX's diagnostics are intended to be self-explanatory.
818

BUGS

820       Please report all bugs immediately to the authors.
821

AUTHORS

823        Markus F.X.J. Oberhumer <markus@oberhumer.com>
824        http://www.oberhumer.com
825
826        Laszlo Molnar <ml1050@users.sourceforge.net>
827
828        John F. Reiser <jreiser@BitWagon.com>
829
830        Jens Medoch <jssg@users.sourceforge.net>
831
833       Copyright (C) 1996-2009 Markus Franz Xaver Johannes Oberhumer
834
835       Copyright (C) 1996-2009 Laszlo Molnar
836
837       Copyright (C) 2000-2009 John F. Reiser
838
839       Copyright (C) 2002-2009 Jens Medoch
840
841       This program may be used freely, and you are welcome to redistribute it
842       under certain conditions.
843
844       This program is distributed in the hope that it will be useful, but
845       WITHOUT ANY WARRANTY; without even the implied warranty of
846       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the UPX
847       License Agreement for more details.
848
849       You should have received a copy of the UPX License Agreement along with
850       this program; see the file LICENSE. If not, visit the UPX home page.
851
852
853
854upx 3.04                          2009-09-27                            UPX(1)
Impressum