
Originally Posted by
Flengo
There should be since its based of Lithtech.
I don't know, so I am trying to find it by hooking the PushToConsole command you gave out.
Code:
DWORD HookVTable( DWORD dwFuncPtr, DWORD dwHook)
{
DWORD dwOld = NULL;
VirtualProtect((void*)dwFuncPtr, 4, PAGE_EXECUTE_READWRITE, &dwOld);
DWORD pOrig = *(PDWORD)dwFuncPtr;
*(PDWORD)dwFuncPtr = (DWORD)dwHook;
VirtualProtect((void*)dwFuncPtr, 4, dwOld, &dwOld);
return pOrig;
}
void __cdecl hookSetConsoleVariable( const char* Commands, float Values ){
g_LTClient = (CLTClient*)*(DWORD*)ADDR_ILTCLIENT;
char cValue[256];
sprintf(cValue, "%d", Values);
add_log("Log.txt", Commands, cValue);
return (g_LTClient->PushToConsole(Commands,Values));
}
int HookSVC(){
DWORD Original = (ADDR_ILTCLIENT+0x138);
if ( pEngine->ValidGamePointers() )
HookVTable(Original, (DWORD)hookSetConsoleVariable);
return 0;
}
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)HookSVC, 0,0,0);
Compiles just fine, but doesn't actually hook the function.
The address and offset is correct because I am using it.
Any ideas why it's not hooking ?