Closed jakecrowley closed 2 years ago
thanks for the heads up, I will look into this.
I'm not sure how to get the appropriate information about test2 from the information that Kaitai provides. It isn't in the _debug
dictionary, so I guess I would need to analyze the core object and determine its position from there? I'm open to ideas from anyone more familiar with kaitai.
I noticed that the produced byte length is inaccurate in the example you gave, and I fixed that in fdc2b10c373a66c110488026e3b130ee47e5d65e
Instances set by value aren't going to be in the _debug dict, since they don't have a start or end because they are set directly, not in the stream. You could fix this by looping over all attributes of the object and not just the attributes in _debug.
I wrote an example implementation of this method - jakecrowley/hobbits@1c49116
ok, cool, I might just steal that because I don't have a better idea. Feel free to do pull request into develop if you think it's a reasonable solution - as you have seen, the whole script is pretty hacky.
It hasn't been tested very extensively, but it seems to work in my short testing. I've gone ahead and created a PR if you are okay with merging.
In the Kaitai Struct plugin, if you have an instance set by a value, it fails to appear in the "Parsed" tab.
for example:
should result in something like this (from kaitai struct visualizer):
however, in Hobbits, it appears like this: