Skip to content

kkrunchy

Transform the instructions before compressing them

kkrunchy is Fabian Giesen’s executable packer for Windows 64K intros. Its reversible treatment of x86 instructions helps expose patterns to the compressor, trading preparation and unpacking work for a smaller production.

kkrunchy compresses a Windows executable after it has been linked. Its author, Fabian Giesen, known as ryg of farbrausch, designed it for 64K intros: demo productions whose complete executable must fit a fixed size limit.

That purpose shaped its compromises. Giesen’s tool page describes slow unpacking and unsupported executable features, including exports and thread-local storage. It was specialised equipment for size coding, rather than a general way to shrink every Windows program.

Make similar bytes neighbours

In his 2011 account, Giesen explained a reversible transformation of x86 instructions. An instruction can contain an operation, information about its operands, an address or a constant. kkrunchy separates such components into streams, bringing bytes with similar jobs together before compression.

The decompressor reverses the transformation to recover the instructions. Giesen related the approach to the split-stream method in the PPMexe research paper; he did not present instruction-aware compression as an idea without predecessors.

He also distinguished two generations of kkrunchy: an earlier LZ77-based compressor with an arithmetic-coding stage, and a later context-mixing design. A more capable compression model costs more decoder code, a trade-off that matters when the decoder itself counts towards the limit.

Measure the delivered program

The historical tool page describes an analysis mode which uses debugging or map information to estimate the packed cost of functions and data. Those figures are estimates: compression works across boundaries, and transformed instructions do not map neatly back to individual original bytes.

farbrausch published two kkrunchy source trees in its April 2012 tools release, alongside editors, engines and music software. The packer was one part of how generated content became small executables, including debris.. Crinkler approaches smaller intros by combining compression with the linking stage itself.

Sources

Checked. Verified against primary sources and signed off by a person.