Model: Add GetMethodBody() to CustomAttributeData and MethodInvoker

This commit is contained in:
Katy Coe
2020-08-09 20:53:10 +02:00
parent 010bec7dc0
commit a252800052
3 changed files with 13 additions and 5 deletions

View File

@@ -34,6 +34,9 @@ namespace Il2CppInspector.Reflection
public override string ToString() => "[" + AttributeType.FullName + "]";
// Get the machine code of the C++ function
public byte[] GetMethodBody() => Model.Package.BinaryImage.ReadMappedBytes(VirtualAddress.Start, (int) (VirtualAddress.End - VirtualAddress.Start));
// Get all the custom attributes for a given assembly, type, member or parameter
private static IEnumerable<CustomAttributeData> getCustomAttributes(Assembly asm, int customAttributeIndex) {
if (customAttributeIndex < 0)