From be5a701db8954467a65d98c13a8ebbd014aff9cb Mon Sep 17 00:00:00 2001 From: Patryk Gensch <43010113+patryk025@users.noreply.github.com> Date: Wed, 28 Oct 2026 21:34:36 +0100 Subject: [PATCH] fix(extractor): read a 6.1 case's facts from its member when run has no case region Pinokio's unoptimised run(int, CXVector*) now parses as a switch, but the decompiler gives Application's cases no region; a case that forwards to a named runner member is read from that member, as name dispatch did. Co-Authored-By: Claude Opus 5.5 --- ghidra_scripts/extract_engine_surface.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ghidra_scripts/extract_engine_surface.py b/ghidra_scripts/extract_engine_surface.py index 1b7a927..c3e5b06 100644 --- a/ghidra_scripts/extract_engine_surface.py +++ b/ghidra_scripts/extract_engine_surface.py @@ -1910,10 +1910,15 @@ def annotate_method_facts(program, method_dispatch, run_addrs, runner_map, types rows = [r for r in rows if r.get("dispatch") != "name"] run_func = _function_at(program, run_addrs.get(runner)) high = dec.high(run_func) if run_func is not None and rows else None - if high is None: - continue - roles = _storage_roles(program, high, run_roles) - regions = _case_regions(high, set(int(r["case_addr"], 16) for r in rows)) + roles = _storage_roles(program, high, run_roles) if high is not None else {} + regions = _case_regions(high, set(int(r["case_addr"], 16) for r in rows)) if high is not None else {} + for row in rows: + impl = _function_at(program, row.get("impl_addr")) if row.get("impl") else None + if legacy and impl is not None and int(row["case_addr"], 16) not in regions: + # No case region (Pinokio's unoptimised run): the case forwards to a named member. + facts = _Facts(legacy) + _collect_function(program, dec, resolve_thunk(impl), _NAMED_IMPL_ROLES, getters, facts, 1, []) + row.update(facts.as_dict()) for row in rows: region = regions.get(int(row["case_addr"], 16)) if region is None: