Detecting Keyboard Hooks

后端 未结 4 1024
陌清茗
陌清茗 2020-12-09 17:45

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

相关标签:
4条回答
  • 2020-12-09 18:03

    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.

    0 讨论(0)
  • 2020-12-09 18:13

    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.

    0 讨论(0)
  • 2020-12-09 18:17

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

    0 讨论(0)
  • 2020-12-09 18:23

    This blog post has instructions: http://zairon.wordpress.com/2006/12/06/any-application-defined-hook-procedure-on-my-machine/

    0 讨论(0)
提交回复
热议问题