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: