From 4db109fe21bba5a64297810ea8f174fbd35bd72e Mon Sep 17 00:00:00 2001 From: Jake Crowley Date: Tue, 7 Jun 2022 15:34:54 -0400 Subject: [PATCH] fix value instances not appearing --- .../analyzers/KaitaiStruct/scripts/runner.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/hobbits-plugins/analyzers/KaitaiStruct/scripts/runner.py b/src/hobbits-plugins/analyzers/KaitaiStruct/scripts/runner.py index 016e9540..36d4bceb 100644 --- a/src/hobbits-plugins/analyzers/KaitaiStruct/scripts/runner.py +++ b/src/hobbits-plugins/analyzers/KaitaiStruct/scripts/runner.py @@ -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