Skip to content

Add measured offsets for known IL2CPP builds - #144

Merged
CryZe merged 12 commits into
LiveSplit:masterfrom
ero-qt:il2cpp-builds
Sep 14, 2026
Merged

CryZe merged 12 commits into
LiveSplit:masterfrom
ero-qt:il2cpp-builds

Conversation

@ero-qt

@ero-qt ero-qt commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Part of #141.

Adds a table of 22 measured IL2CPP players and attaches with a player's own offsets when a game runs exactly that Unity version at that width. Anything else falls back to version detection like before. attach(version) is unchanged.

  • The key is the metadata version, all four parts of UnityPlayer.dll's file version, and the width. Exact match only, so f1 and f2 are different players.
  • 11 Unity versions from 2018.4 to 6000.7, x64 and x86, every entry read from that player's GameAssembly.pdb.
  • The metadata file gets mapped after GameAssembly.dll, so a game on a measured player waits for it instead of attaching with the version table and keeping that.
  • Attach gets an x86 scanner, picked by pointer size. Checked against the 11 x86 players in the corpus with their PDBs, all resolve. The corpus is one toolchain at the default Release configuration, so that's the scope of the check.
  • Unity 2023.x didn't match any arm of the version detection and got the oldest layout. One token fixes that.
  • 6000.5 moves Il2CppClass::static_fields to 0xA0 and 6000.7 to 0x98. The entries carry the measured values.
  • Assembly names are read through the image when a build's offsets say so. A field name typo is fixed. The mock host can look up modules now, so tests run attach_auto_detect end to end.

The existing x64 scanner fails on every 6000.3+ player in the corpus, because 6000.3 changed the count the table store follows. That's master's scanner and gets its own issue, so x64 games on those versions don't attach until then.

cargo test --all-features runs the suite. The new tests go through attach_auto_detect for a measured player, an unmeasured one, one without its metadata yet, and one whose metadata disagrees, plus the lookup, the x86 scanner shapes and bounds, and the statics divergence against the version table.

Comment thread src/game_engine/unity/il2cpp/mod.rs Outdated
Comment thread src/game_engine/unity/il2cpp/builds.rs Outdated

@CryZe CryZe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rebased profile-first/fallback structure is clear and the x64 consumer build succeeds, but two correctness gaps need addressing before the table can safely select measured layouts: the advertised 32-bit profiles cannot pass the still-x64-only attachment scanner, and the unbounded/coarsened floor lookup classifies unmeasured past and future Unity builds as known profiles instead of falling back.

@CryZe CryZe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both requested changes are fully addressed. IL2CPP profiles now match exact metadata/full Unity-version/width identities and unknown players preserve the existing fallback. The x86 attach path has architecture-specific signatures, absolute operand decoding, bounds validation, corpus verification, and end-to-end tests. The Lunistice consumer builds against this head, and live tests exercised both the earlier measured-profile path and the corrected unknown-player classification. All checks pass.

@CryZe
CryZe merged commit b49e074 into LiveSplit:master Sep 14, 2026
7 checks passed
@ero-qt ero-qt changed the title Add measured offsets for known IL2CPP builds Attach IL2CPP games through measured builds Sep 14, 2026
@ero-qt ero-qt changed the title Attach IL2CPP games through measured builds Add measured offsets for known IL2CPP builds Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants