diff --git a/Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs b/Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs index 58ae48f..46a5117 100644 --- a/Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs +++ b/Il2CppInspector.Common/IL2CPP/Il2CppBinaryClasses.cs @@ -37,6 +37,8 @@ namespace Il2CppInspector public ulong genericMethodPointersCount; public ulong genericMethodPointers; + [Version(Min = 27.1)] + public ulong genericAdjustorThunks; public ulong invokerPointersCount; public ulong invokerPointers; @@ -82,6 +84,10 @@ namespace Il2CppInspector public ulong moduleName; public ulong methodPointerCount; public ulong methodPointers; + [Version(Min = 27.1)] + public long adjustorThunkCount; + [Version(Min = 27.1)] + public ulong adjustorThunks; //Pointer public ulong invokerIndices; public ulong reversePInvokeWrapperCount; public ulong reversePInvokeWrapperIndices; @@ -250,5 +256,7 @@ namespace Il2CppInspector { public int methodIndex; public int invokerIndex; + [Version(Min = 27.1)] + public int adjustorThunk; } } diff --git a/Il2CppInspector.Common/IL2CPP/ImageScan.cs b/Il2CppInspector.Common/IL2CPP/ImageScan.cs index d6edc0f..62c64aa 100644 --- a/Il2CppInspector.Common/IL2CPP/ImageScan.cs +++ b/Il2CppInspector.Common/IL2CPP/ImageScan.cs @@ -138,6 +138,14 @@ namespace Il2CppInspector Image.Version = 24.3; codeRegistration -= ptrSize * 2; // two extra words for WindowsRuntimeFactory } + + if (Image.Version == 27 && cr.reversePInvokeWrapperCount > 0x30000) + { + // If reversePInvokeWrapperCount is a pointer, then it's because we're actually on 27.1 and there's a genericAdjustorThunks pointer interfering. + // We need to bump version to 27.1 and back up one more pointer. + Image.Version = 27.1; + codeRegistration -= ptrSize; + } } // Find CodeRegistration