Skip to content

Commit c05991f

Browse files
committed
Offsets for 64-bit MachO V1
1 parent 22aff7d commit c05991f

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/game_engine/unity/mono.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,26 @@ impl Offsets {
867867
},
868868
#[cfg(feature = "std")]
869869
(true, BinaryFormat::MachO) => match version {
870-
Version::V1 => panic!("MachO V1 not supported"),
870+
Version::V1 => &Self {
871+
monoassembly_aname: 0x10,
872+
monoassembly_image: 0x58, // matches 64-bit PE V1
873+
monoimage_class_cache: 0x3D0, // matches 64-bit PE V1
874+
monointernalhashtable_table: 0x20,
875+
monointernalhashtable_size: 0x18,
876+
monoclassdef_next_class_cache: 0xF8, // 0x8 less than 64-bit PE V1
877+
monoclassdef_klass: 0x0,
878+
monoclass_name: 0x40, // 0x8 less than 64-bit PE V1
879+
monoclass_fields: 0xA0, // 0x8 less than 64-bit PE V1
880+
monoclassdef_field_count: 0x8C, // 0x8 less than 64-bit PE V1
881+
monoclass_runtime_info: 0xF0, // 0x8 less than 64-bit PE V1
882+
monoclass_vtable_size: 0x18, // MonoVtable.data
883+
monoclass_parent: 0x28, // 0x8 less than 64-bit PE V1
884+
monoclassfield_name: 0x8,
885+
monoclassfield_offset: 0x18,
886+
monoclassruntimeinfo_domain_vtables: 0x8,
887+
monovtable_vtable: 0x0, // UNUSED for V1
888+
monoclassfieldalignment: 0x20,
889+
},
871890
// 64-bit MachO V2 matches Unity2019_4_2020_3_x64_MachO_Offsets from
872891
// https://github.com/hackf5/unityspy/blob/master/src/HackF5.UnitySpy/Offsets/MonoLibraryOffsets.cs#L86
873892
Version::V2 => &Self {

0 commit comments

Comments
 (0)