feat(extractor): extract scene modules (SCENE:DLLS=) like engines
A module DLL has no engine factory: its CMC_ExternObject::resolve compares TYPE (CXString::equals or operator==), allocates and constructs. The runner of each type is the vftable its constructor or a virtual installs whose prepare slot chains to CMC_Runner::prepareMthHashSet (defined when analysis left it out); registrations, dispatch, signatures, per-type events and fields then come from the engine passes, limited to the module's own runners. Snapshots record module_of (the host engine DLL). An unoptimised run() keeps the switch index in a stack slot; its bounds are followed through that slot only when the register match finds none. The batch queue extracts plugins too, the inventory knows MATRIX, QMAN, INERTIA and BOARD, and the tracker marks module-mapped types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f71cd9a90f
commit
4e65268a1e
+6
-4
@@ -345,11 +345,13 @@ def script_fields(snap: Snapshot, scopes: dict | None = None) -> dict[str, list[
|
||||
def script_owners(snap: Snapshot, owners) -> dict[str, tuple[str, str]]:
|
||||
"""Script scope -> (method owner, provenance) for one binary.
|
||||
|
||||
`runner_map` (CMC_RunnerFactory, Piklib 7.1+/BlooMoo) is the engine's own dispatch table and
|
||||
wins: several types can share a runner (INTEGER/STRING/... -> Variable). Without it (Piklib
|
||||
6.1, plugins, older extractions) the C++ class or its name is the best available guess."""
|
||||
`runner_map` (CMC_RunnerFactory, Piklib 7.1+/BlooMoo; a scene module's types and the runner
|
||||
their objects install) is the engine's own dispatch table and wins: several types can share
|
||||
a runner (INTEGER/STRING/... -> Variable). Without it (Piklib 6.1, older extractions) the C++
|
||||
class or its name is the best available guess."""
|
||||
runner_map = snap.raw.get("runner_map") or {}
|
||||
by_type_id = {e["type_id"]: e["runner"].removesuffix("_Runner") for e in runner_map.get("by_type_id", [])}
|
||||
dispatched = "module" if runner_map.get("module") else "runner_factory" # a scene module's own resolve
|
||||
class_runner = {e["class"]: e["runner"].removesuffix("_Runner") for e in runner_map.get("by_class", [])}
|
||||
bases = {e["class"]: e["base_class"] for e in snap.field_inheritance}
|
||||
known_classes = set(class_runner) | set(bases) | set(bases.values())
|
||||
@@ -359,7 +361,7 @@ def script_owners(snap: Snapshot, owners) -> dict[str, tuple[str, str]]:
|
||||
for t in snap.types:
|
||||
name = canonical(t["script_name"])
|
||||
if t.get("type_id") in by_type_id:
|
||||
mappings[name] = (by_type_id[t["type_id"]], "runner_factory")
|
||||
mappings[name] = (by_type_id[t["type_id"]], dispatched)
|
||||
continue
|
||||
owner, mapping = t.get("cpp_class"), "explicit"
|
||||
# Known extractor failure: unrelated factory entries all mapped to Behaviour.
|
||||
|
||||
Reference in New Issue
Block a user