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-2020 Markus Oberhumer, Laszlo Molnar & John Reiser
14                                  https://upx.github.io
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             * win64/pe (exe and dll)
73             * arm/pe (exe and dll)
74             * linux/elfamd64
75             * linux/elfppc32
76             * mach/elfppc32
77
78         - portable: UPX is written in portable endian-neutral C++
79
80         - extendable: because of the class layout it's very easy to support
81             new executable formats or add new compression algorithms
82
83         - free: UPX can be distributed and used freely. And from version 0.99
84             the full source code of UPX is released under the GNU General Public
85             License (GPL) !
86
87       You probably understand now why we call UPX the "ultimate" executable
88       packer.
89

COMMANDS

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

OPTIONS

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

COMPRESSION LEVELS & TUNING

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

OVERLAY HANDLING OPTIONS

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

ENVIRONMENT

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

NOTES FOR THE SUPPORTED EXECUTABLE FORMATS

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

DIAGNOSTICS

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

BUGS

821       Please report all bugs immediately to the authors.
822

AUTHORS

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