Rework the Mono and IL2CPP support around per-build offset profiles
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13
- Forks
- 16
- Avg merge
- 16d 9h
- Merged PRs (30d)
- 15
Description
The Unity support currently guesses layouts: versions from `FileVersion` thresholds and memory string scans, offsets from four hand-kept eras per backend. A wrong guess is indistinguishable from "not loaded yet" and shows up as an infinite wait.
Some concrete problems:
- Unity 2023.x IL2CPP matches no arm of the version detection and falls back to `Version::Base`, the oldest layout.
- Mono version detection on ELF/Mach-O silently defaults to `V2` when its string scan misses.
- IL2CPP attaches on Windows x64 only; nothing below `UnityPointer` caches; no nested classes or generic instances.
The plan:
- Identify instead of guessing: Mono by the runtime binary's identity (PE debug GUID, ELF build-id, Mach-O UUID), IL2CPP by (Unity version, pointer size), since `GameAssembly.dll` is compiled per game and has no identity of its own.
- Offsets become data: per-build profiles generated offline from Unity's own symbols, compiled into static tables. Supporting a new build is a data drop, not new code.
- One shared metadata walk over both runtimes, with a small set of per-runtime operations for where they genuinely diverge.
- Unknown Mono binaries fail loud with what was read instead of attaching with a neighbour's offsets. An unmeasured IL2CPP player takes the nearest measured build, which replaces the version tables (#160).
`Module::attach(process, version)` stays on the Mono side for now; #160 removes it on the IL2CPP side with the tables. Follow-ups are tracked separately: managed string and collection reads in #149, Linux and Mac Mono builds in #154, the scene manager and time manager rework and engine-shared extraction later.
## PRs
In order, each building on the ones before it; every body says what it depends on. #160 stands alone on master.
- [x] #142
- [x] #143
- [x] #144
- [x] #160
- [ ] #163
- [x] #145
- [x] #146
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Module::attach(process, version), the UnityPointer support, and the dependency order listed for PRs #142–#146 and #160–#163. Read the existing Mono and IL2CPP version and offset handling before assessing the shared metadata walk and per-build profile tables. Done means runtime identity or Unity version and pointer size select profiles, unknown Mono binaries fail loudly, and unmeasured IL2CPP builds use the nearest measured build.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, unity
- Domain
- devtools, game-dev
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100