Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:PKLITE

From ReverseEngineering.wiki
Format
On this wiki Facts · Code · Notes · Topics

PKWARE's PKLITE compresses DOS .EXE and .COM files; the MZ header's word at offset 0x1C holds the PKLITE version and flag bits, and the decoder at the entry point begins with one of a few known byte patterns per version family.

Version word

In a PKLITE-compressed EXE the 16-bit little-endian word at MZ header offset 28 (0x1C, e_res) is the version info. Bits 0-11 are the version number (high byte major, low byte minor, printed as major.minor with two digits, for example 1.12 or 2.01); bit 12 (0x1000) is shown by deark as "/e" (the extra-compression option), bit 13 (0x2000) selects "/l" (large model) instead of "/s" (small), and bit 14 (0x4000) is shown as "/h". For PKLITE-compressed .COM files the same word sits in the COM stub at a position deark finds by pattern.

Recognising by the entry point

A typical PKLITE EXE has IP 0x100, CS -16 (0xFFF0, so the entry point is at the start of the code) and at most two relocation entries. The bytes at the entry point (? = any) then fall in one of these families:

Entry-point bytes Class (deark)
B8 ?? ?? BA ?? ?? 8C DB 03 D8 3B 1.00-1.05
B8 ?? ?? BA ?? ?? 05 00 00 3B 06 1.12-1.15
50 B8 ?? ?? BA ?? ?? 05 00 00 3B 2.01
9C BA ?? 00 2D ?? 00 81 E1 ?? 00 81 looks patched by UN^2PACK 2.0
B8 ?? ?? BA ?? ?? 05 00 00 3B 2D Megalite (CS 0, IP 0, one relocation, relocation table at offset 28)

Beta builds use IP 0x100 with CS above -16 and no relocations, and begin 2E 8C 1E ?? ?? 8B 1E 02 00 8C DA 81 or 2E 8C 1E ?? ?? FC 8C C8 2E 2B 06.

Other details

Some registered PKZIP.EXE builds contain an uncompressed area marked by the 8 bytes PKLITE 26 A3 inside the compressed stream. Unverified: the "PKLITE Copr." copyright string commonly seen near the start of the packed file is not read in the sources used here; check with strings.

Unpack with deark's pklite module or a PKLITE-aware unpacker; the decompressor uses an LZ77 variant with Huffman-coded lengths and offsets (distances 1 to 8191).

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