Click here to Skip to main content
14,272,175 members
Rate this:
Please Sign up or sign in to vote.
I've recently created a "hello world" c++ program:

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
    MessageBoxA(NULL, "Hello World!", "", MB_OK);
    return 0;
}


What I need to do now is create a dll that hooks MessageBoxA API and changes the message (I want to load the dll from my main program using LoadLibrary).

I've downloaded and properly installed MS Detours 3.0 and have searched the web for help, but I'm completely stuck! Any help would be appreciated in creating that dll.

Thanks in advance.

What I have tried:

Searching the web and trying everything I found.
Posted
Updated 21-May-16 6:32am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Please see this CodeProject article: API hooking revealed[^].

See also this open-source project at GitHub: EasyHook[^].

—SA
   
Comments
Member 12537558 21-May-16 13:36pm
   
Thank you very much.
I've come across both this article and this project and could still not make a dll file that hooks MessageBoxA.
Any further help would be appreciated!

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100