get process by function

c++ / delphi package - dll injection and api hooking
Post Reply
anAKiN
Posts: 4
Joined: Sat Jun 26, 2004 7:50 pm

get process by function

Post by anAKiN »

Hi!
I'm just wondering if it would be possible to get pid of the process that calls hooked by my application function. For example if i hook 'send' from WinSock i would like to know that it was orginally called by some pid, that i would use to get 'explorer.exe' for example.

Thanks in advance,
anAKiN
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Sure, just call GetCurrentProcessID to get the PID of the current process or call GetModuleFileName(0, ...) to get the name of the exe which called the hooked API! :idea:
anAKiN
Posts: 4
Joined: Sat Jun 26, 2004 7:50 pm

Post by anAKiN »

hmm, right... forgot i have to use dll, so that i can use these functions ;-)
thanks!
Post Reply