@@ -917,6 +917,8 @@ impl Offsets {
917
917
monovtable_vtable : 0x48 ,
918
918
monoclassfieldalignment : 0x20 ,
919
919
} ) ,
920
+ // 64-bit PE V2 matches Unity2019_4_2020_3_x64_PE_Offsets from
921
+ // https://github.com/hackf5/unityspy/blob/master/src/HackF5.UnitySpy/Offsets/MonoLibraryOffsets.cs#L49
920
922
Version :: V2 => Some ( & Self {
921
923
monoassembly_aname : 0x10 ,
922
924
monoassembly_image : 0x60 ,
@@ -960,6 +962,143 @@ impl Offsets {
960
962
monoclassfieldalignment : 0x20 ,
961
963
} ) ,
962
964
} ,
965
+ ( PointerSize :: Bit64 , BinaryFormat :: ELF ) => match version {
966
+ Version :: V1 => Some ( & Self {
967
+ monoassembly_aname : 0x10 ,
968
+ monoassembly_image : 0x58 ,
969
+ monoimage_class_cache : 0x3D0 ,
970
+ monointernalhashtable_table : 0x20 ,
971
+ monointernalhashtable_size : 0x18 ,
972
+ monoclassdef_next_class_cache : 0xF8 ,
973
+ monoclassdef_klass : 0x0 ,
974
+ monoclass_name : 0x40 ,
975
+ monoclass_name_space : 0x48 ,
976
+ monoclass_fields : 0xA0 ,
977
+ monoclassdef_field_count : 0x8C ,
978
+ monoclass_runtime_info : 0xF0 ,
979
+ monoclass_vtable_size : 0x18 , // MonoVtable.data
980
+ monoclass_parent : 0x28 ,
981
+ monoclassfield_name : 0x8 ,
982
+ monoclassfield_offset : 0x18 ,
983
+ monoclassruntimeinfo_domain_vtables : 0x8 ,
984
+ monovtable_vtable : 0x48 ,
985
+ monoclassfieldalignment : 0x20 ,
986
+ } ) ,
987
+ Version :: V1Cattrs => Some ( & Self {
988
+ monoassembly_aname : 0x10 ,
989
+ monoassembly_image : 0x58 ,
990
+ monoimage_class_cache : 0x3D0 ,
991
+ monointernalhashtable_table : 0x20 ,
992
+ monointernalhashtable_size : 0x18 ,
993
+ monoclassdef_next_class_cache : 0x100 ,
994
+ monoclassdef_klass : 0x0 ,
995
+ monoclass_name : 0x48 ,
996
+ monoclass_name_space : 0x50 ,
997
+ monoclass_fields : 0xA8 ,
998
+ monoclassdef_field_count : 0x94 ,
999
+ monoclass_runtime_info : 0xF8 ,
1000
+ monoclass_vtable_size : 0x18 , // MonoVtable.data
1001
+ monoclass_parent : 0x28 ,
1002
+ monoclassfield_name : 0x8 ,
1003
+ monoclassfield_offset : 0x18 ,
1004
+ monoclassruntimeinfo_domain_vtables : 0x8 ,
1005
+ monovtable_vtable : 0x48 ,
1006
+ monoclassfieldalignment : 0x20 ,
1007
+ } ) ,
1008
+ // 64-bit ELF V2 happens to match Unity2019_4_2020_3_x64_MachO_Offsets from
1009
+ // https://github.com/hackf5/unityspy/blob/master/src/HackF5.UnitySpy/Offsets/MonoLibraryOffsets.cs#L86
1010
+ Version :: V2 => Some ( & Self {
1011
+ monoassembly_aname : 0x10 ,
1012
+ monoassembly_image : 0x60 ,
1013
+ monoimage_class_cache : 0x4C0 ,
1014
+ monointernalhashtable_table : 0x20 ,
1015
+ monointernalhashtable_size : 0x18 ,
1016
+ monoclassdef_next_class_cache : 0x100 ,
1017
+ monoclassdef_klass : 0x0 ,
1018
+ monoclass_name : 0x40 ,
1019
+ monoclass_name_space : 0x48 ,
1020
+ monoclass_fields : 0x90 ,
1021
+ monoclassdef_field_count : 0xF8 ,
1022
+ monoclass_runtime_info : 0xC8 ,
1023
+ monoclass_vtable_size : 0x54 ,
1024
+ monoclass_parent : 0x28 ,
1025
+ monoclassfield_name : 0x8 ,
1026
+ monoclassfield_offset : 0x18 ,
1027
+ monoclassruntimeinfo_domain_vtables : 0x8 ,
1028
+ monovtable_vtable : 0x40 ,
1029
+ monoclassfieldalignment : 0x20 ,
1030
+ } ) ,
1031
+ _ => None ,
1032
+ } ,
1033
+ #[ cfg( feature = "alloc" ) ]
1034
+ ( PointerSize :: Bit64 , BinaryFormat :: MachO ) => match version {
1035
+ Version :: V1 => Some ( & Self {
1036
+ monoassembly_aname : 0x10 ,
1037
+ monoassembly_image : 0x58 ,
1038
+ monoimage_class_cache : 0x3D0 ,
1039
+ monointernalhashtable_table : 0x20 ,
1040
+ monointernalhashtable_size : 0x18 ,
1041
+ monoclassdef_next_class_cache : 0xF8 ,
1042
+ monoclassdef_klass : 0x0 ,
1043
+ monoclass_name : 0x40 ,
1044
+ monoclass_name_space : 0x48 ,
1045
+ monoclass_fields : 0xA0 ,
1046
+ monoclassdef_field_count : 0x8C ,
1047
+ monoclass_runtime_info : 0xF0 ,
1048
+ monoclass_vtable_size : 0x18 , // MonoVtable.data
1049
+ monoclass_parent : 0x28 ,
1050
+ monoclassfield_name : 0x8 ,
1051
+ monoclassfield_offset : 0x18 ,
1052
+ monoclassruntimeinfo_domain_vtables : 0x8 ,
1053
+ monovtable_vtable : 0x48 ,
1054
+ monoclassfieldalignment : 0x20 ,
1055
+ } ) ,
1056
+ Version :: V1Cattrs => Some ( & Self {
1057
+ monoassembly_aname : 0x10 ,
1058
+ monoassembly_image : 0x58 ,
1059
+ monoimage_class_cache : 0x3D0 ,
1060
+ monointernalhashtable_table : 0x20 ,
1061
+ monointernalhashtable_size : 0x18 ,
1062
+ monoclassdef_next_class_cache : 0x100 ,
1063
+ monoclassdef_klass : 0x0 ,
1064
+ monoclass_name : 0x48 ,
1065
+ monoclass_name_space : 0x50 ,
1066
+ monoclass_fields : 0xA8 ,
1067
+ monoclassdef_field_count : 0x94 ,
1068
+ monoclass_runtime_info : 0xF8 ,
1069
+ monoclass_vtable_size : 0x18 , // MonoVtable.data
1070
+ monoclass_parent : 0x28 ,
1071
+ monoclassfield_name : 0x8 ,
1072
+ monoclassfield_offset : 0x18 ,
1073
+ monoclassruntimeinfo_domain_vtables : 0x8 ,
1074
+ monovtable_vtable : 0x48 ,
1075
+ monoclassfieldalignment : 0x20 ,
1076
+ } ) ,
1077
+ // 64-bit MachO V2 matches Unity2019_4_2020_3_x64_MachO_Offsets from
1078
+ // https://github.com/hackf5/unityspy/blob/master/src/HackF5.UnitySpy/Offsets/MonoLibraryOffsets.cs#L86
1079
+ Version :: V2 => Some ( & Self {
1080
+ monoassembly_aname : 0x10 ,
1081
+ monoassembly_image : 0x60 ,
1082
+ monoimage_class_cache : 0x4C0 ,
1083
+ monointernalhashtable_table : 0x20 ,
1084
+ monointernalhashtable_size : 0x18 ,
1085
+ monoclassdef_next_class_cache : 0x100 ,
1086
+ monoclassdef_klass : 0x0 ,
1087
+ monoclass_name : 0x40 ,
1088
+ monoclass_name_space : 0x48 ,
1089
+ monoclass_fields : 0x90 ,
1090
+ monoclassdef_field_count : 0xF8 ,
1091
+ monoclass_runtime_info : 0xC8 ,
1092
+ monoclass_vtable_size : 0x54 ,
1093
+ monoclass_parent : 0x28 ,
1094
+ monoclassfield_name : 0x8 ,
1095
+ monoclassfield_offset : 0x18 ,
1096
+ monoclassruntimeinfo_domain_vtables : 0x8 ,
1097
+ monovtable_vtable : 0x40 ,
1098
+ monoclassfieldalignment : 0x20 ,
1099
+ } ) ,
1100
+ _ => None ,
1101
+ } ,
963
1102
( PointerSize :: Bit32 , BinaryFormat :: PE ) => match version {
964
1103
Version :: V1 => Some ( & Self {
965
1104
monoassembly_aname : 0x8 ,
@@ -1003,6 +1142,8 @@ impl Offsets {
1003
1142
monovtable_vtable : 0x28 ,
1004
1143
monoclassfieldalignment : 0x10 ,
1005
1144
} ) ,
1145
+ // 32-bit PE V2 matches Unity2018_4_10_x86_PE_Offsets from
1146
+ // https://github.com/hackf5/unityspy/blob/master/src/HackF5.UnitySpy/Offsets/MonoLibraryOffsets.cs#L12
1006
1147
Version :: V2 => Some ( & Self {
1007
1148
monoassembly_aname : 0x8 ,
1008
1149
monoassembly_image : 0x44 ,
0 commit comments