[PR #7261] feat(il2cpp): link version 24 generic method instances #7755

Open
opened 2026-11-03 13:40:10 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7261
Author: @ArjenS-LA
Created: 10/26/2026
Status: 🔄 Open

Base: main ← Head: feat/il2cpp-v24-generics


📝 Commits (2)

  • d1f927e feat(il2cpp): link version 24 generic method instances
  • a35e5c3 chore(il2cpp): merge main to restore PR validation

📊 Changes

7 files changed (+273 additions, -92 deletions)

View changed files

📝 docs/il2cpp-metadata.md (+20 -7)
➕ docs/verification/il2cpp-v24-generics-2026-10-26.md (+87 -0)
📝 src/il2cpp/Il2cppBinaryGenerics.ts (+12 -5)
📝 src/il2cpp/Il2cppMetadataProvider.ts (+1 -1)
📝 tests/acceptance/il2cppMetadataCli.test.ts (+70 -53)
📝 tests/boundary/il2cpp/il2cppBinaryFile.test.ts (+71 -21)
📝 tests/fixtures/il2cpp/binary.ts (+12 -5)

📄 Description

Summary

Enable generic-method linking for admitted IL2CPP version-24 metadata. Previously, --generic-instances rejected these inputs even though metadata decoding and legacy generic-class naming were already supported.

No linked issue; this is a focused follow-up to the documented version-24 limitation.

Problem and expected behavior

A public Unity 2019.4.34f1 Windows build decodes successfully but fails generic linking with generic-methods-unsupported on base f6805e29c. With this change, CLI and MCP expose 13,902 generic rows: 13,852 code, 50 observed zero slots, zero unknowns and zero issues.

Change and scope

Admit the 24.2, 24.3/24.4 and 24.5 CodeRegistration candidates (module offsets 96/112/120, row strides 12/12/16) in the existing linker. Exactly one layout must agree; missing or ambiguous registrations still fail. Earlier 24.x metadata formats remain unsupported.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Il2cppBinaryGenerics registration selection; the existing metadata/type readers continue owning generic containers and legacy definition indices.
  • Contribution scope fit and linked maintainer decision: not applicable; extends the existing static, read-only IL2CPP capability.
  • CLI and MCP/tool-catalog contract: unchanged schemas; version-24 generic rows now available through existing options and Ghidra seed export.
  • Provider, target-format, platform compatibility: existing admitted metadata and binary formats; real verification is Windows x64, fixtures also exercise ELF.
  • Evidence/artifact/provenance: unchanged identities, uncertainty and retained-result semantics.
  • Target selection, authority and cleanup: caller-selected files; no target execution or new authority.
  • Generated metadata, package or installation impact: none.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration. Existing explicit Ghidra seed export writes a caller-selected output file.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Three new layout tests fail on the unchanged producer, then pass with this change.
  • Fixtures cover legacy definition indices with nonzero padding, generic arguments, incompatible and ambiguous registrations, empty tables, CLI/MCP agreement and shared-address seed handling.
  • All 13,852 emitted code rows match Il2CppDumper 6.7.46 by exact name and numeric RVA. The real stdio MCP summary and retained first/last rows agree with CLI.
  • Verification report records pinned public inputs, hashes, reproduction steps and limitations.
  • Remaining proof gaps: real-build coverage is 24.5 only; 24.2 and 24.3/24.4 have fixture coverage. No Ghidra import, live Unity execution or exhaustive runtime-instance enumeration claimed. Lifecycle behavior is unchanged.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Current branch validation (2026-11-02)

Merged upstream main 4b961e3715375971aee6dec848827c9c072d947b into the existing branch in a35e5c399e2d3412d1b2a96f76d7b544957576b6. The merge is conflict-free and preserves the seven-file IL2CPP change. Upstream already fixes both failures from the original CI run: formatting in scripts/verify-apk-signature.mjs and inconsistent text/structured fixture data in packageCatalogVerification.test.ts.

Windows x64, pinned Node 24.22.1 and npm 11.16.0:

  • Focused tests: all six IL2CPP test files listed below plus tests/boundary/mcp/packageCatalogVerification.test.ts — 291 passed, 2 platform skips. Preparation rebuilt the runtime and packaged skill.
  • npm run check:ci:fast and npm run format:check — passed, including typecheck, lint and module boundaries; lint retains existing warnings.
  • npm run docs:check — passed, including 9 consistency tests. Native Windows artifact verification and normal pre-push check:fast also passed.
  • Fresh CI run is pending; no current full-CI pass is claimed. The real Unity/Il2CppDumper comparison below was not repeated for this maintenance merge.

Original implementation validation (2026-10-26)

Windows x64, Node 24.22.1; final focused/static checks use pinned npm 11.16.0.

  • npm run build:cached — passed.
  • npm run test:focused -- tests/boundary/il2cpp/il2cppBinaryFile.test.ts tests/boundary/il2cpp/il2cppMetadataFile.test.ts tests/boundary/il2cpp/il2cppMetadataProvider.test.ts tests/boundary/il2cpp/il2cppGhidraSeeds.test.ts tests/boundary/il2cpp/il2cppMappingOwnership.test.ts tests/acceptance/il2cppMetadataCli.test.ts — 282 passed, 2 existing Windows skips.
  • npm run docs:check — passed, including 9 consistency tests.
  • npm run typecheck, npm run verify:architecture-guards, npm run knip:production, npm run lint:typed — each passed; typed lint reports existing warnings.
  • node scripts/verify-test-discovery.mjs — passed, 2,567 files assigned exactly once.
  • node scripts/verify-windows-native-artifact.mjs — passed for the matching published 6.8.0 artifact.
  • Commit hook and pre-push npm run check:fast — passed.
  • npm run check — blocked by unrelated unused export isToolFamilyId at src/contracts/toolFamilies.ts:54. Running Knip on an untouched checkout of the base reproduced that unused-export finding; that unbuilt checkout additionally reported two missing generated worker imports. No unrelated source changes made.

Compatibility, safety, and release

  • Breaking changes or migration: none.
  • Real provider/OS coverage: static public Windows x64 Unity build through CLI and stdio MCP; no real Ghidra/Hopper run.
  • Package/release metadata: none.
  • Security/process review: static file parsing; target DLL was never loaded or executed. Existing admission bounds and explicit unknown outcomes remain.

Author readiness

Human owner: @ArjenS-LA

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/7261 **Author:** [@ArjenS-LA](https://github.com/ArjenS-LA) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/il2cpp-v24-generics` --- ### 📝 Commits (2) - [`d1f927e`](https://github.com/morluto/rea/commit/d1f927e2f65bce6d5de4dd97fa1ecc2b92ef1156) feat(il2cpp): link version 24 generic method instances - [`a35e5c3`](https://github.com/morluto/rea/commit/a35e5c399e2d3412d1b2a96f76d7b544957576b6) chore(il2cpp): merge main to restore PR validation ### 📊 Changes **7 files changed** (+273 additions, -92 deletions) <details> <summary>View changed files</summary> 📝 `docs/il2cpp-metadata.md` (+20 -7) ➕ `docs/verification/il2cpp-v24-generics-2026-10-26.md` (+87 -0) 📝 `src/il2cpp/Il2cppBinaryGenerics.ts` (+12 -5) 📝 `src/il2cpp/Il2cppMetadataProvider.ts` (+1 -1) 📝 `tests/acceptance/il2cppMetadataCli.test.ts` (+70 -53) 📝 `tests/boundary/il2cpp/il2cppBinaryFile.test.ts` (+71 -21) 📝 `tests/fixtures/il2cpp/binary.ts` (+12 -5) </details> ### 📄 Description ## Summary Enable generic-method linking for admitted IL2CPP version-24 metadata. Previously, `--generic-instances` rejected these inputs even though metadata decoding and legacy generic-class naming were already supported. No linked issue; this is a focused follow-up to the documented version-24 limitation. ## Problem and expected behavior A public Unity 2019.4.34f1 Windows build decodes successfully but fails generic linking with `generic-methods-unsupported` on base `f6805e29c`. With this change, CLI and MCP expose 13,902 generic rows: 13,852 code, 50 observed zero slots, zero unknowns and zero issues. ## Change and scope Admit the 24.2, 24.3/24.4 and 24.5 CodeRegistration candidates (module offsets 96/112/120, row strides 12/12/16) in the existing linker. Exactly one layout must agree; missing or ambiguous registrations still fail. Earlier 24.x metadata formats remain unsupported. ## Contract and boundary impact - Semantic owner and earliest changed stage: `Il2cppBinaryGenerics` registration selection; the existing metadata/type readers continue owning generic containers and legacy definition indices. - Contribution scope fit and linked maintainer decision: not applicable; extends the existing static, read-only IL2CPP capability. - CLI and MCP/tool-catalog contract: unchanged schemas; version-24 generic rows now available through existing options and Ghidra seed export. - Provider, target-format, platform compatibility: existing admitted metadata and binary formats; real verification is Windows x64, fixtures also exercise ELF. - Evidence/artifact/provenance: unchanged identities, uncertainty and retained-result semantics. - Target selection, authority and cleanup: caller-selected files; no target execution or new authority. - Generated metadata, package or installation impact: none. Expected effects: - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [x] Change process memory, registers, files, or configuration. Existing explicit Ghidra seed export writes a caller-selected output file. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Three new layout tests fail on the unchanged producer, then pass with this change. - Fixtures cover legacy definition indices with nonzero padding, generic arguments, incompatible and ambiguous registrations, empty tables, CLI/MCP agreement and shared-address seed handling. - All 13,852 emitted code rows match Il2CppDumper 6.7.46 by exact name and numeric RVA. The real stdio MCP summary and retained first/last rows agree with CLI. - [Verification report](https://github.com/ArjenS-LA/rea/blob/feat/il2cpp-v24-generics/docs/verification/il2cpp-v24-generics-2026-10-26.md) records pinned public inputs, hashes, reproduction steps and limitations. - Remaining proof gaps: real-build coverage is 24.5 only; 24.2 and 24.3/24.4 have fixture coverage. No Ghidra import, live Unity execution or exhaustive runtime-instance enumeration claimed. Lifecycle behavior is unchanged. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Current branch validation (2026-11-02) Merged upstream main `4b961e3715375971aee6dec848827c9c072d947b` into the existing branch in `a35e5c399e2d3412d1b2a96f76d7b544957576b6`. The merge is conflict-free and preserves the seven-file IL2CPP change. Upstream already fixes both failures from the original CI run: formatting in `scripts/verify-apk-signature.mjs` and inconsistent text/structured fixture data in `packageCatalogVerification.test.ts`. Windows x64, pinned Node 24.22.1 and npm 11.16.0: - Focused tests: all six IL2CPP test files listed below plus `tests/boundary/mcp/packageCatalogVerification.test.ts` — **291 passed, 2 platform skips**. Preparation rebuilt the runtime and packaged skill. - `npm run check:ci:fast` and `npm run format:check` — passed, including typecheck, lint and module boundaries; lint retains existing warnings. - `npm run docs:check` — passed, including 9 consistency tests. Native Windows artifact verification and normal pre-push `check:fast` also passed. - [Fresh CI run](https://github.com/morluto/rea/actions/runs/41597578567) is pending; no current full-CI pass is claimed. The real Unity/Il2CppDumper comparison below was not repeated for this maintenance merge. ## Original implementation validation (2026-10-26) Windows x64, Node 24.22.1; final focused/static checks use pinned npm 11.16.0. - `npm run build:cached` — passed. - `npm run test:focused -- tests/boundary/il2cpp/il2cppBinaryFile.test.ts tests/boundary/il2cpp/il2cppMetadataFile.test.ts tests/boundary/il2cpp/il2cppMetadataProvider.test.ts tests/boundary/il2cpp/il2cppGhidraSeeds.test.ts tests/boundary/il2cpp/il2cppMappingOwnership.test.ts tests/acceptance/il2cppMetadataCli.test.ts` — 282 passed, 2 existing Windows skips. - `npm run docs:check` — passed, including 9 consistency tests. - `npm run typecheck`, `npm run verify:architecture-guards`, `npm run knip:production`, `npm run lint:typed` — each passed; typed lint reports existing warnings. - `node scripts/verify-test-discovery.mjs` — passed, 2,567 files assigned exactly once. - `node scripts/verify-windows-native-artifact.mjs` — passed for the matching published 6.8.0 artifact. - Commit hook and pre-push `npm run check:fast` — passed. - `npm run check` — blocked by unrelated unused export `isToolFamilyId` at `src/contracts/toolFamilies.ts:54`. Running Knip on an untouched checkout of the base reproduced that unused-export finding; that unbuilt checkout additionally reported two missing generated worker imports. No unrelated source changes made. ## Compatibility, safety, and release - Breaking changes or migration: none. - Real provider/OS coverage: static public Windows x64 Unity build through CLI and stdio MCP; no real Ghidra/Hopper run. - Package/release metadata: none. - Security/process review: static file parsing; target DLL was never loaded or executed. Existing admission bounds and explicit unknown outcomes remain. ## Author readiness Human owner: @ArjenS-LA - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7755
No description provided.