Skip to content

General File Structure and Block Structure

Daniel edited this page Feb 16, 2015 · 1 revision

General File Structure

0x0000 Header
0x0800 Top Level Index Block
0x0C00 Fist Data Level Block
...    Any further block in random order

Block Structure

A block is 0x400 bytes of data, containing up to 0x3F2 bytes of payload. A block has the following structure:

  • <DELETED FLAG> byte
    has the value of 0xFF if the block is deleted
  • <INDEX LEVEL> byte
    the index level is 0 for data blocks. Otherwise it is the hierarchy number of the index.
  • <PREV ID> word
    the id of the block preceding this block in the data stream
  • <NEXT ID> word
    the id of the block following this block in the data stream
  • <SKIP BYTES> halfword
    the number of bytes that are identical to the parsing state relative to the previous block – these bytes can be skipped if the parser continues parsing the data stream
  • <PAYLOAD LENGTH> halfword
  • <PAYLOAD> <PAYLOAD LENGTH> bytes
  • <PADDING> 0x3F2 - <PAYLOAD LENGTH> bytes

e.g. the block header 00 00 00017D27 00017D28 0003 0111 would tell us

  • it is not deleted
  • it is a data block
  • the previous block id is 0x00017D27
  • the next block id is 0x00017D28
  • 3 can be skipped if this block is not the entry point for the parser
  • the payload is 0x111 bytes long

Points of interest

the ID for the block itself has to be derived from the context