LZEXE

From ModdingWiki
Jump to navigation Jump to search
LZEXE
There is no image of this tool in use — upload one!
PlatformMS-DOS
Release date1989
Homepagebellard.org
DownloadSee homepage
GamesN/A

LZEXE is a utility that compresses an executable file into a smaller, self-extracting form. It was used in most early id Software and Apogee games, and many others. LZEXE compressed executables can be unpacked by a few different utilities, the most widely used being UNLZEXE.

An LZEXE compressed executable can be recognized by the presence of the tag "LZ" at offset 0x1C in the .EXE file, followed by a version number that is either "09" or "91". Such executables must be decompressed before any useful inspection or hacking of the .EXE can take place.

Note that some programs change the LZ91 signature to disguise the fact that LZEXE has been used. If there are four sensible-looking characters at the same offset there's a good chance the file has been compressed with LZEXE and had its signature changed. Luckily most decompression utilities don't look at this so they can decompress the file anyway. UNLZEXE looks at the .exe entry point where the decompression routine sits, and compares this to known LZEXE decompressors to identify the version.

There are three known variants of LZEXE:

  • Version 0.90: First release, supported by most decompressors.
  • Version 0.91: Most popular release, supported by most decompressors.
  • Version 0.91e: Latest version available, but still listed as version 0.91. It is referred here as 0.91e as this is one of the download links on the author's website. The decompression code in this version contains two very small changes which prevents UNLZEXE from recognising it. Support for decompressing this version has been added to Camoto's gamecompjs. The actual compression algorithm has not changed from 0.91 so supporting this variant merely requires detecting the altered decompression routine.