我需要为我的项目使用minHook.dll 。 提供的示例似乎很简单,但是我无法使其正常工作。 我不明白这部分内容:
MESSAGEBOXW fpMessageBoxW = NULL;
// Create a hook for MessageBoxW, in disabled state.
if (MH_CreateHook(&MessageBoxW, &DetourMessageBoxW,
reinterpret_cast(&fpMessageBoxW)) != MH_OK)
{
return 1;
}
这是我的Python代码(适用于我需要挂钩的功能):
def _callback_pointer(handler):
"""Create and return C-pointer"""
print('handler=',cmp_func(handler))
return cmp_func(handler)
def callback(*args, **kwargs):
print(args, kwargs)
res = windll.user32.CallNextHookEx(*args, **kwargs)
print(res)
return res
cmp_func = CFUNCTYPE(c_int, c_int, wintypes.HINSTANCE, POINTER(c_void_p))
hinstDLL = ctypes.windll.LoadLibrary('Gdi32')._handle
hkprcSysMsg =