Skip to content

feat(il2cpp): read member names, string literals and metadata versions 24 and 27 - #5326

Merged
gensokyo-dev merged 4 commits into
morluto:mainfrom
8rulerstar:feat/il2cpp-members
Oct 20, 2026
Merged

gensokyo-dev merged 4 commits into
morluto:mainfrom
8rulerstar:feat/il2cpp-members

Conversation

@8rulerstar

@8rulerstar 8rulerstar commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Extends inspect_il2cpp_metadata with field, property, event and parameter names and owners, byte-preserving managed string literals, and the observed version24/27 layouts. An analyst can now find a method and request its parameters by method_indices without transferring the entire parameter table. MCP still defaults to a retained summary; full Evidence remains available through CLI/MCP.

Original implementation and cross-version investigation: @8rulerstar, commit 0c583ba61, retained in this branch. Follow-ups synchronize main 1417bf943: runtime changes at 90cab680e complete ownership, resource and compatibility boundaries; 84d1a2244 adds test coverage without changing production code. This is the metadata-only slice of #3784, preceding #5327/#5112 native-address work.

  • Parse owner ranges once in the owning type/method readers. Member projection consumes those facts; ownership assignment yields to cancellation. Shared format errors/range rules remove the File/Member runtime dependency cycle.
  • Admit all collection counts before allocation, text/base64 expansion before representation allocation and repeated strings before retaining each row. Decoding caches names/literal spans only within one stable snapshot. Keep exact final64MiB report admission,256MiB input admission, single-reader concurrency, cancellation reasons, failed-source Evidence and cleanup ownership.
  • Batch parameter-owner filters intersect names/indices and preserve metadata order, paging and mandatory source indices. Newly observed collections carry precise file ranges. A literal has one UTF-8/base64 representation; owner references must resolve within the report.
  • Historical Evidence remains queryable. Missing member collections have unknown/null counts; requesting them reports unavailable observations, instead of inventing empty inventories. Existing empty arrays remain zero.

Workflow and examples. Static caller-selected metadata only: no target execution, native registration, decryption, mutation or new dependencies/installers. Version24 coverage is the264-byte header layout used by the cited2019.4 sample; other24.x layouts are not guessed.

Executed validation

  • npm run check passed all6 static tasks and architecture guards at 90cab680e; typecheck/lint passed after the test-only review follow-up. 92 focused tests passed across file/provider/service/domain and public CLI/MCP boundaries, including actual SDK/AJV2020 advertised schemas. Docs generation/check and 5 README tests passed.
  • Regressions cover repeated long literals, pre-decode/base64 capacity, member-count admission before allocation, owner-loop yields, malformed/empty sentinels, invalid ownership/literal forms, batch filters and historical import after deleting the source. Existing malformed-input, cancellation, retry, cleanup, source identity and path coverage remains. The review follow-up adds nonempty property/event goldens with distinct owners for versions24/27/29/31 and version39 type widths1/2/4, plus public CLI/MCP pages.
  • Actual merge preview 853f78ede (main 052956af3 + head 84d1a2244, tree 5c7fe1011622014568096abc6c0c11b88071c7ba) passed all92 relevant tests again. Its real Windows SDK/MCP selected-owner task and full Evidence export also passed:6RPC,32,535 estimated used-declaration tokens,256,814 all-input tokens,10.30s wall,12.31s family CPU,1.019GiB sampled family RSS. This integration run includes newer main catalog changes and is separate from the paired measurements below.
  • Actual Windows x64 and Android arm64 artifacts from MIT-licensed Between Two Worlds1.0.5, Unity2023.2.13f1 / metadata29. Metadata SHA-256: Windows 5691bdd9161d054db69cc842397c7a42c6bf4a544060f05d741e99a6a3a07d29; Android 3814d666a9f83388a71d7ad7ffb67b2cdaf7f2fef5c48c021ddf43373cdad64e.
  • Final CLI facts equal the original-head facts, input hashes stayed unchanged, and all8 collections agree row-for-row with an independent adapter using Il2CppDumper6.7.46's Metadata API. Literal comparison uses strict UTF-8 or exact base64 bytes from reference-parsed spans. Zero mismatches on either artifact. This closes the previous field/event/parameter comparison gap on these two builds.
Real artifact Fields Properties Events Parameters Literals
Windows 30,149 10,399 137 51,080 9,358
Android 29,011 10,198 133 49,921 9,263

Images/types/methods also matched: Windows55/7,261/49,148, Android37/6,838/48,004. Original contributor-reported self-built24/27/31/39 verification remains credited; those real versions/platforms were not rerun here. Generated fixtures exercise supported layouts and malformed inputs, not real-engine qualification. Native-address/Ghidra claims belong to #5327.

Completed-task measurements

Runtime revision90cab680e: context, latency, CPU and memory

Task: read all130 fields of IngameDebugConsole.DebugLogManager and all3 parameters of ReceivedLog (logString, stackTrace, logType), retaining source-scoped row indices and exporting complete Evidence. The old API requires a512-row parameter scan; the new owner selector answers directly. Both delivery variants below use runtime revision 90cab680e, identical files/facts/coverage and Evidence access. The later review commit changes only three test files; production code is identical. Alternating real variants were run in both orders.

Tokenx estimates include used input declarations, arguments, full replies and extra RPCs. The all-declarations counter and whole-wire artifacts include catalog costs; actual model usage/rendering/tool-selection/compaction is unmeasured. Small input is the source-defined fixture, not a real-provider claim.

Task / delivery RPCs Used-declaration tokens All-input-declaration tokens Wall s Family CPU s Sampled family RSS GiB
Small / paged scan 6 26,275 250,554 15.69 14.05 0.880
Small / method filter 6 26,322 250,601 9.78 9.79 0.859
Real / paged scan 1 105 2,152,472 2,376,751 23.31 22.91 2.811
Real / method filter 1 6 32,544 256,823 15.44 13.76 1.051
Real / method filter 2 6 32,544 256,823 11.19 12.23 1.020
Real / paged scan 2 105 2,152,472 2,376,751 18.08 22.07 2.093

Original implementation at 5e233013f: real task105RPC /2,152,408 used-declaration tokens /2,376,687 all-input tokens /14.64s wall /19.77s CPU /3.029GiB sampledRSS. Admission and validation add work; no general decoder speedup is claimed. The primary benefit comes from avoiding unnecessary transfer and repeated queries. Small inputs incur47 extra estimated tokens for explicit selection; latency varies with host load.

Whole harness includes client/catalog/schema validation, initial full decoding, projection, export and teardown. Separate retained-field reads: [24.68, 27.92, 22.11] ms; probes are excluded from primary counters. The complete parent is immutable and reused without re-reading the source.

Linux/Node24.18,2CPU affinity,3GiB V8 heaps,8GiB family stop guard; no guard stops/OOM/retries in measured tasks. RSS sampled20ms across the process family may double-count shared pages or miss short peaks. Runtime caches fresh, OS caches/host load uncontrolled. Engine-only costs unmeasured. The64MiB encoded-report budget is not a total-RSS bound. Reference tools/SDK lived in private verification directories and were not added to REA.

Expected effects:

  • Read existing files or captured data.
  • Change files: only caller-requested exclusive CLI Evidence output.

Author readiness

Human owner: @gensokyo-dev

Original contribution: @8rulerstar.

The human owner explicitly authorized this work, delegated technical review and validation to Codex, directed these declarations on their behalf, and requested ready-for-review submission and normal merge. This records that direction; it does not assert an independent human review of the follow-up or that the original contributor reviewed these later commits.

  • 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.

…s 24 and 27

Adds field, property, event and parameter names with their owners, managed string literals, and the version 24 and 27 header layouts to inspect_il2cpp_metadata, with filtered pages for the new collections. Member decoding yields between row batches like the other row readers.
@gensokyo-dev
gensokyo-dev marked this pull request as ready for review October 20, 2026 10:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T11:14:33.394571Z 84d1a22 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous test gap is addressed and no new blocking issue was found.

Summary

Extends IL2CPP metadata inspection with member names, owners, string literals and version 24/27 layouts.

  • Metadata reports now include member names and literals across more Unity versions.
  • Retained metadata can be queried by collection and method owner.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  File["Selected metadata file"] --> Decode["Check layout and decode rows"]
  Decode --> Evidence["Retain complete Evidence"]
  Evidence --> Summary["Return counts"]
  Evidence --> Pages["Filter and page original rows"]
Loading

Reviews (2) · Last reviewed commit: "test(il2cpp): cover nonempty property an..." · Reviewed by Greptile

@gensokyo-dev
gensokyo-dev merged commit 21e0c58 into morluto:main Oct 20, 2026
46 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 20, 2026
3 tasks done
kangyishuai pushed a commit to kangyishuai/rea that referenced this pull request Oct 20, 2026
…ansition-view

Resolve the inspect_analysis_view description conflict with main's
IL2CPP member and string-literal change (morluto#5326). The description keeps
main's text and adds this branch's capture_browser_scenario additions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@8rulerstar
8rulerstar deleted the feat/il2cpp-members branch October 30, 2026 00:08
@morluto morluto added enhancement New feature or request provider: il2cpp Analysis provider / engine: il2cpp labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request provider: il2cpp Analysis provider / engine: il2cpp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants