Closed AlexKnauth closed 9 months ago
If I can reduce the size and complexity of asr/src/game_engine/unity/mono.rs
by moving some of the PE-specific code there into asr/src/file_format/pe.rs
, should I include that in this PR to add Mac support?
In this PR, I'm already trying to put the MachO-specific code that mono.rs
needs into a macho.rs
file next to pe.rs
, so it seems related. Or should I submit a separate PR now, submit a separate PR later to avoid potential merge conflicts, or just leave it as-is, not broken don't fix?
Edit: After #67, the pe::symbols
iterator greatly reduces the amount of PE-specific code there.
I have a version of this ready to rebase on top of https://github.com/LiveSplit/asr/pull/63 if/when that gets merged. It just requires another commit analogous to Fix assemblies_pointer vs assemblies
, but to fix SceneManager base_address
vs address
instead, here: https://github.com/AlexKnauth/asr/commit/ff298b7fca046cb4da2b34fb02226a07a4c502f5
I have a version of this ready to rebase on top of #71 if/when that gets merged.
Marking as a draft for now until the cattrs
stuff is figured out.
My hope is that some of the differences in offsets I found might turn out to turn out to melt away into differences between cattrs and no-cattrs. If that's the case then it could simplify what's needed for Mac support by a lot.
(Edit: it didn't melt it away, or at least didn't melt most of it)
Closing in favor of https://github.com/LiveSplit/asr/pull/93
This adds Mac support to
asr::game_engine::unity::SceneManager
andasr::game_engine::unity::mono
.The
SceneManager
support does not rely onstd
, but themono
support does needstd
, which can be activated with thestd
feature.During development at
Image classes table detect cycles
, I got cycles in the classes iterator, which I had to detect and break. But atOffsets for 64-bit MachO V2
, I found the cause of those cycles was the wrong offset formonoclassdef_next_class_cache
. It should have been using0x100
as the offset to that, but had been incorrectly using0x108
as the offset.