-
Notifications
You must be signed in to change notification settings - Fork 8
BYAML File Format
These files are similar to regular YAML files, but are encoded in binary form. They usually have the file extension .byml
or .byaml
.
This page describes version 1 of the file format.
Offsets in the header are absolute.
Offset | Size | Description |
---|---|---|
0x0 | 2 | Magic number / BOM (BY : big endian, YB : little endian) |
0x2 | 2 | Version number |
0x4 | 4 | Offset to dictionary key table |
0x8 | 4 | Offset to string table |
0xC | 4 | Unknown |
0x10 | 4 | Offset to root node (array or dictionary) |
A node starts with a single byte that indicates its type.
ID | Type |
---|---|
0xC0 | Array |
0xC1 | Dictionary |
0xC2 | String table |
The type table contains one byte per element that indicates its node type.
If the number of elements is not a multiple of 4, additional null bytes are inserted between the type table and the data table such that the data table is aligned to 4 bytes.
The data table contains either an absolute offset to the node (for container nodes), or simply the value of the array element (for primitive nodes).
Offset | Size | Description |
---|---|---|
0x0 | 1 | Node type (0xC0) |
0x1 | 3 | Number of elements (N) |
0x4 | N | Type table |
4 x N | Data table |
A string table is a special kind of node.
The address table contains offsets to the strings, relative to the start of the string table node. It also contains an offset that points to the end of the string table (right behind the last string).
The address table and strings must both be sorted, because a binary search algorithm is used to find them.
Offset | Size | Description |
---|---|---|
0x0 | 1 | Node type (0xC2) |
0x1 | 3 | Number of strings (N) |
0x4 | 4 x (N + 1) | Address table |
Null-terminated strings |