IL2CPP: Add metadata 27.1 structure layout (#139)

This commit is contained in:
Sam Byass
2021-02-16 11:48:06 +00:00
committed by GitHub
parent 72b26196af
commit d8e9c60190
2 changed files with 16 additions and 0 deletions

View File

@@ -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;
}
}

View File

@@ -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