Skip to content

Commit

Permalink
Offsets for 64-bit MachO V1
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKnauth committed Nov 7, 2023
1 parent 22aff7d commit c05991f
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/game_engine/unity/mono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,26 @@ impl Offsets {
},
#[cfg(feature = "std")]
(true, BinaryFormat::MachO) => match version {
Version::V1 => panic!("MachO V1 not supported"),
Version::V1 => &Self {
monoassembly_aname: 0x10,
monoassembly_image: 0x58, // matches 64-bit PE V1
monoimage_class_cache: 0x3D0, // matches 64-bit PE V1
monointernalhashtable_table: 0x20,
monointernalhashtable_size: 0x18,
monoclassdef_next_class_cache: 0xF8, // 0x8 less than 64-bit PE V1
monoclassdef_klass: 0x0,
monoclass_name: 0x40, // 0x8 less than 64-bit PE V1
monoclass_fields: 0xA0, // 0x8 less than 64-bit PE V1
monoclassdef_field_count: 0x8C, // 0x8 less than 64-bit PE V1
monoclass_runtime_info: 0xF0, // 0x8 less than 64-bit PE V1
monoclass_vtable_size: 0x18, // MonoVtable.data
monoclass_parent: 0x28, // 0x8 less than 64-bit PE V1
monoclassfield_name: 0x8,
monoclassfield_offset: 0x18,
monoclassruntimeinfo_domain_vtables: 0x8,
monovtable_vtable: 0x0, // UNUSED for V1
monoclassfieldalignment: 0x20,
},
// 64-bit MachO V2 matches Unity2019_4_2020_3_x64_MachO_Offsets from
// https://github.com/hackf5/unityspy/blob/master/src/HackF5.UnitySpy/Offsets/MonoLibraryOffsets.cs#L86
Version::V2 => &Self {
Expand Down

0 comments on commit c05991f

Please sign in to comment.