IL2CPP: Fix versioning errors in Il2CppAssemblyNameDefinition and Il2CppAssemblyDefinition

This commit is contained in:
Katy Coe
2019-11-12 20:23:50 +01:00
parent 928ba16efc
commit 3b6dee36ba
2 changed files with 29 additions and 8 deletions

View File

@@ -102,7 +102,7 @@ namespace Il2CppInspector
public ulong methodReferences; public ulong methodReferences;
public long fieldOffsetsCount; public long fieldOffsetsCount;
public ulong pfieldOffsets; public ulong pfieldOffsets; // Changed from int32_t* to int32_t** after 5.4.0f3, before 5.5.0f3
public long typeDefinitionsSizesCount; public long typeDefinitionsSizesCount;
public ulong typeDefinitionsSizes; public ulong typeDefinitionsSizes;

View File

@@ -11,8 +11,14 @@ namespace Il2CppInspector
{ {
// Unity 4.6.1p5 - first release, no global-metadata.dat // Unity 4.6.1p5 - first release, no global-metadata.dat
// Unity 5.2.0f3 -> v15 // Unity 5.2.0f3 -> v15
// Unity 5.3.0f1 -> v16 // Unity 5.3.0f4 -> v16
// .. // Unity 5.3.1f1 -> v16
// Unity 5.3.2f1 -> v19
// Unity 5.3.3f1 -> v20
// Unity 5.3.4f1 -> v20
// Unity 5.3.5f1 -> v21
// Unity 5.4.0f3 -> v21
// Unity 5.5.0f3 -> v22
// Unity 5.6.2p3 -> v23 // Unity 5.6.2p3 -> v23
// Unity 5.6.4f1 -> v23 // Unity 5.6.4f1 -> v23
// Unity 2017.2f3 -> v24 // Unity 2017.2f3 -> v24
@@ -20,7 +26,7 @@ namespace Il2CppInspector
// Unity 2018.3.0f2 -> v24.1 // Unity 2018.3.0f2 -> v24.1
// Unity 2019.2.8f1 -> v24.2 // Unity 2019.2.8f1 -> v24.2
// 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 (Unity.IL2CPP.dll) // Metadata version is written at the end of Unity.IL2CPP.MetadataCacheWriter.WriteLibIl2CppMetadata or WriteMetadata (Unity.IL2CPP.dll)
// From il2cpp-metadata.h // From il2cpp-metadata.h
#pragma warning disable CS0649 #pragma warning disable CS0649
@@ -168,26 +174,41 @@ namespace Il2CppInspector
// Renamed from Il2CppAssembly somewhere after Unity 2017.2f3 up to Unity 2018.2.0f2 // Renamed from Il2CppAssembly somewhere after Unity 2017.2f3 up to Unity 2018.2.0f2
public class Il2CppAssemblyDefinition public class Il2CppAssemblyDefinition
{ {
// They moved the position of aname in v16 from the top to the bottom of the struct
public Il2CppAssemblyNameDefinition aname => aname_pre16 ?? aname_post16;
[Version(Max = 15)]
public Il2CppAssemblyNameDefinition aname_pre16;
public int imageIndex; public int imageIndex;
[Version(Min = 19)] [Version(Min = 24.1)]
public uint token; public uint token;
[Version(Max = 24.0)] [Version(Max = 24.0)]
public int customAttributeIndex; public int customAttributeIndex;
[Version(Min = 20)]
public int referencedAssemblyStart; public int referencedAssemblyStart;
[Version(Min = 20)]
public int referencedAssemblyCount; public int referencedAssemblyCount;
public Il2CppAssemblyNameDefinition aname;
[Version(Min = 16)]
public Il2CppAssemblyNameDefinition aname_post16;
} }
// Renamed from Il2CppAssemblyName somewhere after Unity 2017.2f3 up to Unity 2018.2.0f2 // Renamed from Il2CppAssemblyName somewhere after Unity 2017.2f3 up to Unity 2018.2.0f2
public class Il2CppAssemblyNameDefinition public class Il2CppAssemblyNameDefinition
{ {
// They moved the position of publicKeyToken in v16 from the middle to the bottom of the struct
public byte[] publicKeyToken => publicKeyToken_post16;
public uint nameIndex; public uint nameIndex;
public uint cultureIndex; public uint cultureIndex;
public uint hashValueIndex; public uint hashValueIndex;
public uint publicKeyIndex; public uint publicKeyIndex;
[Version(Max = 15), ArrayLength(FixedSize = 8)]
public byte[] publicKeyToken_pre16;
public uint hash_alg; public uint hash_alg;
public int hash_len; public int hash_len;
public uint flags; public uint flags;
@@ -195,8 +216,8 @@ namespace Il2CppInspector
public int minor; public int minor;
public int build; public int build;
public int revision; public int revision;
[ArrayLength(FixedSize = 8)] [Version(Min = 16), ArrayLength(FixedSize = 8)]
public byte[] publicKeyToken; public byte[] publicKeyToken_post16;
} }
public class Il2CppTypeDefinition public class Il2CppTypeDefinition