I want to know what are the files opened/access by a process. May i know how to do that? I tried to use Deviare, a free hooking api to help me, but was unable to find any useful information from their AIP lib or forum.
I only know i have to hook on to kernel32.dll and createFileW and i am not sure of how to continue.
Pls help me. Thanks in advance.
It’s right. You have to hook the function CreateFileA/W in kernel32.dll to monitor the acces. Do you want to hook these APIs in your own process or in an other process?
If you want to hook functions in your own process you can use
for it. These function detours the function src (f.e. MessageBoxA()) to function dst. As len you can use 5. It returns a function pointer to the original function.
An example call:
That’s an usermode hook. If you want to do this systemwide I would use a device driver. Here is a tutorial about this. http://www.codeproject.com/KB/system/driverdev.aspx
And if you are using VC++ compile in multibyte mode ;).
If you want to hook in an other process just google DLL-Injection ;).