Files
Il2CppInspectorRedux/Il2CppInspector.Common/Model/AppMethod.cs
2020-07-16 12:37:39 +02:00

40 lines
1.3 KiB
C#

/*
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 logical group this method is part of
// This is purely for querying methods in related groups and has no bearing on the code
public string Group { get; set; }
// 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();
}
}