Misaka-Mikoto-Tech/MonoHook

How to hook the property of an interface?

BobH233 opened this issue · 1 comments

Here for example has a interface called A

public interface A{
    int p1{get;set;}
}

and I what to hook it, but it throw an error:

Missing or incorrect header for method set_MuzzleEular
[17:26:35.726] [BobH_ATRI2] [ERROR]   at (wrapper managed-to-native) System.RuntimeMethodHandle:GetFunctionPointer (intptr)
  at System.RuntimeMethodHandle.GetFunctionPointer () [0x00000] in <filename unknown>:0
  at MethodHook.GetFunctionAddr (System.Reflection.MethodBase method) [0x00000] in <filename unknown>:0
  at MethodHook..ctor (System.Reflection.MethodBase targetMethod, System.Reflection.MethodBase replacementMethod, System.Reflection.MethodBase proxyMethod) [0x00000] in <filename unknown>:0

interface does not generate real asm code, so can not be hooked, pls hook property of class instead