public static MethodMemory Read(MethodInfo m) { // Note that this is just POC; to really read the method properly, //one must know where it ends, and I'm not sure if that can be done //without cracking open the method table of the PE file... return(MethodMemory.ReadUntil(m, NatSpan.Alloc <N32, byte>(), 0xc3, 0xe0)); }
public unsafe void TestMethod1() { var m1 = MethodMemory.Read <MethodReaderTest>(nameof(Method1)); Trace(m1.Format()); var m2 = MethodMemory.Read <MethodReaderTest>(nameof(Method2)); Trace(m2.Format()); var m3 = MethodMemory.Read <MethodReaderTest>(nameof(Method3)); Trace(m3.Format()); }