I am trying to replace a standard dll function with my own function. Mainly the bitblt function from the dll gdi32.dll. So when an application calls the bitblt routine it will call my bitblt routine instead.

Does anyone have any ideas on how to do this. Thanks.
Posted on 2001-09-14 17:46:48 by kbd
Do you mean an already existing application or one that you have the source of? With source a find & replace will do but it's a little trickier on an already compiled exe, you will probably have to mess with the import table....
Posted on 2001-09-15 03:55:12 by Thomas
Just put the new gdi32.dll in the directory of the application and then write your code like normal.

Your almost guarenteed to run into "illegal operations" though since gdi32.dll also handles some window drawing routines.

I did this with a less used DLL (advapi32.dll) in C/C++ to fake some stupid VB program on the "GetUserNameA" function.


Devin.
Posted on 2001-09-16 14:35:08 by Devin
Also, I found a site that might help you on this.. The guy did it for wsock32.dll



http://www.vijaymukhi.com/vmis/foolsnet.htm


Hope that helps.

Devin
Posted on 2001-09-16 14:43:35 by Devin