Format:LZEXE
| On this wiki | Facts · Code · Notes · Topics |
|---|
Fabrice Bellard's LZEXE packs a DOS MZ executable with an LZ77-style coder; versions 0.90, 0.91 and 0.91e differ in the decoder at the entry point and in how the relocation table is stored. Several SFX tools (ARJ, LHARK, PCX2EXE) reuse the decoder.
Identification
LZEXE output is an MZ executable (Format:DOS MZ executable) whose entry point holds a small decoder. Deark recognises it by a CRC-32 of the first 32 and the next 32 bytes at the entry point, with three known values for 0.90, 0.91 and 0.91e. LZEXE 0.91 also starts its decoder with the bytes 06 0E 1F 8B, and a related tool (PCX2EXE) embeds an LZEXE 0.91 decoder that contains the string *FAB* at offset 233 from the decoder start.
ARJ self-extractors made by ARJ 0.15-0.20 and 2.10 use the LZEXE decoder and carry the text LZ91 at MZ header offset 28 (0x1C, the first word of e_res); ARJ 2.20 and later put RJFX there. Unverified: LZEXE 0.90 writes LZ09 at the same offset (not seen in the sources read).
Private header
The packer stores its own header (found through the entry point): IP, CS (signed), SP, SS (signed), compressed length in paragraphs and two more words, plus two further words in version 0.90. They hold the original entry point and stack. Unverified: the exact name of the two extra fields.
Relocation table
Version 0.90 keeps the original relocation table in the same compressed form EXEPACK uses (Format:EXEPACK), starting 413 bytes after the private header; 0.91 uses a byte-coded list starting 344 bytes after it (a zero byte followed by a 16-bit value introduces a segment step). Unpack with deark's lzexe module; the unpacked file is rebuilt with that table.
Code & repositories
- https://github.com/jsummers/deark @
8997059c4f32af79978fb6c83be7c1c26c259afa· license: MIT (declared by the contributor for the files used; GitHub reports MIT (read from COPYING; GitHub's API was busy) for the repository)
Deark (MIT): modules exepack, lzexe, pklite, diet, mscompress and the shared EXE detection in src/fmtutil-exe.c are the most complete open documentation of DOS packer recognition, MZ size computation and header layouts.
Tested on: source read, not run: Read the cited files at this commit; nothing built or run. · checked 2026-10-19