Skip to content

Commit

Permalink
fix: correctly display kaitai value instances for #145
Browse files Browse the repository at this point in the history
fix KaitaiStruct value instances not appearing
  • Loading branch information
hello-adam authored Jun 8, 2022
2 parents fdc2b10 + 4db109f commit 556514b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/hobbits-plugins/analyzers/KaitaiStruct/scripts/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ def parse_struct(struct, sections, prefix="", parent_offset = 0, base_io=None, b
#print(vars(struct))
#print(struct._debug)

for name, info in struct._debug.items():
try:
value = getattr(struct, name)
except:
print(f"Skipping {name}, not an attribute in struct")
for name, value in struct.__dict__.items():
if name in ("_io", "_parent", "_root", "_debug") or name.startswith("_raw_"):
continue

if name in struct._debug:
info = struct._debug[name]
else:
info = {"start": 0, "end": 0}

label = prefix + "." + name if prefix else name
parent_offset = info["start"] + base_offset

Expand Down

0 comments on commit 556514b

Please sign in to comment.