Repository navigation
feat(il2cpp): link generic method instances behind --generic-instances - #5785
Conversation
…c names Generic container indices and records are demand readers on the same metadata snapshot, so links that do not ask for generic instances allocate nothing. Type rendering keeps one graph walk with its workspace, depth and cycle guards; the C#-like names and the Il2CppDumper GetMethodSpecName names are two styles over it.
…pt issues generic_instances links every genericMethodTable row through methodSpecs, genericInsts and genericMethodPointers, choosing the one CodeRegistration layout whose counts bound every row. The table is reserved against the report budget before any row is resolved; rows and issues are admitted before retention, and a contradicting row stays unknown with an address-backed issue instead of failing the link. Views page the rows by definition, state, address and name, unrequested and historical collections stay unknown, and Ghidra seeds fold instances after the definitions.
A method spec that contradicted the metadata still reported its pointer slot as code, while the schema and provider limitation promised unknown. Such rows now keep no address, every issue carries its genericMethodTable row, the domain validator requires unknown exactly on issued rows, and shared specs name one other row instead of all of them. The row-size lower bound moves to the metadata admission owner, the hex helper is shared, and budget wording says checked rather than reserved.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge based on the reviewed changes. SummaryAdds opt-in generic method linking through
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Metadata and native binary] --> B{Generic instances requested?}
B -- No --> C[Keep new fields null]
B -- Yes --> D[Choose one supported registration layout]
D --> E[Read method specs and arguments]
E --> F[Name each instance and read its code slot]
F --> G[Code, no body, or unknown with an issue]
G --> H[Complete Evidence and paged views]
G --> I[Append linked instances to Ghidra seeds]
Reviews (5) · Last reviewed commit: "fix(il2cpp): report generic entries past..." · Reviewed by Greptile |
…d arguments Layout selection no longer requires every genericMethodPointers slot to be mapped; each row reads its own slot, so one unmapped slot leaves only that row unknown with an issue. Method specs whose class or method argument count differs from the owner's declared generic container are issued and unnamed. Fixtures now declare the containers their generic rows fill.
…summaries Summaries keep generic_methods without its issues and count them in counts.generic_method_issues; the generic_method_issues collection pages them by rows, indices and fields, as code_gen_modules already does. Docs also name the method_indices filter the request schema accepts.
Comments Outside DiffThese findings could not be posted inline.
|
…ers on demand Generic argument arrays may span adjacent loader ranges: admit them with hasPointerArrayCoverage and read each slot through readPointer, instead of requiring the whole array in one mapping. Method generic container indices are read on demand from the method record, like type containers, so no link path allocates a per-method column. An owner whose container index is out of range now leaves the method spec unnamed with an issue instead of naming it unchecked.
|
Thanks, this was right: |
A damaged methodSpecs or genericMethodPointers pointer could make a spec or slot address exceed 64 bits. The issue kept that address, which the address schema rejects, so inspection failed instead of leaving the row unknown. Check the entry range first and attach the issue to the genericMethodTable row (or its slot field).
…-instances # Conflicts: # docs/il2cpp-metadata.md # src/cli/il2cppCommands.ts # src/contracts/analysisViewToolContracts.ts # src/il2cpp/Il2cppBinaryTypes.ts # tests/acceptance/il2cppMetadataCli.test.ts # tests/boundary/il2cpp/il2cppBinaryFile.test.ts # tests/boundary/il2cpp/il2cppMetadataProvider.test.ts # tests/fixtures/il2cpp/binary.ts # tests/fixtures/il2cpp/metadata.ts
The merge commit's lint-staged run rewrote these two main files: oxlint --fix dropped the escape in [+\-], which is invalid under the RegExp v flag.
|
Heads-up: my merge of main here ran lint-staged, and |
…nce/5785-generic-instances-20261024
…nce/5785-generic-instances-20261024
|
Final head Local integration with merged IPS and both feature branches ( |
Adds opt-in
generic_instances/--generic-instancesto link IL2CPP generic method instances through the existing static native reader, expose instance/issue views, and include valid instances in existing Ghidra seeds. Metadata 27/29/31 with static registration is supported; unsupported layouts remain typed failures. No target executes and no new provider is introduced. Related #3607; follow-up to #5112/#5327.The contributor's review fixes keep issue arrays out of summaries and read generic containers on demand. Maintenance verification also found and corrected an unreadable method-spec index becoming
-1: unreadable is nownull, a recorded-1stays recorded, and named rows/method filters preserve that distinction. The author's later cleanup commit is incorporated, along with main98ec00f4068bab894639d0d1d83ac0bfc428bcbf.Validation: all 285 selected registration/metadata/ownership/view/CLI/actual-stdio-MCP checks pass, plus check:fast, full format:check and docs:check. Twelve completed MCP query tasks preserve requested facts and artifact identities and validate SDK-converted schemas. Paging adds calls, CPU and memory; its whole-RPC estimate rises 0.59% for a small report and falls only 0.75% for a long-name report. These are payload token estimates, not billed tokens or measured model context. Exact pins, ranges, cold/warm scope, full-catalog costs and exclusions are in the verification report.
Real Unity verification remains contributor-reported on two private Android arm64 version-31 builds; this maintenance run did not reproduce the Il2CppDumper comparison, whose version was not recorded. Authored boundary fixtures do not establish real Unity dispatch, metadata-27/29 production behavior or a real Ghidra seed import. The original human-readiness declarations are preserved below.
Author readiness
Human owner: @8rulerstar
Before merge
type(scope): outcome.Thanks for taking a look.