PAK (Starbound)

From Just Solve the File Format Problem
Jump to: navigation, search
File Format
Name PAK (Starbound)
Ontology
Extension(s) .pak
Magic Bytes SBASSET6

PAK is the container file format for storing game assets in the game Starbound.

Description

A Starbound PAK file starts with "SBASSET6", then eight bytes of a pointer to an index table. That index table starts with "INDEX", and then is followed up with metadata about the file in a compressed json format used by this file format and other similar storage files in the game. This compressed format depends on using variable-length integers to store length information, and then the information itself. Frequently, but not necessarily a dynamic "data type" byte is used before the length to specify what data type the following data is, with 1 being null, 2 being 8 bytes, 3 being a boolean, 4 being a signed variable-length integer, 5 being a string in utf-8 format, 6 being a list, and 7 being a map. A list consists of the amount of list elements followed by the elements in dynamic format, while a map consists of the amount of key-value entries in the map, starting with a string as a key and then the value in dynamic format. The metadata format continues as such until the end of the key-value list, after which a file listing starts, with a variable-length integer stating the amount of file entries. A file entry consists of the file name in length-string format, then eight bytes of a pointer to the file and eight bytes of the file's length.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox