Format:Microsoft COMPRESS (SZDD and KWAJ)
| On this wiki | Facts · Code · Notes · Topics |
|---|
Files made by Microsoft's COMPRESS.EXE: SZDD (the format of setup files like SETUP.EX_) and KWAJ (COMPRESS from MS-DOS 6 on), both with an 8-byte magic ending in 88 F0 27 and a small header followed by LZSS-family data.
SZDD
Header (14 bytes, little endian): the 8 magic bytes 53 5A 44 44 88 F0 27 33 ("SZDD" then 88 F0 27 33), a compression mode byte (41 "A" is the usual LZSS with a 16-byte lead-in; 42 "B" is the LZSS variant with an 18-byte one), the missing last character of the original name (the file is stored as, for example, FOO.EX_ and this byte is the dropped character; 0 means unknown) and a 32-bit uncompressed size. Compressed data starts at offset 14. The older QBasic form has the magic 53 5A 20 88 F0 27 33 ("SZ "), then a volume byte that must be D1, then the 32-bit size.
KWAJ
Header: magic 4B 57 41 4A 88 F0 27 D1 ("KWAJ"), u16 compression method (0 none, 1 XOR-obfuscated, 2 LZSS, 3 LZ with Huffman, 4 MSZIP), u16 offset of the compressed data, u16 flag word, then optional fields in this order: bit 0x01 u32 uncompressed size, bit 0x02 a u16 that is skipped, bit 0x04 u16 length followed by that many bytes, bit 0x08 the base file name (NUL-terminated, up to 8 characters), bit 0x10 the extension (NUL-terminated, up to 3), bit 0x20 a comment. Deark also has a separate module for the "MRNZ" variant (magic 4D 52 4E 5A 88 F0 27 33).
Use
In reverse engineering, installers of 1990s DOS and Windows 3.x software ship files in these formats; expand them with deark, Microsoft's EXPAND, or any SZDD tool before analysing.
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