Wednesday, June 8, 2016

Transparent Executable Compression

Recently I was curious about the underlying design of which is a great website for comparing behavior between different versions of PHP and HHVM. If you do work in PHP, I highly recommend exploring as there are almost certainly more behavior differences between the various versions than you expect. As part of this service, needs to have access to a large number of executables to test, enter Ultimate Packer for eXecutables (UPX).

UPX initially compresses the executable with UCL, a specialized algorithm that enables the decompressor to be just a few hundred bytes of code, no additional memory requirements, very high speed, and in place decompression. The best part is the wide support of executable types including most Linux (ELF), Dos/Win32, and Mac OS X formats.

Getting Started with UPX under CentOS 7

UPX is available from rpmforge, if you already have rpmforge enabled (or wish to) it is as easy as:
sudo yum install upx
Otherwise if you wish to installed it directly:
sudo yum install
Compress an executable:
$ upx hhvmUltimate Packer for eXecutables
Copyright (C) 1996 - 2013
UPX 3.91 Markus Oberhumer, Laszlo Molnar & John Reiser Sep 30th 2013
File size Ratio Format Name
-------------------- ------ ----------- -----------
84749966 -> 21371364 25.22% linux/ElfAMD hhvm
Packed 1 file.
That’s an impressive reduction from 85MB to just 21Mb! For those looking for maximum effect (and time to spare), give the “--best” option a try. The “-l” option can also be used to get details on an already compressed executive. Happy Compressing!

No comments:

Post a Comment