AppModel/IDA: Typed MethodInvokers for 5.3.0-5.6.7 don't use Il2CppMethodPointer

This commit is contained in:
Katy Coe
2020-07-20 22:48:40 +02:00
parent a4d3ae8dc9
commit 2f3b0d7276
2 changed files with 7 additions and 3 deletions

View File

@@ -110,7 +110,7 @@ typedef __int64 int64_t;
writeSectionHeader("Method.Invoke thunks"); writeSectionHeader("Method.Invoke thunks");
foreach (var method in model.ILModel.MethodInvokers.Where(m => m != null)) { foreach (var method in model.ILModel.MethodInvokers.Where(m => m != null)) {
writeTypedName(method.VirtualAddress.Start, method.Signature, method.Name); writeTypedName(method.VirtualAddress.Start, method.GetSignature(model.UnityVersion), method.Name);
} }
} }

View File

@@ -7,6 +7,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Il2CppInspector.Cpp.UnityHeaders;
namespace Il2CppInspector.Reflection namespace Il2CppInspector.Reflection
{ {
@@ -56,8 +57,11 @@ namespace Il2CppInspector.Reflection
public string Name => $"RuntimeInvoker_{!IsStatic}{ReturnType.BaseName.ToCIdentifier()}_" + string.Join("_", ParameterTypes.Select(p => p.BaseName.ToCIdentifier())); public string Name => $"RuntimeInvoker_{!IsStatic}{ReturnType.BaseName.ToCIdentifier()}_" + string.Join("_", ParameterTypes.Select(p => p.BaseName.ToCIdentifier()));
// Display as a C++ method signature; MethodInfo* is the same as RuntimeMethod* (see codegen/il2cpp-codegen-metadata.h) // Display as a C++ method signature; MethodInfo* is the same as RuntimeMethod* (see codegen/il2cpp-codegen-metadata.h)
public string Signature => $"void* {Name}(Il2CppMethodPointer pointer, const MethodInfo* methodMetadata, void* obj, void** args)"; public string GetSignature(UnityVersion version) =>
version.CompareTo("2017.1.0") >= 0
? $"void* {Name}(Il2CppMethodPointer pointer, const MethodInfo* methodMetadata, void* obj, void** args)"
: $"void* {Name}(const MethodInfo* method, void* obj, void** args)";
public override string ToString() => Signature; public override string ToString() => GetSignature(new UnityVersion("2017.1.0"));
} }
} }