Pushover RNC Compression
Most original Pushover assets use RNC ProPack method 1 compression, irrespective of their filename extension. Decode this wrapper before interpreting the inner format. The game uses the shared literal-run obfuscation key 0x1984.
File format
| Offset | Data type | Name | Description |
|---|---|---|---|
| 0x00 | BYTE[4] | signature | 52 4E 43 01 (RNC, method 1) |
| 0x04 | UINT32BE | unpackedSize | Output byte count |
| 0x08 | UINT32BE | packedSize | Compressed byte count excluding this 18-byte header |
| 0x0C | UINT16BE | unpackedCRC | CRC16 of output |
| 0x0E | UINT16BE | packedCRC | CRC16 of compressed bytes |
| 0x10 | UINT8 | leeway | Encoder bookkeeping |
| 0x11 | UINT8 | blocks | Huffman-table block count |
| 0x12 | BYTE[packedSize] | stream | Huffman-coded LZ stream |
Decompression
Method 1 combines Huffman-coded literal lengths, match lengths and match offsets with LZ back-references. The initial stream flags include a key flag. Literal runs use the 16-bit key, rotated after each literal run; this is separate from THEME.DAT's cipher. Use the linked implementation for the bit-buffer and literal-stream interleaving rules. Check both CRCs and the declared output size.
The repository's command-line decoder defaults to the correct key:
node tools/rnc-unpack/bin/cli.js input output --key=1984
Notes
Uncompressed exceptions are QUAVERS.ICN, THEMES/*.PAL, THEMES/THEME.KEY, THEMES/THEME.DAT and PUSH.CFG. The documentation reports successful verification of 171 non-executable compressed assets. The executable packing has separate unresolved issues; success on asset files does not establish executable unpacking support.
Source code
From pushover, the open-source browser port and its reverse-engineering notes:
- docs/formats/rnc.md – reverse-engineering documentation
- tools/rnc-unpack/lib/rnc.js – decompressor and CRC handling
- tools/rnc-unpack/lib/rnc-pack.js – compressor
Credits
This file format was reverse engineered by VorticonCmdr. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)