Hi,
ich habe nach einem Tutorial versucht eine Funktion von Notepad zu hooken.
Aber meine Code wird nicht ausgeführt ...
Ist daran was falsch ?
ich habe nach einem Tutorial versucht eine Funktion von Notepad zu hooken.
Aber meine Code wird nicht ausgeführt ...
Code:
#include <windows.h>
#include <detours.h>
int (__stdcall *InsertDateTime_orig) (int x);
int __stdcall InsertDateTime(int x)
{
MessageBox (NULL, "InsertDateTime hooked!", "Detoured", MB_ICONINFORMATION);
return InsertDateTime_orig(x);
};
int APIENTRY DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved )
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
InsertDateTime_orig = (int (__stdcall *)(int))DetourFunction ((PBYTE)0x0100880E,(PBYTE)InsertDateTime);
break;
case DLL_PROCESS_DETACH:
DetourRemove ((PBYTE)0x0100880E,(PBYTE)InsertDateTime);
break;
}
return true;
}
Ist daran was falsch ?