Packed executables take up less storage while remaining runnable as executable files. UPX compresses supported binaries from the command line, and its runtime code decompresses them in memory when launched.
How does UPX pack a program?
Run UPX against a supported executable, such as upx program.exe, to pack the file. The resulting program retains the ability to start as an executable: UPX’s runtime code decompresses its contents in memory at launch, so users do not have to unpack a separate archive first.
UPX is intended for executable binaries, not ordinary documents or folders. Its supported formats include Win32/PE, DOS/EXE, DOS/COM, DOS/SYS, Linux386, Atari/TOS, DJGPP2/COFF, RTM32/PE, TMT/Adam, and Watcom/LE.
Testing and unpacking
Use upx -t program.exe to test a packed file. To restore a packed executable, run upx -d program.exe. These commands are useful when checking a packed output or when a program needs to be returned to its unpacked form.
UPX works through command-line arguments, so the packing, testing, and decompression steps are issued in a terminal. The input must be a format UPX supports; the tool does not pack every kind of file.
Executable formats
UPX handles several executable families beyond Windows PE files. The format list includes binaries associated with DOS, Atari/TOS, Linux386, and development environments such as DJGPP2 and Watcom. Support depends on the executable format, not simply on the file having an executable-style extension.
Pros
- Compresses Win32/PE executables and several other binary formats
- Packed programs run without a separate archive extraction step
- The
-doption decompresses a packed file
Cons
- Packing and unpacking require command-line commands
System requirements: Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11 · 32-bit and 64-bit
Does UPX create a ZIP archive?
No. It packs supported executable files directly, and the packed program decompresses itself in memory when run.
How do I unpack a file compressed with UPX?
Run upx -d followed by the packed file’s name, such as upx -d program.exe.
How can I test a packed executable?
Run upx -t followed by the file name, for example upx -t program.exe.