From 0b3d0651806d9826bd7c52ce6880d2dec11f69f3 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Mon, 12 Apr 2021 17:22:15 +0200 Subject: [PATCH] IL2CPP: Update struct layout for v24.5 (#148) --- Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs | 9 +++++++-- Il2CppInspector.Common/IL2CPP/MetadataClasses.cs | 11 ++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs b/Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs index 46a5117..72e4213 100644 --- a/Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs +++ b/Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs @@ -37,8 +37,10 @@ namespace Il2CppInspector public ulong genericMethodPointersCount; public ulong genericMethodPointers; - [Version(Min = 27.1)] + [Version(Min = 24.5, Max = 24.5)] + [Version(Min = 27.1)] public ulong genericAdjustorThunks; + public ulong invokerPointersCount; public ulong invokerPointers; @@ -84,8 +86,10 @@ namespace Il2CppInspector public ulong moduleName; public ulong methodPointerCount; public ulong methodPointers; + [Version(Min = 24.5, Max = 24.5)] [Version(Min = 27.1)] public long adjustorThunkCount; + [Version(Min = 24.5, Max = 24.5)] [Version(Min = 27.1)] public ulong adjustorThunks; //Pointer public ulong invokerIndices; @@ -198,7 +202,7 @@ namespace Il2CppInspector public uint attrs => (uint) bits & 0xffff; /* param attributes or field flags */ public Il2CppTypeEnum type => (Il2CppTypeEnum)((bits >> 16) & 0xff); - // TODO: Unity 2021.1: num_mods becomes 1 bit shorter, shifting byref and pinned right 1 bit, valuetype bit added + // TODO: Unity 2021.1 (v27.2): num_mods becomes 1 bit shorter, shifting byref and pinned right 1 bit, valuetype bit added public uint num_mods => (uint) (bits >> 24) & 0x3f; /* max 64 modifiers follow at the end */ public bool byref => ((bits >> 30) & 1) == 1; public bool pinned => (bits >> 31) == 1; /* valid when included in a local var signature */ @@ -256,6 +260,7 @@ namespace Il2CppInspector { public int methodIndex; public int invokerIndex; + [Version(Min = 24.5, Max = 24.5)] [Version(Min = 27.1)] public int adjustorThunk; } diff --git a/Il2CppInspector.Common/IL2CPP/MetadataClasses.cs b/Il2CppInspector.Common/IL2CPP/MetadataClasses.cs index 10b300f..4fd7c47 100644 --- a/Il2CppInspector.Common/IL2CPP/MetadataClasses.cs +++ b/Il2CppInspector.Common/IL2CPP/MetadataClasses.cs @@ -12,25 +12,22 @@ namespace Il2CppInspector // Unity 4.6.1p5 - first release, no global-metadata.dat // Unity 5.2.0f3 -> v15 // 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.0f3 -> v23 - // Unity 5.6.4f1 -> v23 - // Unity 2019.1.0f3 -> v24 - // Unity 2018.2.0f2 -> v24 + // Unity 2017.1.0f3 -> v24 // Unity 2018.3.0f2 -> v24.1 // Unity 2019.1.0f2 -> v24.2 - // Unity 2019.2.8f1 -> v24.2 // Unity 2019.3.7f1 -> v24.3 // Unity 2019.4.15f1 -> v24.4 + // Unity 2019.4.21f1 -> v24.5 // Unity 2020.1.0f1 -> v24.3 // Unity 2020.1.11f1 -> v24.4 // Unity 2020.2.0f1 -> v27 + // Unity 2020.2.4f1 -> v27.1 + // Unity 2021.1.0f1 -> v27.2 // https://unity3d.com/get-unity/download/archive // Metadata version is written at the end of Unity.IL2CPP.MetadataCacheWriter.WriteLibIl2CppMetadata or WriteMetadata (Unity.IL2CPP.dll)