@@ -857,6 +857,8 @@ impl Offsets {
857857 monovtable_vtable : 0x48 ,
858858 monoclassfieldalignment : 0x20 ,
859859 } ) ,
860+ // 64-bit PE V2 matches Unity2019_4_2020_3_x64_PE_Offsets from
861+ // https://github.com/hackf5/unityspy/blob/master/src/HackF5.UnitySpy/Offsets/MonoLibraryOffsets.cs#L49
860862 Version :: V2 => Some ( & Self {
861863 monoassembly_aname : 0x10 ,
862864 monoassembly_image : 0x60 ,
@@ -900,6 +902,143 @@ impl Offsets {
900902 monoclassfieldalignment : 0x20 ,
901903 } ) ,
902904 } ,
905+ ( PointerSize :: Bit64 , BinaryFormat :: ELF ) => match version {
906+ Version :: V1 => Some ( & Self {
907+ monoassembly_aname : 0x10 ,
908+ monoassembly_image : 0x58 ,
909+ monoimage_class_cache : 0x3D0 ,
910+ monointernalhashtable_table : 0x20 ,
911+ monointernalhashtable_size : 0x18 ,
912+ monoclassdef_next_class_cache : 0xF8 ,
913+ monoclassdef_klass : 0x0 ,
914+ monoclass_name : 0x40 ,
915+ monoclass_name_space : 0x48 ,
916+ monoclass_fields : 0xA0 ,
917+ monoclassdef_field_count : 0x8C ,
918+ monoclass_runtime_info : 0xF0 ,
919+ monoclass_vtable_size : 0x18 , // MonoVtable.data
920+ monoclass_parent : 0x28 ,
921+ monoclassfield_name : 0x8 ,
922+ monoclassfield_offset : 0x18 ,
923+ monoclassruntimeinfo_domain_vtables : 0x8 ,
924+ monovtable_vtable : 0x48 ,
925+ monoclassfieldalignment : 0x20 ,
926+ } ) ,
927+ Version :: V1Cattrs => Some ( & Self {
928+ monoassembly_aname : 0x10 ,
929+ monoassembly_image : 0x58 ,
930+ monoimage_class_cache : 0x3D0 ,
931+ monointernalhashtable_table : 0x20 ,
932+ monointernalhashtable_size : 0x18 ,
933+ monoclassdef_next_class_cache : 0x100 ,
934+ monoclassdef_klass : 0x0 ,
935+ monoclass_name : 0x48 ,
936+ monoclass_name_space : 0x50 ,
937+ monoclass_fields : 0xA8 ,
938+ monoclassdef_field_count : 0x94 ,
939+ monoclass_runtime_info : 0xF8 ,
940+ monoclass_vtable_size : 0x18 , // MonoVtable.data
941+ monoclass_parent : 0x28 ,
942+ monoclassfield_name : 0x8 ,
943+ monoclassfield_offset : 0x18 ,
944+ monoclassruntimeinfo_domain_vtables : 0x8 ,
945+ monovtable_vtable : 0x48 ,
946+ monoclassfieldalignment : 0x20 ,
947+ } ) ,
948+ // 64-bit ELF V2 happens to match Unity2019_4_2020_3_x64_MachO_Offsets from
949+ // https://github.com/hackf5/unityspy/blob/master/src/HackF5.UnitySpy/Offsets/MonoLibraryOffsets.cs#L86
950+ Version :: V2 => Some ( & Self {
951+ monoassembly_aname : 0x10 ,
952+ monoassembly_image : 0x60 ,
953+ monoimage_class_cache : 0x4C0 ,
954+ monointernalhashtable_table : 0x20 ,
955+ monointernalhashtable_size : 0x18 ,
956+ monoclassdef_next_class_cache : 0x100 ,
957+ monoclassdef_klass : 0x0 ,
958+ monoclass_name : 0x40 ,
959+ monoclass_name_space : 0x48 ,
960+ monoclass_fields : 0x90 ,
961+ monoclassdef_field_count : 0xF8 ,
962+ monoclass_runtime_info : 0xC8 ,
963+ monoclass_vtable_size : 0x54 ,
964+ monoclass_parent : 0x28 ,
965+ monoclassfield_name : 0x8 ,
966+ monoclassfield_offset : 0x18 ,
967+ monoclassruntimeinfo_domain_vtables : 0x8 ,
968+ monovtable_vtable : 0x40 ,
969+ monoclassfieldalignment : 0x20 ,
970+ } ) ,
971+ _ => None ,
972+ } ,
973+ #[ cfg( feature = "alloc" ) ]
974+ ( PointerSize :: Bit64 , BinaryFormat :: MachO ) => match version {
975+ Version :: V1 => Some ( & Self {
976+ monoassembly_aname : 0x10 ,
977+ monoassembly_image : 0x58 ,
978+ monoimage_class_cache : 0x3D0 ,
979+ monointernalhashtable_table : 0x20 ,
980+ monointernalhashtable_size : 0x18 ,
981+ monoclassdef_next_class_cache : 0xF8 ,
982+ monoclassdef_klass : 0x0 ,
983+ monoclass_name : 0x40 ,
984+ monoclass_name_space : 0x48 ,
985+ monoclass_fields : 0xA0 ,
986+ monoclassdef_field_count : 0x8C ,
987+ monoclass_runtime_info : 0xF0 ,
988+ monoclass_vtable_size : 0x18 , // MonoVtable.data
989+ monoclass_parent : 0x28 ,
990+ monoclassfield_name : 0x8 ,
991+ monoclassfield_offset : 0x18 ,
992+ monoclassruntimeinfo_domain_vtables : 0x8 ,
993+ monovtable_vtable : 0x48 ,
994+ monoclassfieldalignment : 0x20 ,
995+ } ) ,
996+ Version :: V1Cattrs => Some ( & Self {
997+ monoassembly_aname : 0x10 ,
998+ monoassembly_image : 0x58 ,
999+ monoimage_class_cache : 0x3D0 ,
1000+ monointernalhashtable_table : 0x20 ,
1001+ monointernalhashtable_size : 0x18 ,
1002+ monoclassdef_next_class_cache : 0x100 ,
1003+ monoclassdef_klass : 0x0 ,
1004+ monoclass_name : 0x48 ,
1005+ monoclass_name_space : 0x50 ,
1006+ monoclass_fields : 0xA8 ,
1007+ monoclassdef_field_count : 0x94 ,
1008+ monoclass_runtime_info : 0xF8 ,
1009+ monoclass_vtable_size : 0x18 , // MonoVtable.data
1010+ monoclass_parent : 0x28 ,
1011+ monoclassfield_name : 0x8 ,
1012+ monoclassfield_offset : 0x18 ,
1013+ monoclassruntimeinfo_domain_vtables : 0x8 ,
1014+ monovtable_vtable : 0x48 ,
1015+ monoclassfieldalignment : 0x20 ,
1016+ } ) ,
1017+ // 64-bit MachO V2 matches Unity2019_4_2020_3_x64_MachO_Offsets from
1018+ // https://github.com/hackf5/unityspy/blob/master/src/HackF5.UnitySpy/Offsets/MonoLibraryOffsets.cs#L86
1019+ Version :: V2 => Some ( & Self {
1020+ monoassembly_aname : 0x10 ,
1021+ monoassembly_image : 0x60 ,
1022+ monoimage_class_cache : 0x4C0 ,
1023+ monointernalhashtable_table : 0x20 ,
1024+ monointernalhashtable_size : 0x18 ,
1025+ monoclassdef_next_class_cache : 0x100 ,
1026+ monoclassdef_klass : 0x0 ,
1027+ monoclass_name : 0x40 ,
1028+ monoclass_name_space : 0x48 ,
1029+ monoclass_fields : 0x90 ,
1030+ monoclassdef_field_count : 0xF8 ,
1031+ monoclass_runtime_info : 0xC8 ,
1032+ monoclass_vtable_size : 0x54 ,
1033+ monoclass_parent : 0x28 ,
1034+ monoclassfield_name : 0x8 ,
1035+ monoclassfield_offset : 0x18 ,
1036+ monoclassruntimeinfo_domain_vtables : 0x8 ,
1037+ monovtable_vtable : 0x40 ,
1038+ monoclassfieldalignment : 0x20 ,
1039+ } ) ,
1040+ _ => None ,
1041+ } ,
9031042 ( PointerSize :: Bit32 , BinaryFormat :: PE ) => match version {
9041043 Version :: V1 => Some ( & Self {
9051044 monoassembly_aname : 0x8 ,
@@ -943,6 +1082,8 @@ impl Offsets {
9431082 monovtable_vtable : 0x28 ,
9441083 monoclassfieldalignment : 0x10 ,
9451084 } ) ,
1085+ // 32-bit PE V2 matches Unity2018_4_10_x86_PE_Offsets from
1086+ // https://github.com/hackf5/unityspy/blob/master/src/HackF5.UnitySpy/Offsets/MonoLibraryOffsets.cs#L12
9461087 Version :: V2 => Some ( & Self {
9471088 monoassembly_aname : 0x8 ,
9481089 monoassembly_image : 0x44 ,
0 commit comments