UPX
1727630
217506978
2008-06-06T10:05:06Z
193.128.72.68
/* Compression */ of course it's lossless
{{Infobox Software
| name = UPX<br /><small>''the Ultimate Packer for eXecutables''</small>
| logo =
| screenshot =
| caption =
| collapsible =
| author =
| developer =
| released = [[May 26]], [[1998]]
| latest release version = 3.03
| latest release date = [[April 27]], [[2008]]
| latest preview version =
| latest preview date =
| frequently updated =
| programming language =
| operating system = [[Microsoft Windows|Windows]], [[Linux]], [[DOS]], [[Atari]]
| platform =
| language =
| status =
| genre = [[Executable compression]]
| license = [[GNU General Public License|GPL]]
| website = [http://upx.sourceforge.net upx.sf.net]
}}
'''UPX''', ''the '''U'''ltimate '''P'''acker for e'''X'''ecutables'', is an [[open source]] [[Executable compression|executable packer]] supporting a number of file formats from different operating systems. It is [[free software]], released under the [[GNU General Public License]].
== Compression ==
UPX uses a [[compression]] [[algorithm]] called UCL, which is a free implementation of the proprietary NRV, '''''N'''ot '''R'''eally '''V'''anished'', algorithm.
UCL has been designed to be simple enough that a decompressor can be implemented in just a few hundred [[bytes]] of code. UCL requires no additional memory to be allocated for decompression, a considerable advantage that means that a UPX packed executable requires no additional memory.
UPX (3.0) can use [[LZMA]] on 32/64-bit platforms.
== Decompression ==
UPX supports two mechanisms for decompression, an in-place technique, and extraction to [[temporary file]].
The in-place technique, which decompresses the executable into memory, is not possible on all supported platforms. The rest use extraction to temporary file. This procedure involves additional overhead and other disadvantages; however, it allows any executable file format to be packed. The executable is extracted to a temporary location, and then <code>open()</code> is used to obtain a file descriptor.
Once a file descriptor is obtained, the temporary file can be <code>unlink()</code>ed, the stub then uses <code>execve()</code> on the file handle (via <code>/proc</code>) to overwrite the stub with the executable image of the temporary file.
The extraction to temporary file method has several disadvantages:
* special permissions are ignored, such as [[setuid|suid]].
* <tt>[[Command line interface#Anatomy of a CLI|argv[0]]]</tt> will not be meaningful.
* applications will be unable to share common segments.
Unmodified UPX packing is often detected and unpacked by [[Antivirus software|anti-virus]] scanners. UPX also has a built-in feature for unpacking unmodified executables packed with itself.
== Supported formats ==
* [[ARM architecture|ARM]]/[[Portable Executable|pe]]
* [[atari]]/tos
* *[[BSD]]/[[i386]]
* [[DJGPP|djgpp2]]/[[COFF|coff]]
* dos/[[COM file|com]]
* dos/[[EXE|exe]]
* dos/sys
* [[linux]]/[[i386]] [[a.out (file format)|a.out]]
* [[linux]]/[[Executable and Linkable Format|ELF]] on [[i386]], [[amd64]], [[ARM architecture|ARM]], [[powerpc]]
* [[linux]]/kernel on [[i386]], [[amd64]] and [[ARM architecture|ARM]]
* mach/ppc32, mach/i386
* rtm32/[[Portable Executable|pe]]
* tmt/adam
* [[ps1]]/exe
* [[watcom]]/le
* [[win32]]/[[Portable Executable|pe]] (excluding files built using the [[Portable_executable#.NET.2C_metadata.2C_and_the_PE_format|.NET Framework]])
== See also ==
{{Portal|Free software|Free Software Portal Logo.svg}}
==External links==
* [http://upx.sourceforge.net UPX: the Ultimate Packer for eXecutables]
* {{SourceForge|project=upx|name=UPX - a powerful executable packer}}
* [http://freshmeat.net/projects/upx/ UPX] at [[Freshmeat]]
{{Compression Software Implementations}}
[[Category:Free data compression software]]
[[Category:EXE packers]]
[[de:UPX]]
[[es:UPX]]
[[fr:UPX]]
[[ko:UPX]]
[[pl:UPX]]
[[ru:UPX]]