PAK File Format

From The Ghar Station Wiki
Jump to: navigation, search

PAK File

PAK files are archives of data used by RIFT. The manifest file contains references to PAK files and entries within the manifest contain offsets within those PAK files. This allows a client to download individual files directly out of the PAK using HTTP range headers.


File format

Little endian.

Consists of a file header followed by an entry block and finally data.

Header

Bytes/Offset Content Comment
4 bytes Integer File version
4 bytes Integer File size in bytes
4 bytes Integer Size of the header in bytes
4 bytes integer Size of the entry block in bytes. Each entry is 60 bytes in size.

Entry block

Bytes/Offset Content Comment
4 bytes Integer Unknown
4 bytes Integer Unknown
4 bytes Integer Unknown
4 bytes bytes Filename hash- FNV1
4 bytes Integer Unknown
4 bytes Integer Compressed size of the entry in bytes
4 bytes Integer Uncompressed size of the entry in bytes
4 bytes Integer Unknown
4 bytes Integer Offset from the start of the file in bytes the data for this entry is at
24 bytes Unknown - possibly reserved for SHA hash?

Data

The data is either compressed or uncompressed, you can determine if it is compressed by comparing the compressed and uncompressed size of the entry, if they are equal the data is uncompressed.

If compressed, LZMA2 is generally used.