Calculate and output pointers to the end of each method

This commit is contained in:
Katy Coe
2019-11-14 02:44:56 +01:00
parent 312c2f8e66
commit a880e8bd04
6 changed files with 50 additions and 26 deletions

View File

@@ -17,7 +17,7 @@ namespace Il2CppInspector.Reflection
name = name[..suffix];
sb.Append($"{linePrefix}[{attributePrefix}{name}]");
if (emitPointer)
sb.Append($" {(inline? "/*" : "//")} {((ulong)cad.VirtualAddress).ToAddressString()}{(inline? " */" : "")}");
sb.Append($" {(inline? "/*" : "//")} {cad.VirtualAddress.ToAddressString()}{(inline? " */" : "")}");
sb.Append(inline? " ":"\n");
}
@@ -29,6 +29,8 @@ namespace Il2CppInspector.Reflection
? string.Format($"0x{(uint)address:X8}")
: string.Format($"0x{address:X16}");
public static string ToAddressString(this (ulong start, ulong end)? address) => ToAddressString(address?.start ?? 0) + "-" + ToAddressString(address?.end ?? 0);
// Output a value in C#-friendly syntax
public static string ToCSharpValue(this object value) {
if (value is bool)