This version (2017/04/15 15:45) was approved by stohrendorf.The Previously approved version (2017/01/25 12:42) is available.
Table of Contents
PAK file format (TR4-TR5)
Overview
TR4 and TR5 use a file format with the extension PAK
for certain files (mostly pictures). This file format is actually a container for raw binary content, compressed using zlib.
Layout
struct pak_file { uint32_t UncompressedSize; // Uncompressed size of data (4 bytes) uint8_t CompressedData[]; // zlib-compressed data (read until EOF) }
The
UncompressedSize
field is used by the game to allocate the buffer for uncompressed data. Do not put a wrong value here, or it’ll result in unexpected and wrong behaviour.