get process by function

c++ / delphi package - dll injection and api hooking

get process by function

Postby anAKiN » Sat Jun 26, 2004 7:53 pm

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
anAKiN
 
Posts: 4
Joined: Sat Jun 26, 2004 7:50 pm

Postby madshi » Sat Jun 26, 2004 8:33 pm

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:
madshi
Site Admin
 
Posts: 9790
Joined: Sun Mar 21, 2004 5:25 pm

Postby anAKiN » Sat Jun 26, 2004 8:38 pm

hmm, right... forgot i have to use dll, so that i can use these functions ;-)
thanks!
anAKiN
 
Posts: 4
Joined: Sat Jun 26, 2004 7:50 pm


Return to madCodeHook

Who is online

Users browsing this forum: No registered users and 5 guests