IL2CPP: Implement GetGenericMethodPointer and VirtualAddress for concrete generic methods from MethodSpecs
This commit is contained in:
@@ -230,6 +230,7 @@ namespace Il2CppInspector
|
||||
}
|
||||
}
|
||||
|
||||
// Get a method pointer if available
|
||||
public (ulong Start, ulong End)? GetMethodPointer(Il2CppCodeGenModule module, Il2CppMethodDefinition methodDef) {
|
||||
// Find method pointer
|
||||
if (methodDef.methodIndex < 0)
|
||||
@@ -268,6 +269,14 @@ namespace Il2CppInspector
|
||||
return (start & 0xffff_ffff_ffff_fffe, FunctionAddresses[start]);
|
||||
}
|
||||
|
||||
// Get a concrete generic method pointer if available
|
||||
public (ulong Start, ulong End)? GetGenericMethodPointer(Il2CppMethodSpec spec) {
|
||||
if (GenericMethodPointers.TryGetValue(spec, out var start)) {
|
||||
return (start & 0xffff_ffff_ffff_fffe, FunctionAddresses[start]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<Il2CppInspector> LoadFromFile(string codeFile, string metadataFile) {
|
||||
// Load the metadata file
|
||||
Metadata metadata;
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace Il2CppInspector.Reflection
|
||||
DeclaredParameters.Add(new ParameterInfo(model, p, genericArguments[p.ParameterType.GenericParameterPosition]));
|
||||
}
|
||||
|
||||
// TODO: Populate VirtualAddress via Il2CppGenericMethodFunctionsDefinitions
|
||||
VirtualAddress = model.Package.GetGenericMethodPointer(spec);
|
||||
}
|
||||
|
||||
public string GetAccessModifierString() => this switch {
|
||||
|
||||
Reference in New Issue
Block a user