A ZIP extractor built from scratch in C. No external libraries. Just raw bytes.
Implements the ZIP format spec and a full DEFLATE decompressor (RFC 1951) by hand — bit reader, Huffman trees, LZ77 back-references, all of it.
brew tap sarthaksingh/zypr
brew install zypr
git clone https://github.com/sarthaksingh/zypr
cd zypr
make
# Extract a ZIP file
zypr archive.zip
# List contents without extracting
zypr -l archive.zip
# Extract to a specific directory
zypr -o output_dir archive.zip
zypr/
├── src/
│ ├── main.c — entry point and argument parsing
│ ├── zip.c — ZIP format parsing and extraction
│ └── inflate.c — DEFLATE decompressor
├── include/
│ ├── zip.h
│ └── inflate.h
└── Makefile
ZIP files have three main sections:
Zypr scans backwards from the end of the file to find the EOCD, then walks the central directory to find each file, then decompresses them using a hand-written DEFLATE implementation.
DEFLATE (used by most ZIP files) combines two algorithms:
Zypr implements the full inflate algorithm including stored blocks, fixed Huffman blocks, and dynamic Huffman blocks.