IL2CPP: Update structures for compatibility with metadata v27

This commit is contained in:
Katy Coe
2020-08-15 06:27:00 +02:00
parent 945c978c9b
commit 0d9c01ecaa
2 changed files with 36 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
/* /*
Copyright 2017 Perfare - https://github.com/Perfare/Il2CppDumper Copyright 2017 Perfare - https://github.com/Perfare/Il2CppDumper
Copyright 2017-2020 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com Copyright 2017-2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty
All rights reserved. All rights reserved.
*/ */
@@ -39,7 +39,11 @@ namespace Il2CppInspector
public ulong genericMethodPointers; public ulong genericMethodPointers;
public ulong invokerPointersCount; public ulong invokerPointersCount;
public ulong invokerPointers; public ulong invokerPointers;
// Removed in metadata v27
[Version(Max = 24.3)]
public long customAttributeCount; public long customAttributeCount;
[Version(Max = 24.3)]
public ulong customAttributeGenerators; public ulong customAttributeGenerators;
// Removed in metadata v23 // Removed in metadata v23
@@ -86,6 +90,13 @@ namespace Il2CppInspector
public ulong rgctxsCount; public ulong rgctxsCount;
public ulong rgctxs; public ulong rgctxs;
public ulong debuggerMetadata; public ulong debuggerMetadata;
// Added in metadata v27
public ulong customAttributeCacheGenerator; // CustomAttributesCacheGenerator*
public ulong moduleInitializer; // Il2CppMethodPointer
public ulong staticConstructorTypeIndices; // TypeDefinitionIndex*
public ulong metadataRegistration; // Il2CppMetadataRegistration* // Per-assembly mode only
public ulong codeRegistration; // Il2CppCodeRegistration* // Per-assembly mode only
} }
#pragma warning disable CS0649 #pragma warning disable CS0649
@@ -167,10 +178,12 @@ namespace Il2CppInspector
/* /*
union union
{ {
TypeDefinitionIndex klassIndex; // for VALUETYPE and CLASS TypeDefinitionIndex klassIndex; // for VALUETYPE and CLASS (<v27; v27: at startup)
Il2CppMetadataTypeHandle typeHandle; // for VALUETYPE and CLASS (added in v27: at runtime)
const Il2CppType* type; // for PTR and SZARRAY const Il2CppType* type; // for PTR and SZARRAY
Il2CppArrayType* array; // for ARRAY Il2CppArrayType* array; // for ARRAY
GenericParameterIndex genericParameterIndex; // for VAR and MVAR GenericParameterIndex genericParameterIndex; // for VAR and MVAR (<v27; v27: at startup)
Il2CppMetadataGenericParameterHandle genericParameterHandle; // for VAR and MVAR (added in v27: at runtime)
Il2CppGenericClass* generic_class; // for GENERICINST Il2CppGenericClass* generic_class; // for GENERICINST
} }
*/ */
@@ -186,7 +199,11 @@ namespace Il2CppInspector
public class Il2CppGenericClass public class Il2CppGenericClass
{ {
[Version(Max = 24.3)]
public long typeDefinitionIndex; /* the generic type definition */ public long typeDefinitionIndex; /* the generic type definition */
[Version(Min = 27)]
public long type; // Il2CppType* /* the generic type definition */
public Il2CppGenericContext context; /* a context that contains the type instantiation doesn't contain any method instantiation */ public Il2CppGenericContext context; /* a context that contains the type instantiation doesn't contain any method instantiation */
public ulong cached_class; /* if present, the Il2CppClass corresponding to the instantiation. */ public ulong cached_class; /* if present, the Il2CppClass corresponding to the instantiation. */
} }

View File

@@ -1,6 +1,6 @@
/* /*
Copyright 2017 Perfare - https://github.com/Perfare/Il2CppDumper Copyright 2017 Perfare - https://github.com/Perfare/Il2CppDumper
Copyright 2017-2020 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com Copyright 2017-2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty
All rights reserved. All rights reserved.
*/ */
@@ -27,6 +27,7 @@ namespace Il2CppInspector
// Unity 2019.1.0f2 -> v24.2 // Unity 2019.1.0f2 -> v24.2
// Unity 2019.2.8f1 -> v24.2 // Unity 2019.2.8f1 -> v24.2
// Unity 2019.3.7f1 -> v24.3 // Unity 2019.3.7f1 -> v24.3
// Unity 2020.2.0f1 -> v27
// https://unity3d.com/get-unity/download/archive // https://unity3d.com/get-unity/download/archive
// Metadata version is written at the end of Unity.IL2CPP.MetadataCacheWriter.WriteLibIl2CppMetadata or WriteMetadata (Unity.IL2CPP.dll) // Metadata version is written at the end of Unity.IL2CPP.MetadataCacheWriter.WriteLibIl2CppMetadata or WriteMetadata (Unity.IL2CPP.dll)
@@ -99,20 +100,20 @@ namespace Il2CppInspector
[Version(Min = 16)] [Version(Min = 16)]
public int assembliesCount; public int assembliesCount;
[Version(Min = 19)] [Version(Min = 19, Max = 24.3)]
public int metadataUsageListsOffset; // Il2CppMetadataUsageList public int metadataUsageListsOffset; // Il2CppMetadataUsageList
[Version(Min = 19)] [Version(Min = 19, Max = 24.3)]
public int metadataUsageListsCount; public int metadataUsageListsCount;
[Version(Min = 19)] [Version(Min = 19, Max = 24.3)]
public int metadataUsagePairsOffset; // Il2CppMetadataUsagePair public int metadataUsagePairsOffset; // Il2CppMetadataUsagePair
[Version(Min = 19)] [Version(Min = 19, Max = 24.3)]
public int metadataUsagePairsCount; public int metadataUsagePairsCount;
[Version(Min = 19)] [Version(Min = 19)]
public int fieldRefsOffset; // Il2CppFieldRef public int fieldRefsOffset; // Il2CppFieldRef
[Version(Min = 19)] [Version(Min = 19)]
public int fieldRefsCount; public int fieldRefsCount;
[Version(Min = 20)] [Version(Min = 20)]
public int referencedAssembliesOffset; // int public int referencedAssembliesOffset; // int32_t
[Version(Min = 20)] [Version(Min = 20)]
public int referencedAssembliesCount; public int referencedAssembliesCount;
@@ -141,6 +142,12 @@ namespace Il2CppInspector
[Version(Min = 23)] [Version(Min = 23)]
public int windowsRuntimeTypeNamesSize; public int windowsRuntimeTypeNamesSize;
// Added in metadata v27
[Version(Min = 27)]
public int windowsRuntimeStringsOffset; // const char*
[Version(Min = 27)]
public int windowsRuntimeStringsSize;
// Added in metadata v24 // Added in metadata v24
[Version(Min = 24)] [Version(Min = 24)]
public int exportedTypeDefinitionsOffset; // TypeDefinitionIndex public int exportedTypeDefinitionsOffset; // TypeDefinitionIndex
@@ -232,6 +239,7 @@ namespace Il2CppInspector
public int customAttributeIndex; public int customAttributeIndex;
public int byvalTypeIndex; public int byvalTypeIndex;
[Version(Max = 24.3)]
public int byrefTypeIndex; public int byrefTypeIndex;
public int declaringTypeIndex; public int declaringTypeIndex;
@@ -424,12 +432,14 @@ namespace Il2CppInspector
public int offset; public int offset;
} }
// Removed in metadata v27
public class Il2CppMetadataUsageList public class Il2CppMetadataUsageList
{ {
public uint start; public uint start;
public uint count; public uint count;
} }
// Removed in metadata v27
public class Il2CppMetadataUsagePair public class Il2CppMetadataUsagePair
{ {
public uint destinationindex; public uint destinationindex;