07.01.2010, 14:52
Quote:
Originally Posted by SMX
Yeah that's what I meant.
But how do you replace that address? |
pawn Код:
int hkFunctionToHook(int arg1, int arg2)
{
logprintf("Received call to FunctionToHook! I block it, do nothing.");
return 1;
}
pawn Код:
Call((DWORD)0x12345678, (DWORD)&hkFunctionToHook); // we redirect the function call to our function
pawn Код:
typedef RETTYPE (*FunctionToHook_t)(int, int);
FunctionToHook_t pfnOriginalFunction = (FunctionToHook_t)0x11234567;
int hkFunctionToHook(int arg1, int arg2)
{
logprintf("Received call to FunctionToHook! I just append this log message.");
// Call the original function
return pfnOriginalFunction(arg1, arg2);
}