Rework the scene manager around measured Unity builds
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13
- Forks
- 16
- Avg merge
- 16d 9h
- Merged PRs (30d)
- 15
Description
### Summary
The scene manager has one set of offsets for x64 and one for x86, plus one signature each to find it. That stopped working on newer Unity versions:
- On Unity 6000.2 and up, the signature doesn't match anything, so `attach` fails.
- On 6000.0 and 6000.1 it still attaches, but the offsets are wrong, so the root walk fails (#162). The offsets moved on 2023.1 and again on 6000.2, 6000.3 and 6000.5.
- `Scene::path` always reads through a pointer. From 2021 on x64, short paths are stored inline.
- The managed object of a component takes two reads from 2023.1 on. We do one.
- `scenes` reads the wrong array. `m_Scenes` is at 0x8, not 0x28.
- Roots come out in reverse order (#133 saw this too).
### Plan
Same as the IL2CPP builds in #160. One entry per measured player, keyed by Unity version and pointer size. A player takes the nearest entry at or below its version. Each entry has its signature, its path and reference shapes, and its offsets. The numbers come from the player's own code, using the function names from its PDB, and get checked live. Linux and Mac stay as they are until measured.
### Breaking changes
`get_class` compares class names with a fixed Mono name offset. It should take the `mono::Module` or `il2cpp::Module` instead.
### Notes
#133 touches this module too. I'll branch off master for now and rebase if it gets merged first.
- [ ] #165
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 the scene manager and compare its design with the IL2CPP builds in #160, then review the measured Unity player data described here. Check the attach signature, version and pointer-size selection, path and reference shapes, scene array, and root ordering; done means the listed Unity versions work with live checks while Linux and Mac remain unchanged. Review the get_class callers around mono::Module and il2cpp::Module before applying the breaking API change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, unity
- Domain
- game-dev, tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100