I am trying to parse some c#/.net produced binary files. I am quite annoyed with strings. Let me explain: In that binary files strings are predefined with string length, and to read them I have defined such type:
types: c_hash_string: seq: - id: str_len type: u4 - id: text type: str size: str_len encoding: ASCII
Now this makes unnecessary ugly tree when parsed and to access some parsed element I need to call
path_to_the_string.text. I would like it to be able to access without '.text' part. Is there some easy technique to achieve this elegantly?
instances: my_str: pos: 0 type: c_hash_string my_str_2: value: my_str + 'blah_blah'
my_stractual type is a string
_io.posinto instance and then reusing it with some other instance