Skip to content

Add measured offsets for known IL2CPP builds - #144

Open
ero-qt wants to merge 10 commits into
LiveSplit:masterfrom
ero-qt:il2cpp-builds
Open

Add measured offsets for known IL2CPP builds#144
ero-qt wants to merge 10 commits into
LiveSplit:masterfrom
ero-qt:il2cpp-builds

Conversation

@ero-qt

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

Copy link
Copy Markdown

Depends on #142.

attach_auto_detect now checks what the game actually is before guessing: it reads the version of the mapped global-metadata.dat (the file's magic sits at the start of a memory range, so this is one small read per range) and the Unity version from UnityPlayer. If that matches a known build, we attach with its measured offsets and skip version detection entirely. If not, everything falls back to the existing detection, unchanged. attach(version) stays as it is. On a successful attach, a log line says which build it found, or that it found none.

GameAssembly.dll is unique per game, so we can't pin offsets to one exact binary like we can for Mono. Instead, each build says which metadata and Unity version it applies from, and the lookup picks the newest one at or below the game's. If the game is older than everything we've measured, the lookup just doesn't answer. There are 16 builds in the table, Unity 2018.4 through 6000.7, both pointer sizes, all measured from players' own GameAssembly.pdbs and cross-checked against the editor's il2cpp headers.

Two things fell out of the measured data. Unity 2023.x didn't match any arm of the version detection and silently got the oldest layout, which one token fixes. And 6000.5 moved Il2CppClass::static_fields to 0xA0, then 6000.7 moved it again to 0x98, so static field reads on those games currently go to the wrong place. The entries carry the measured values.

Also fixes a field name typo and reads assembly names through the image when a build's offsets know where that is.

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.

1 participant