where is the docs for 'offset' and 'structure reference'

+1 vote
asked Oct 25, 2016 in Synalyze It! by toddwr (130 points)

The file I am going through has the following layout so far:

  1. magic number
  2. count
  3. record length repeated count times
  4. record1
    1. marker
    2. flags
    3. offset to a string
    4. offset to a string
    5. offset to a structure
    6. other data
  5. record2

I can't find anything describing how the 'insert offset' or  'insert structure reference' are supposed to work or if they will be handy in this situation. 

any help would be appreciated 

Todd

ps 

on a unrelated topic is it possible to use the above lengths of records to define the length of the data. like so:

  • record1 size       length[0]
  • record1 size       length[1] 
  • record1 size       length[2] 

1 Answer

0 votes
answered Oct 26, 2016 by andreas (3,500 points)
Thank you for mentioning the missing documentation!

Offset and structure reference elements have much in common. The only difference is that offset elements consume space in the file and point to some other file offset, a structure reference element behaves as if the referenced structure would be there.

Both elements reference one top-level structure. So if you want to have an offset to a string, this string needs to have a top-level structure around itself. The structure you have an offset for must also be a top-level structure.

Regarding the "bonus question": Currently single elements of an element with repeat count > 1 can't be referenced with normal grammar means. Using script elements however this could be done. Let me know if you need more information on this.

Andreas
...