IL2CPP: Handle metadata v24.5 (Unity 2019.4.21-2019.4.24) (#148)

This commit is contained in:
Katy Coe
2021-04-12 17:53:31 +02:00
parent 0b3d065180
commit 98157c99ed
3 changed files with 15 additions and 8 deletions

View File

@@ -276,6 +276,13 @@ namespace Il2CppInspector
CodeRegistration = Image.ReadMappedObject<Il2CppCodeRegistration>(codeRegistration);
MetadataRegistration = Image.ReadMappedObject<Il2CppMetadataRegistration>(metadataRegistration);
// genericAdjustorThunks was inserted before invokerPointersCount in 24.5 and 27.1
// pointer expected if we need to bump version
if (Image.Version == 24.4 && CodeRegistration.invokerPointersCount > 0x100000) {
Image.Version = 24.5;
CodeRegistration = Image.ReadMappedObject<Il2CppCodeRegistration>(codeRegistration);
}
// Plugin hook to pre-process binary
isModified |= PluginHooks.PreProcessBinary(this).IsStreamModified;

View File

@@ -45,9 +45,9 @@ namespace Il2CppInspector
public ulong invokerPointers;
// Removed in metadata v27
[Version(Max = 24.4)]
[Version(Max = 24.5)]
public long customAttributeCount;
[Version(Max = 24.4)]
[Version(Max = 24.5)]
public ulong customAttributeGenerators;
// Removed in metadata v23
@@ -210,7 +210,7 @@ namespace Il2CppInspector
public class Il2CppGenericClass
{
[Version(Max = 24.4)]
[Version(Max = 24.5)]
public long typeDefinitionIndex; /* the generic type definition */
[Version(Min = 27)]
public ulong type; // Il2CppType* /* the generic type definition */

View File

@@ -100,13 +100,13 @@ namespace Il2CppInspector
[Version(Min = 16)]
public int assembliesCount;
[Version(Min = 19, Max = 24.4)]
[Version(Min = 19, Max = 24.5)]
public int metadataUsageListsOffset; // Il2CppMetadataUsageList
[Version(Min = 19, Max = 24.4)]
[Version(Min = 19, Max = 24.5)]
public int metadataUsageListsCount;
[Version(Min = 19, Max = 24.4)]
[Version(Min = 19, Max = 24.5)]
public int metadataUsagePairsOffset; // Il2CppMetadataUsagePair
[Version(Min = 19, Max = 24.4)]
[Version(Min = 19, Max = 24.5)]
public int metadataUsagePairsCount;
[Version(Min = 19)]
public int fieldRefsOffset; // Il2CppFieldRef
@@ -240,7 +240,7 @@ namespace Il2CppInspector
public int customAttributeIndex;
public int byvalTypeIndex;
[Version(Max = 24.4)]
[Version(Max = 24.5)]
public int byrefTypeIndex;
public int declaringTypeIndex;