Open KOLANICH opened 6 years ago
Thank you.
Pascal strings: https://en.wikipedia.org/wiki/String_(computer_science)#Length-prefixed
I know that they are length prefixed. But the length may differ. Is the length 1-byte?
for values with mustmatch set the constraints set by fixedvalues and min/max value are used. If none of the fixedvalues is found or the value is not between min/max value the enclosing structure is not applied.
This is the especially valuable clarification, since I expected a bit different behavior (raising an error when a signature is not matched).
BTW, the software I develop is https://github.com/KOLANICH/synalysis2kaitai .
For multi-byte encodings like UTF-16 the length is 2 bytes. However, Pascal strings are usually prefixed with a single byte length. These built-in data types work in many cases - for more special requirements data types can be parsed with Python or Lua scripts.
In chapter 6 of https://www.synalyze-it.com/Synalyze_It_Manual.pdf you find some additional information regarding "mustmatch". So for structures with variable element order the parser can automatically select the one that should be used - where all constraints are met.
Thank you for the info. Could you also clarify what do valueexpression
, floating
,lengthoffset
, disabled
and debug
do?
valueexpression
: for structures it determines what should be displayed as value in the parsing results tree. For elements it allows to show a different value than the one that was parsed in the file. For elements it's not used much. For structures it's useful because you can avoid opening structures in the parsing results but still see what they're about.
floating
can be ignored. The idea was to mark structures as floating
which can appear at different places in a file.
lengthoffset
can also be ignored.
disabled
elements or structures are simply ignored while parsing.
debug
can be set for structures in order to get additional log messages while parsing a file. This makes grammar development easier because you see only parsing messages of a certain structure and not for all.
Could you clarify, please:
disabled
and unused
isprev
and this
islength
under the permissive licenserepeatmin
, repeatmax
and repeat
work (in pseudocode taking in account all versions of the format)mask
is always an integer, if it always must contain a fixedvalue
and how it interacts with endiannessfixedvalue
inside binary
always uses value
in hex??
@synalysis
I mean that there is enough information in the grammars themselves, but something is still unclear:
dynamic
endian?zero-terminated
anddelimiter-terminated
withdelimiter
=\0
?fixedvalues
do?mustmatch
do even 8n non-fixedvalues
tags?id
s be non-integer? .... etc