AppModel: Add initial handling of methods (AppMethod)

This commit is contained in:
Katy Coe
2020-07-09 21:25:19 +02:00
parent a9606f5c9e
commit 6015d9e0ab
4 changed files with 378 additions and 16 deletions

View File

@@ -0,0 +1,35 @@
/*
Copyright 2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty
All rights reserved.
*/
using Il2CppInspector.Cpp;
using Il2CppInspector.Reflection;
namespace Il2CppInspector.Model
{
// Class that represents a composite IL/C++ method
public class AppMethod
{
// The corresponding C++ function pointer type
public CppFnPtrType CppFnPtrType { get; internal set; }
// The corresponding .NET method
public MethodBase Method { get; internal set; }
// The VA of the MethodInfo* (VA of the pointer to the MethodInfo) object which defines this method
public ulong MethodInfoPtrAddress { get; internal set; }
// The VA of the method code itself, or 0 if unknown/not compiled
public ulong MethodCodeAddress => Method.VirtualAddress?.Start ?? 0;
public AppMethod(MethodBase method, CppFnPtrType cppMethod, ulong methodInfoPtr = 0xffffffff_ffffffff) {
Method = method;
CppFnPtrType = cppMethod;
MethodInfoPtrAddress = methodInfoPtr;
}
public override string ToString() => CppFnPtrType.ToSignatureString();
}
}