Last modified: Thu Jul 23 14:59:00 UTC+0200 2026 © A. Tarpai
An unzip program
Motivation
It'd be nice to simply ZIP multiple files before loading into the OS: fonts, small BMP images, other uncompressed data. ZIP primarily uses the Deflate algorithm and after finishing a Deflate decompressor for PNG, it was fairly simply to make an unzip.
ZIP file
local_file_header local_file_header local_file_header local_file_header local_file_header ...
For a simple ZIP file each compressed file and folder names are described by a local_file_header.
For folders, uncompressed size is zero.
For Deflate compressed files, compression_method==8.
For uncompressed files, compression_method==0.
Unzipping
Simply allocate uncompressed size bytes and call Inflate(). This is the same code I used for the PNG decoder.
After inflating the uncompressed file is in memory.
Source code
Source code is in the RAINBOW repository on GitHub.
20121012