Daggerfall:PAK file formats

A UESPWiki – Sua fonte de The Elder Scrolls desde 1995

PAK is a compression format very similar to RLE, except there are no uncompressed "runs". Since there are no uncompressed "runs", it is not suitable for arbitrary data. This format is used by CLIMATE.PAK and POLITIC.PAK.

General Format

A stream of PAK-compressed data is composed of a contiguous list of one or more PakRun structures.

PakFile

A PakFile is merely a contiguous list of one or more PakRun structures.

PakRun

The 3 byte long PakRun structure is composed of a UInt16 Count field, immediately followed by a single UInt8 Value. This value is to be repeated Count times.

PakRun structure
Offset Type Name Description
0-1 UInt16 Count The number of times the Value field must be copied.
2 UInt8 Value The value to be copied to the output buffer.

Reading PAK files

To read a PakFile, one merely reads PakRun and processes structures until one has run out of file.