我仍在尝试完全理解 hooking 以及 easyhook 的工作原理。我现在写了一个简单的例子:一个包含 webbrowser 元素的表单,我正在尝试挂钩由它进行的 recv 调用。编译时,程序返回此错误:
A first chance exception of type 'System.NotSupportedException' occurred in EasyHook.dll
System.NotSupportedException: STATUS_NOT_SUPPORTED: (Code: 0)
at EasyHook.NativeAPI.Force(Int32 InErrorCode)
at EasyHook.RemoteHooking.InjectEx(Int32 InHostPID, Int32 InTargetPID, Int32 InWakeUpTID, Int32 InNativeOptions, String InLibraryPath_x86, String InLibraryPath_x64, Boolean InCanBypassWOW64, Boolean InCanCreateService, Object[] InPassThruArgs)
at EasyHook.RemoteHooking.Inject(Int32 InTargetPID, InjectionOptions InOptions, String InLibraryPath_x86, String InLibraryPath_x64, Object[] InPassThruArgs)
at Hook_Test.Form1.Run() in I:\Documents and Settings\Meme\Desktop\SimpleHook\Hook Test\Hook Test\Form1.cs:line 46
在第 46 行,我有以下代码:
RemoteHooking.Inject(
Process.GetCurrentProcess().Id,
InjectionOptions.Default,
"TestInject.dll",
"TestInject.dll",
ChannelName);
我真的看不出问题出在哪里,有人可以帮助我吗?