@@ -992,6 +992,75 @@ impl Offsets {
992
992
monoclassfieldalignment : 0x20 ,
993
993
} ) ,
994
994
} ,
995
+ #[ cfg( feature = "alloc" ) ]
996
+ ( PointerSize :: Bit64 , BinaryFormat :: MachO ) => match version {
997
+ Version :: V1 => Some ( & Self {
998
+ monoassembly_aname : 0x10 ,
999
+ monoassembly_image : 0x58 ,
1000
+ monoimage_class_cache : 0x3D0 ,
1001
+ monointernalhashtable_table : 0x20 ,
1002
+ monointernalhashtable_size : 0x18 ,
1003
+ monoclassdef_next_class_cache : 0xF8 ,
1004
+ monoclassdef_klass : 0x0 ,
1005
+ monoclass_name : 0x40 ,
1006
+ monoclass_name_space : 0x48 ,
1007
+ monoclass_fields : 0xA0 ,
1008
+ monoclassdef_field_count : 0x8C ,
1009
+ monoclass_runtime_info : 0xF0 ,
1010
+ monoclass_vtable_size : 0x18 , // MonoVtable.data
1011
+ monoclass_parent : 0x28 ,
1012
+ monoclassfield_name : 0x8 ,
1013
+ monoclassfield_offset : 0x18 ,
1014
+ monoclassruntimeinfo_domain_vtables : 0x8 ,
1015
+ monovtable_vtable : 0x48 ,
1016
+ monoclassfieldalignment : 0x20 ,
1017
+ } ) ,
1018
+ Version :: V1Cattrs => Some ( & Self {
1019
+ monoassembly_aname : 0x10 ,
1020
+ monoassembly_image : 0x58 ,
1021
+ monoimage_class_cache : 0x3D0 ,
1022
+ monointernalhashtable_table : 0x20 ,
1023
+ monointernalhashtable_size : 0x18 ,
1024
+ monoclassdef_next_class_cache : 0x100 ,
1025
+ monoclassdef_klass : 0x0 ,
1026
+ monoclass_name : 0x48 ,
1027
+ monoclass_name_space : 0x50 ,
1028
+ monoclass_fields : 0xA8 ,
1029
+ monoclassdef_field_count : 0x94 ,
1030
+ monoclass_runtime_info : 0xF8 ,
1031
+ monoclass_vtable_size : 0x18 , // MonoVtable.data
1032
+ monoclass_parent : 0x28 ,
1033
+ monoclassfield_name : 0x8 ,
1034
+ monoclassfield_offset : 0x18 ,
1035
+ monoclassruntimeinfo_domain_vtables : 0x8 ,
1036
+ monovtable_vtable : 0x48 ,
1037
+ monoclassfieldalignment : 0x20 ,
1038
+ } ) ,
1039
+ // 64-bit MachO V2 matches Unity2019_4_2020_3_x64_MachO_Offsets from
1040
+ // https://github.com/hackf5/unityspy/blob/master/src/HackF5.UnitySpy/Offsets/MonoLibraryOffsets.cs#L86
1041
+ Version :: V2 => Some ( & Self {
1042
+ monoassembly_aname : 0x10 ,
1043
+ monoassembly_image : 0x60 ,
1044
+ monoimage_class_cache : 0x4C0 ,
1045
+ monointernalhashtable_table : 0x20 ,
1046
+ monointernalhashtable_size : 0x18 ,
1047
+ monoclassdef_next_class_cache : 0x100 ,
1048
+ monoclassdef_klass : 0x0 ,
1049
+ monoclass_name : 0x40 ,
1050
+ monoclass_name_space : 0x48 ,
1051
+ monoclass_fields : 0x90 ,
1052
+ monoclassdef_field_count : 0xF8 ,
1053
+ monoclass_runtime_info : 0xC8 ,
1054
+ monoclass_vtable_size : 0x54 ,
1055
+ monoclass_parent : 0x28 ,
1056
+ monoclassfield_name : 0x8 ,
1057
+ monoclassfield_offset : 0x18 ,
1058
+ monoclassruntimeinfo_domain_vtables : 0x8 ,
1059
+ monovtable_vtable : 0x40 ,
1060
+ monoclassfieldalignment : 0x20 ,
1061
+ } ) ,
1062
+ _ => None ,
1063
+ } ,
995
1064
( PointerSize :: Bit32 , BinaryFormat :: PE ) => match version {
996
1065
Version :: V1 => Some ( & Self {
997
1066
monoassembly_aname : 0x8 ,
0 commit comments