How to hook all runned processes ??

c++ / delphi package - dll injection and api hooking
Post Reply
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

madCodeHook hooks both currently running processes and newly created processes. You don't need to do anything special, madCodeHook does it automatically when using InjectLibrary(specialFlag).

Or what do you mean?
LeVuHoang
Posts: 131
Joined: Fri Oct 22, 2004 8:37 am

Post by LeVuHoang »

if my program hooks SetWindowsHookEx, It can know what programs run after mine use SetWindowsHookEx function or what programs use SetWindowsHook again. Because, my program injected into SetWindowsHookEx before other programs use it.
now, If a program uses only one time SetWindowsHookEx (and still running) before my program injects into, can my program know which program used SetWindowsHookEx ???

Example :
If I wish to write an anti keylogger. The keylogger just uses SetWindowsHook one time to log keyboard message, and It has run before my program injects into SetWindowsHook, how to detect it ???

Thank you
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Well, madCodeHook can't look into the past. If you want to know whether a program called SetWindowsHookEx before your program started, you need to find a way to ask the OS about that. Don't know how that works. Or you have to make sure that your program is started first.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

I don't know. Maybe it's possible somehow to ask the OS which SetWindowsHookEx hooks are installed. But I don't know how.
LeVuHoang
Posts: 131
Joined: Fri Oct 22, 2004 8:37 am

Post by LeVuHoang »

ok, thanks madshi much :greenBalloon:
Post Reply