Skip to content

pappadf/peeler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peeler

CI C99 License: MIT

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.

Formats Supported

  • 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.

AI-Generated Library

This library is, to a large degree, AI-generated.

The development process involved two stages of AI-assisted work:

  1. Information Gathering & Specification — AI agents researched these formats from various sources, consolidating scattered documentation into comprehensive, self-contained format specifications (see docs/).

  2. 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.

Documentation

Detailed format specifications are available in the docs/ directory:

These specifications were synthesized from scattered resources and are intended to serve as standalone references for anyone implementing decoders for these formats.

Building

make

This produces the peeler executable in the build/ directory.

Usage

./build/peeler <input-file>

The tool will automatically detect the format and extract the contents.

Testing

cd test
./run_tests.sh

The test suite includes 61 test cases covering various StuffIt versions and compression methods, Compact Pro archives, BinHex encodings, and MacBinary wrappers.

Information Sources

Information about these legacy formats was gathered from numerous sources, including but not limited to:

Acknowledgements

  • 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

License

This project is licensed under the MIT License.

Trademarks

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.

About

A C library for unpacking legacy Macintosh archive formats

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors