Naughter Software Logo

HookImportFunctionByName v1.02 (Obsolete)

Enclosed is MFC source code for a function which can be used to hook any imported function call which your application makes. Since most of the Win32 API is implemented using import functions in dlls, this means that you hook Win32 API calls. This is useful when for example you want to be called for every call to the file system (CreateFile && CloseHandle) which your app makes. This example of hooking the file system calls your app makes could form the basis of code to ensure you do not have any handle leaks in your application. You could also use this code to spy on COM port activity in remote processes by injecting the DLL into the remote process.

The code is based on the code developed by John Robbins for his "BugSlayer"articles in the MSJ magazine. I have removed the dependencies on his other DLL functions, converted the code to MFC and addition of numerous ASSERT's

 

Copyright

 

Updates

4 December 2002

V1.02 (20 April 2002)

V1.01 (1 January 2001)

V1.0 (24 December 1999)