akeit0
How to get the direct function pointer of virtual struct method?
How to Get the Function Pointer of FooStruct.Foo?
I have the following C# code:
To obtain the function pointer of FooStruct.Foo, I used:
However, fp does not point to the actual method implementation I need. Instead, it refers to the function pointer for the boxed version of FooStruct.
For reference, the generated assembly is this:
I can retrieve TargetFunctionPointer by analyzing the JIT-compiled native code, but I’m looking for a more direct or reliable approach.
Is there a better way to get the actual function pointer of FooStruct.Foo?
14 replies