Executable compression
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 compressed data 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.
Executable compression is not limited to binary executables, but can also be applied to scripts, such as JavaScript. Because most scripting languages are designed to work on human-readable code, which has a high redundancy, compression can be very effective and as simple as replacing long names used to identify variables and functions with shorter versions and/or removing white-space.
Contents
1 Advantages and disadvantages
2 List of packers
2.1 Portable Executable
2.2 New Executable
2.3 OS/2 executable
2.4 DOS executable
2.5 ELF files
2.6 CLI assembly files
2.7 Mac OS Classic application files
2.8 Mach-O (Apple Mac OS X) files
2.9 Java
2.9.1 JAR files
2.9.2 WAR files
2.10 JavaScript scripts
2.10.1 Self decompressing compressors
2.10.2 Redundancy reducing compressors
3 See also
4 References
Advantages and disadvantages
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[citation needed]. 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 read executable images on demand from the disk (see virtual memory), 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 like 64 kilobytes to enter some competitions. Only very sophisticated compression formats, which add to load time, keep an executable small enough to enter these competitions.
List of packers
Portable Executable
Note: Clients in purple are no longer in development.
Name | Latest stable | Software license | x86-64 support |
---|---|---|---|
.netshrink | 2.7 (July 2, 2016 (2016-07-02))[1] | Proprietary | Yes |
Armadillo | 9.62 (June 7, 2013 (2013-06-07)) | Proprietary | Yes |
ASPack | 2.40 (November 2, 2016 (2016-11-02)) | Proprietary | Yes |
ASPR (ASProtect) | 2.76 (November 2, 2016 (2016-11-02)) | Proprietary | Yes |
BoxedApp Packer | 3.3 (July 26, 2015 (2015-07-26)) | Proprietary | Yes |
CExe | 1.0b (July 20, 2001 (2001-07-20)) | GPL | No |
dotBundle | 1.3 (April 4, 2013 (2013-04-04))[2] | Proprietary | Yes |
Enigma Protector | 6.10 (January 24, 2018 (2018-01-24))[3] | Proprietary | Yes |
EXE Bundle | 3.11 (January 7, 2011 (2011-01-07))[4] | Proprietary | ? |
EXE Stealth | 4.14 (June 29, 2011 (2011-06-29))[5] | Proprietary | ? |
eXPressor | 1.8.0.1 (January 14, 2010 (2010-01-14)) | Proprietary | ? |
FSG | 2.0 (May 24, 2004 (2004-05-24))[6] | Freeware | No |
kkrunchy src | 0.23a4 (Unknown) | BSD | No |
MEW | 1.1 (Unknown) | Freeware | No |
MPRESS | 2.19 (January 2, 2012 (2012-01-02)) | Freeware | Yes |
Obsidium | 1.6 (April 11, 2017 (2017-04-11))[7] | Proprietary | Yes |
PELock | 2.06 (August 15, 2016 (2016-08-15))[8] | Proprietary | No |
PESpin | 1.33 (May 3, 2011 (2011-05-03)) | Freeware | Yes |
Petite | 2.4 (September 22, 2016 (2016-09-22)) | Freeware | No |
RLPack Basic | 1.21 (October 31, 2008 (2008-10-31)) | GPL | No |
Smart Packer Pro X | 1.9.9.5 (August 17, 2018 (2018-08-17)) | Proprietary | Yes |
Themida | 2.4.6 (February 17, 2017 (2017-02-17)) | Proprietary | Yes |
UPX | 3.95 (August 26, 2018 (2018-08-26)) | GPL | experimental |
VMProtect | 3.1.1 (April 24, 2017 (2017-04-24)) | Proprietary | Yes |
XComp/XPack | 0.98 (February 18, 2007 (2007-02-18)) | Freeware | No |
New Executable
- PackWin
- WinLite
OS/2 executable
- NeLite
- LxLite
DOS executable
- Microsoft EXEPACK
- 32LiTE
- 624
- AINEXE
- aPACK
- DIET
- HASP Envelope
- LGLZ
- LZEXE (by Fabrice Bellard)
- PKLite
- PMWLITE
- UCEXE
- UPX
- WDOSX
- WWpack
- XE
ELF files
- gzexe
- HASP Envelope
- UPX
CLI assembly files
- .NETZ
- NsPack
- Mpress
- HASP Envelope
- .netshrink
- dotBundle
- Exepack.NET
DotProtect: Commercial protector/packer for .net and mono. Features on-line verifications and "industry standard encryption".
Mac OS Classic application files
- Application VISE[9]
- StuffIt InstallerMaker
Mach-O (Apple Mac OS X) files
- HASP Envelope
- UPX
- VMProtect
Java
JAR files
- HASP Envelope
- pack200
WAR files
- HASP Envelope
JavaScript scripts
There are two types of compression that can be applied to scripts:
- Reduce the redundancy in the script (by removing comments, white space and shorten variable and functions names). This does not alter the behavior of the script.
- Compress the original script and create a new script that contains decompression code and compressed data. This is similar to binary executable compression.
Self decompressing compressors
These compress the original script and output a new script that has a decompressor and compressed data.
- JsSfx
- Packify
Redundancy reducing compressors
These remove white space, remove comments, and shorten variable and function names but do not alter the behavior of the script.
- Packer
- YUI compressor
- Shrinksafe
- JSMin
See also
- Data compression
- Disk compression
- RAM compression
- Executable
- Kolmogorov complexity
- Self-extracting archive
References
^ https://www.pelock.com/products/netshrink/download
^ http://www.dotbundle.com/download.html
^ http://www.enigmaprotector.com/en/downloads/changelog.html
^ http://webtoolmaster.com/news.xml
^ http://webtoolmaster.com/news.xml
^ https://web.archive.org/web/20040525022811/http://www.xtreeme.prv.pl/
^ https://www.obsidium.de/show/download
^ https://www.pelock.com/products/pelock/download
^ Kiene, Steve; Mark, Dave (1999). "A Chat With Steve Kiene". MacTech. Vol. 15 no. 4. Retrieved 2017-12-10..mw-parser-output cite.citation{font-style:inherit}.mw-parser-output .citation q{quotes:"""""""'""'"}.mw-parser-output .citation .cs1-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Wikisource-logo.svg/12px-Wikisource-logo.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:inherit;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{font-size:100%}.mw-parser-output .cs1-maint{display:none;color:#33aa33;margin-left:0.3em}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration,.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}