Detecting Keyboard Hooks

2020-02-05 06:59发布

Is there a way to detect which programs or modules are listening to a keyboard hook? By Sysinternals maybe?

4条回答
劳资没心,怎么记你
2楼-- · 2020-02-05 07:20

I don't think you can, there's no GetWindowsHook function that would return the hook(s). Also, I'm under the impression that the main keyboard processing routine is hooked through SetWindowsHookEx(), so even if there are no hooks, there's at least one, Windows itself.

查看更多
来,给爷笑一个
3楼-- · 2020-02-05 07:21

Nope. You would likely have to hook into SetWindowsHookEx() itself in order to detect that.

查看更多
Root(大扎)
4楼-- · 2020-02-05 07:23

It largely depends on what level of abstraction are you obtaining your key presses.
For maximum detection you could use hardware directly or go as low as possible (some hooks work at HW driver-level).

For security purposes, you could also use a virtual keyboard - hooks would have to be targeted specifically at your application to simulate key presses.

查看更多
登录 后发表回答