Aladdin Systems never published the StuffIt formats. What is known comes from reverse engineering, mainly the notes kept with The Unarchiver’s XADMaster library, which this page follows. Fields marked unknown are unknown to that work too. All numbers are big-endian, and dates are classic Mac OS times: seconds since 1 January 1904, local time.
Classic StuffIt archive header
Used by StuffIt 1.x to 4.x.
| Offset | Size | Meaning |
|---|---|---|
0 | 4 | First magic: SIT!, ST46, ST50, ST60, ST65, STin, STi2, STi3 or STi4. |
4 | 2 | Number of files. Its exact meaning is unclear; it may count only the top level. |
6 | 4 | Total size of the archive. |
10 | 4 | Second magic: 72 4C 61 75, rLau, for Raymond Lau. |
14 | 1 | Version; its meaning is unclear. |
15 | 7 | Unknown. |
The first file header follows at offset 22.
Classic StuffIt file header
Always 112 bytes.
| Offset | Size | Meaning |
|---|---|---|
0 | 1 | Resource fork method: see method byte. |
1 | 1 | Data fork method. |
2 | 1 | File name length. |
3 | 63 | File name (Mac Roman). |
66 | 4 | Mac OS file type, such as TEXT. |
70 | 4 | Mac OS creator code. |
74 | 2 | Finder flags. |
76 | 4 | Creation date. |
80 | 4 | Modification date. |
84 | 4 | Resource fork length, uncompressed. |
88 | 4 | Data fork length, uncompressed. |
92 | 4 | Resource fork length, compressed. |
96 | 4 | Data fork length, compressed. |
100 | 2 | Resource fork CRC-16. |
102 | 2 | Data fork CRC-16. |
104 | 6 | Unknown. |
110 | 2 | CRC-16 of the header. |
The compressed resource fork follows the header, then the compressed data fork; the next header starts right after them.
Method byte
| Bits or value | Meaning |
|---|---|
| Bits 0 to 3 | Compression method, 0 to 15. |
Bit 4 (10) | The fork is encrypted; the algorithm is unknown. |
32 (20 hex) | Start of a folder: the name field holds the folder’s name; the entries up to the matching end marker are inside it. |
33 (21 hex) | End of a folder. |
StuffIt 5 archive header
StuffIt 5.0 (1997) and later write this layout by default.
| Offset | Size | Meaning |
|---|---|---|
0 | 80 | Text: StuffIt (c)1997-, a year, Aladdin Systems, Inc. and a web address, ending with 0D 0A. The characters after 1997- vary between versions. |
80 | 4 | Unknown. |
84 | 4 | Total size of the archive. |
88 | … | Unknown; the notes list the offset of the first entry header near here, but their table has a typo, so its exact place is not confirmed. |
StuffIt 5 entry header
| Offset | Size | Meaning |
|---|---|---|
0 | 4 | Identifier A5 A5 A5 A5. |
4 | 1 | Version; the notes mention versions 1 and 3. |
5 | 1 | Unknown. |
6 | 2 | Header size. |
8 | 1 | Unknown. |
9 | 1 | Flags: bit 5 (20) encrypted, algorithm unknown; bit 6 (40) a folder. |
10 | 4 | Creation date. |
14 | 4 | Modification date. |
18 | 4 | Offset of the previous entry. |
22 | 4 | Offset of the next entry, from the start of the file. |
26 | 4 | Offset of the parent folder’s entry. |
30 | 2 | Name length. |
32 | 2 | Header CRC-16. |
34 | 4 | Data fork length, uncompressed. In a folder entry, FFFFFFFF marks a special entry of unknown purpose that readers skip. |
38 | 4 | Data fork length, compressed. |
42 | 2 | Data fork CRC-16; zero for method 15. |
44 | 2 | Unknown. |
46 | 1 or 2 | File: data fork method (1 byte), then the length N of password data (1 byte). Folder: number of entries in it (2 bytes). |
48 | N | Password information; meaning unknown. |
| 48 + N | M | Name. |
| … | 2 | Comment length K. |
| … | 2 | Unknown. |
| … | K | Comment. |
Second header
A file entry continues with a second part, then the compressed resource fork, then the compressed data fork.
| Offset | Size | Meaning |
|---|---|---|
0 | 2 | Flags 2: bit 0 set when a resource fork is present. |
2 | 2 | Unknown. |
4 | 4 | Mac OS file type. |
8 | 4 | Mac OS creator code. |
12 | 2 | Finder flags. |
14 | 2 | Unknown. |
16 | 4 | Unknown; possibly a date in version 3. |
20 | 12 | Unknown. |
32 | 4 | Unknown; present in entry version 1, absent in version 3. |
| 32 or 36 | 4 | Resource fork length, uncompressed (only with a resource fork, as are the next four). |
| 36 or 40 | 4 | Resource fork length, compressed. |
| 40 or 44 | 2 | Resource fork CRC-16; zero for method 15. |
| 42 or 46 | 2 | Unknown. |
| 44 or 48 | 1 | Resource fork method. |
| 45 or 49 | 1 | Unknown. |
Compression methods
| Method | XADMaster name | Algorithm |
|---|---|---|
0 | – | Stored, no compression. |
1 | Rle90Algorithm | Run-length encoding with the 90 hex escape byte, as in BinHex. |
2 | CompressAlgorithm | LZW as in Unix compress, 14-bit codes, block mode. |
3 | StuffItAlgorithm3 | Simple Huffman coding of bytes. |
5 | StuffItAlgorithm5 | Called “LZAH” in the notes. Not described further. |
8 | StuffItAlgorithm8 | Miller–Wegman LZ. Not described further. |
13 | StuffItAlgorithm13 | LZSS with Huffman coding. |
14 | StuffItAlgorithm14 | Listed with no description; XADMaster has a decoder for it. |
15 | StuffItArsenicAlgorithm | Arsenic: block sorting (Burrows–Wheeler) and arithmetic coding. |
Methods 4, 6, 7 and 9 to 12 are not known to be used. The notes give one line per method; the decoders in XADMaster are the only full description.
CRC-16
The notes give the CRC as CRC-16 with the CCITT polynomial 1021 and no
starting or final inversion. They do not say exactly which bytes either header CRC
covers.