arman2
October 28th, 2004, 02:31 AM
Hi,
I want to write a hook for ZwTerminateProcess.
I have no problem writing the hooking function but the only problem is that i don't know how I can get the name of the process that the zwterminateprocess called for. i mean, I only have a handle to the process, I just search for several days and just find NtQueryInformationProcess for querying information for the process handle and getting the image file name. but after some tests i find that i need to have a user-mode buffer in order to get information from NtQueryInformationProcess. But i can't find a way to allocate a user-mode nor i can find another method for getting the file path from this handle.
please help me solve this problem!
thanks
I want to write a hook for ZwTerminateProcess.
I have no problem writing the hooking function but the only problem is that i don't know how I can get the name of the process that the zwterminateprocess called for. i mean, I only have a handle to the process, I just search for several days and just find NtQueryInformationProcess for querying information for the process handle and getting the image file name. but after some tests i find that i need to have a user-mode buffer in order to get information from NtQueryInformationProcess. But i can't find a way to allocate a user-mode nor i can find another method for getting the file path from this handle.
please help me solve this problem!
thanks