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-2007 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 compres‐
18       sion ratio and offers *very* fast decompression. Your executables suf‐
19       fer no memory overhead or other drawbacks for most of the formats sup‐
20       ported, 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 appre‐
24       ciate if you credit UPX and ourselves in the documentation, possibly
25       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 MB/sec on an ancient Pentium 133,
46             about 200 MB/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
92       This is the default operation, eg. upx yourfile.exe will compress the
93       file specified on the command line.
94
95       Decompress
96
97       All UPX supported file formats can be unpacked using the -d switch, eg.
98       upx -d yourfile.exe will uncompress the file you've just compressed.
99
100       Test
101
102       The -t command tests the integrity of the compressed and uncompressed
103       data, eg. upx -t yourfile.exe check whether your file can be safely
104       decompressed. Note, that this command doesn't check the whole file,
105       only the part that will be uncompressed during program execution. This
106       means that you should not use this command instead of a virus checker.
107
108       List
109
110       The -l command prints out some information about the compressed files
111       specified on the command line as parameters, eg upx -l yourfile.exe
112       shows the compressed / uncompressed size and the compression ratio of
113       yourfile.exe.
114

OPTIONS

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

COMPRESSION LEVELS & TUNING

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

OVERLAY HANDLING OPTIONS

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

ENVIRONMENT

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

NOTES FOR THE SUPPORTED EXECUTABLE FORMATS

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

DIAGNOSTICS

834       Exit status is normally 0; if an error occurs, exit status is 1. If a
835       warning occurs, exit status is 2.
836
837       UPX's diagnostics are intended to be self-explanatory.
838

BUGS

840       Please report all bugs immediately to the authors.
841

AUTHORS

843        Markus F.X.J. Oberhumer <markus@oberhumer.com>
844        http://www.oberhumer.com
845
846        Laszlo Molnar <ml1050@users.sourceforge.net>
847
848        John F. Reiser <jreiser@BitWagon.com>
849
850        Jens Medoch <jssg@users.sourceforge.net>
851
853       Copyright (C) 1996-2007 Markus Franz Xaver Johannes Oberhumer
854
855       Copyright (C) 1996-2007 Laszlo Molnar
856
857       Copyright (C) 2000-2007 John F. Reiser
858
859       Copyright (C) 2002-2007 Jens Medoch
860
861       This program may be used freely, and you are welcome to redistribute it
862       under certain conditions.
863
864       This program is distributed in the hope that it will be useful, but
865       WITHOUT ANY WARRANTY; without even the implied warranty of MER‐
866       CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the UPX License
867       Agreement for more details.
868
869       You should have received a copy of the UPX License Agreement along with
870       this program; see the file LICENSE. If not, visit the UPX home page.
871
872
873
874upx 3.02                          2007-12-16                            UPX(1)
Impressum