Source :
Code:
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include <detours.h>
// int sub_56E1B0(const char*)
typedef int(*tHook)(const char*) ;
tHook oHook; // our original function
int hHook(const char* a)
{
return oHook("Hooked when original function called!");
}
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
oHook = (tHook) DetourFunction((PBYTE) 0x0056E1B0, (PBYTE) hHook);
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
Its basic dont write silly comments.






