Executable compression is any means of compressing an executable file and combining the compressed data with decompression code into a single executable. When this compressed executable is executed, the decompression code recreates the original code from the compressed code before executing it. In most cases this happens transparently so the compressed executable can be used in exactly the same way as the original. Executable compressors are often referred to as "runtime packers", "software packers", "software protectors" (or even "polymorphic packers" and "obfuscating tools").
A compressed executable can be considered a self-extracting archive, where a compressed executable is packaged along with the relevant decompression code in an executable file. Some compressed executables can be decompressed to reconstruct the original program file without being directly executed. Two programs that can be used to do this are CUP386 and UNP.
Most compressed executables decompress the original code in memory and most require slightly more memory to run (because they need to store the decompressor code, the compressed data and the decompressed code). Moreover, some compressed executables have additional requirements, such as those that write the decompressed executable to the file system before executing it.
Software distributors use executable compression for a variety of reasons, primarily to reduce the secondary storage requirements of their software; as executable compressors are specifically designed to compress executable code, they often achieve better compression ratio than standard data compression facilities such as gzip, zip or bzip2. This allows software distributors to stay within the constraints of their chosen distribution media (such as CD-ROM, DVD-ROM, or floppy disk), or to reduce the time and bandwidth customers require to access software distributed via the Internet.
Executable compression is also frequently used to deter reverse engineering or to obfuscate the contents of the executable (for example, to hide the presence of malware from antivirus scanners) by proprietary methods of compression and/or added encryption. Executable compression can be used to prevent direct disassembly, mask string literals and modify signatures. Although this does not eliminate the chance of reverse engineering, it can make the process more costly.
A compressed executable requires less storage space in the file system, thus less time to transfer data from the file system into memory. On the other hand, it requires some time to decompress the data before execution begins. However, the speed of various storage media has not kept up with average processor speeds, so the storage is very often the bottleneck. Thus the compressed executable will load faster on most common systems. On modern desktop computers, this is rarely noticeable unless the executable is unusually big, so loading speed is not a primary reason for or against compressing an executable.
On operating systems which page executable images on demand from the disk, compressed executables make this process less efficient. The decompressor stub allocates a block of memory to hold the decompressed data, which stays allocated as long as the executable stays loaded, whether it is used or not, competing for memory resources with other applications all along. If the operating system uses a swap file, the decompressed data has to be written to it to free up the memory instead of simply discarding unused data blocks and reloading them from the executable image if needed again. This is usually not noticeable, but it becomes a problem when an executable is loaded more than once at the same time—the operating system cannot reuse data blocks it has already loaded, the data has to be decompressed into a new memory block, and will be swapped out independently if not used. The additional storage and time requirements mean that it has to be weighed carefully whether to compress executables which are typically run more than once at the same time.
Another disadvantage is that some utilities can no longer identify run-time library dependencies, as only the statically linked extractor stub is visible.
Also, some older virus scanners simply report all compressed executables as viruses because the decompressor stubs share some characteristics with those. Most modern virus scanners can unpack several different executable compression layers to check the actual executable inside, but some popular anti-virus and anti-malware scanners have had troubles with false positive alarms on compressed executables. In an attempt to solve the problem of malware obfuscated with the help of runtime packers the IEEE Industry Connections Security Group has introduced a software taggant system.
Executable compression used to be more popular when computers were limited to the storage capacity of floppy disks, which were both slow and low capacity media, and small hard drives; it allowed the computer to store more software in the same amount of space, without the inconvenience of having to manually unpack an archive file every time the user wanted to use the software. However, executable compression has become less popular because of increased storage capacity on computers. It has its use in the demoscene where demos have to stay within a size limit, e.g. 64k intro. Only very sophisticated compression formats, which add to load time, keep an executable small enough to enter these competitions.
Known executable compressors for CP/M-80 / MSX-DOS .COM files:
Known executable compressors for DOS executable files (.COM or .EXE):
Known executable compressors under OS/2:
Known executable compressors for New Executables:
Known executable compressors for Portable Executables:
Note: Clients in purple are no longer in development.
|Name||Latest stable||Software license||x86-64 support|
|Alienyze||1.4 (17 August 2020)||Proprietary||No|
|Armadillo||9.62 (7 June 2013)||Proprietary||Yes|
|ASPack||2.40 (7 December 2018)||Proprietary||Yes|
|ASPR (ASProtect)||2.78 (7 December 2018)||Proprietary||Yes|
|BoxedApp Packer||3.3 (26 July 2015)||Proprietary||Yes|
|CExe||1.0b (20 July 2001)||GPL||No|
|Crinkler||2.3 (22 July 2020)||Zlib||Yes|
|dotBundle||1.3 (4 April 2013)||Proprietary||Yes|
|Enigma Protector||6.60 (21 August 2019)||Proprietary||Yes|
|Enigma Virtual Box||9.40 (10 October 2019)||Proprietary||Yes|
|EXE Bundle||3.11 (7 January 2011)||Proprietary||?|
|EXE Stealth||4.14 (29 June 2011)||Proprietary||?|
|eXPressor||22.214.171.124 (14 January 2010)||Proprietary||?|
|FSG||2.0 (24 May 2004)||Freeware||No|
|kkrunchy src||0.23a4 (Unknown)||Public domain||No|
|MPRESS||2.19 (2 January 2012)||Freeware||Yes|
|Obsidium||1.6 (11 April 2017)||Proprietary||Yes|
|PESpin||1.33 (3 May 2011)||Freeware||Yes|
|Petite||2.4 (22 September 2016)||Freeware||No|
|RLPack Basic||1.21 (31 October 2008)||GPL||No|
|Smart Packer Pro X||126.96.36.199 (3 June 2019)||Proprietary||Yes|
|Themida/WinLicense||3.0 (24 October 2019)||Proprietary||Yes|
|UPX||3.96 (23 January 2020)||GPL||experimental|
|VMProtect||3.4 (3 August 2019)||Proprietary||Yes|
|WWPack32||1.20 (19 June 2000)||No|
|XComp/XPack||0.98 (18 February 2007)||Freeware||No|
Known executable compressors for ELF files:
Known executable compressors for CLI assembly files:
Known executable compressors for Mac OS Classic application files:
Known executable compressors for Mach-O (Apple Mac OS X) files:
Known executable compressors for executables on the Commodore 64 and VIC 20:
Known executable compressors for executables on the Commodore Amiga series:
Known executable compressors for Java:
These compress the original script and output a new script that has a decompressor and compressed data.
These remove white space, remove comments, and shorten variable and function names but do not alter the behavior of the script.
[…] PMEXE.CPM […] is a module […] in combination with PMARC […] used to make executable compressed COM files (just like LZEXE or PKLITE […] type: PMARC <archive>.COM=PMEXE2.CPM <filename> [options] The archive-name must be .COM […] not .PMA. The output file will have the extension .CPM. It's an MSX-DOS COM file […] rename file […] to run it […]
[…] SPACEMAKER and TERMULATOR, commodity software for IBM PC (PC DOS file compression utility and VT-100 emulator), being marketed by Realia, Inc. R.B.K. Dewar (1982–1983), 8088 assembly language, 8,000 lines […]
[…] The /E option of the linker should generate an EXE file which is logically equivalent to the uncompressed EXE file. The current version […] results in AX being clobbered. AX on entry to an EXE file has a definite meaning (it indicates drive validity for the parameters), thus it should be passed through to the uncompressed image. Given this one very obvious violation of the interface rules, there may be others, I have not bothered to investigate further […] I did write the Realia SpaceMaker program which does a similar sort of thing to the EXEPACK option (but needless to say does not have this particular […]
[Miles:] There exists an undocumented […] switch to Microsoft LINK.EXE […], which will cause an automatic compaction during binding. This process will eliminate storage for uninitialized arrays from the .EXE file produced by the linker […] To use this feature, specify the /E option to the command line […] [Nather:] The option does not exist in MS Link versions 3.00 and 3.01 [Miles:] By comparing the sizes of the (packed) files generated from LINK ver 3.02 and the /E option with the size of the .EXE file manually packed with […] EXEPACK, I have come to the conclusion that LINK ver 3.02 option /E generates EXACTLY the same size file as manually running EXEPACK on a regular .EXE file output by LINK […]
[…] > no one packer may pack combos like .SYS+.COM or .SYS+.EXE. […] There are packers for .COM or .EXE and others for .SYS, but I too have not seen a packer which supports both in one. […] possibility to combine a program/TSR and device driver in .EXE files […] and a program/TSR.COM and device driver into a .COM program […] It might also be possible to add another self-made stub to the file, after it has already been compressed […] all the compressed DR-DOS device drivers use a similar technique to let the normal PKLITE .COM decompressor work with .SYS files (meanwhile PKLITE supports a similar feature for .SYS files itself). […](NB. PKLITE 1.50 (1995) and higher gained the capability to compress device drivers, but not combined COM+SYS drivers.)
((cite web)): CS1 maint: archived copy as title (link)