bw logo

Chapter 3. BinSection files

A BinSection can be interpreted as a binary blob of data. It can also be viewed as containing other data sections.

Currently, the binary files .anca, and .primitives use this format (for details on .primitive files, see .primitives).

Described in BNF format, the file has the following format (the asterisk character —*— indicates that the previous section might appear zero or more times):

<bin_section> ::= <magic_number> <child_section_data> <index_table> 
<child_section_data> ::= <binary_blob>*1
<index_table> ::= <data_section_entry>* <index_table_length> 
<data_section_entry> ::= <blob_length><reserved_data><data_section_tag> 
<data_section_tag> ::= <tag_length><tag_value>

BinSection file format in BNF grammar

1

For each <binary_blob> there is a <data_section_entry>.

The list below describes the sections in the file:

  • <binary_blob>

    Binary data, padded to 4-byte boundary

  • <blob_length>

    4-byte little endian integer, containing the length of respective <binary_blob>.

  • <index_table_length>

    4-byte little endian integer, containing the length of section <index_table>, excluding this entry.

  • <magic_number>

    4-byte number 0x42A14E65 (65 4E A1 42 big endian).

  • <reserved_data>

    16-byte reserved data, containing the following fields:

    • preloadLen — uint32 containing length of data when streamed in.

    • version — uint32 containing a version number.

    • modified — uint64 containing timestamp of last modification.

  • <tag_length>

    4-byte little endian integer, containing length of the section's tag.

  • <tag_value>

    Section's tag, padded to 4-byte boundary