Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,

I have used a code which hooks ZwQueryDirectryFile in ssdt and whenever this function is called, my function, NewZwQueryDirectryFile, is executed. But I need to know the address of the process which called this function, I've heard sth about EPROCESS Block but I don't know how I can use this to achieve my goal. Is there any way I can find out the process calling this procedure?

P.S.
I am trying to write an anti-virus.

Thank you.
Posted

1 solution

Try GetCurrentProcessId(void);

From there you can call many other system functions, to find additional process information.

If a virus is calling your function, it could reroute any of these system calls...

Good luck in writing an 'anti-virus'. You have a lot of studying ahead of you.
 
Share this answer
 
Comments
lilyNaz 6-Jun-12 5:46am    
Thanks, It worked!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900