Peeler is a small C library for unpacking legacy Macintosh compression and archive formats.
Just as you peel an orange to get to the fruit inside, Peeler unpacks old Mac archives to extract their contents — .sit (StuffIt), .cpt (Compact Pro), .hqx (BinHex), and .bin (MacBinary) files.
- StuffIt (
.sit) — including methods 13, 14, and 15 ("Arsenic") - Compact Pro (
.cpt) - BinHex (
.hqx) — 4.0 encoding - MacBinary (
.bin)
These formats were commonly used for distributing software and documents on classic Macintosh systems before the widespread adoption of .zip and other modern formats.
This library is, to a large degree, AI-generated.
The development process involved two stages of AI-assisted work:
-
Information Gathering & Specification — AI agents researched these formats from various sources, consolidating scattered documentation into comprehensive, self-contained format specifications (see
docs/). -
Code Generation — Based on those specifications, other AI agents generated the actual C implementation, test harness, and supporting infrastructure.
The goal was to demonstrate that with careful specification and iteration, AI can produce working implementations of complex, under-documented legacy formats.
Detailed format specifications are available in the docs/ directory:
sit15.md— StuffIt Method 15 ("Arsenic") compressionsit13.md— StuffIt Method 13 compressionsit.md— StuffIt archive structurecpt.md— Compact Pro formathqx.md— BinHex 4.0 encodingbin.md— MacBinary formatarchitecture.md— Library design overview
These specifications were synthesized from scattered resources and are intended to serve as standalone references for anyone implementing decoders for these formats.
makeThis produces the peeler executable in the build/ directory.
./build/peeler <input-file>The tool will automatically detect the format and extract the contents.
cd test
./run_tests.shThe test suite includes 61 test cases covering various StuffIt versions and compression methods, Compact Pro archives, BinHex encodings, and MacBinary wrappers.
Information about these legacy formats was gathered from numerous sources, including but not limited to:
- Matthew Russotto's Arsenic Compression Notes
- The Unarchiver Wiki
- bzip2 Format Specification (for BWT algorithm reference)
- stuffit-rs (MIT license)
- StuffItReader (MIT license)
- Matthew Russotto — for his detailed documentation of the StuffIt Method 15 ("Arsenic") compression format
- Dag Ågren — author of The Unarchiver, whose open-source implementation helped establish community understanding of these formats
- Stephan Sokolow — for providing StuffIt test images that were invaluable for validation
This project is licensed under the MIT License.
StuffIt, Compact Pro, BinHex, MacBinary, and other product names mentioned in this project are trademarks or registered trademarks of their respective owners. These names are used solely for identification purposes and do not imply any affiliation with or endorsement by the trademark holders.