I am using an edited version of bravia's base i think. This is just a simple hotkey hack. I am struggling on making it stop disconnecting me. I tried updating the ltc and I packed it with themida. I heard people say that updating the c detour will help but I can't figure out how to do it. I'll post my source. I really have nothing to loose because it doesn't work. If you can help me that would be great. Please no comments like "figure it out yourself noob" or "why are you in this section". I am am still learning. Also, when I build it there is no errors and when I get ingame the boxes and no recoil work. It just disconnects after 1 min of gameplay.
Code:
#include <windows.h>
#include <shellapi.h>
#pragma comment(lib,"shell32.lib")
void __cdecl PushToConsole( const char* szCommand )
{
DWORD *Ltcliient = ( DWORD* )(0x3778BFB0 );
void* CONoff = ( void* )*( DWORD* )( *Ltcliient + 0x208 );
__asm
{
push szCommand;
call CONoff;/// try ok
add esp, 4;
}
}
bool IsGameReadyForHook()
{
if( GetModuleHandleA( "d3d9.dll" ) != NULL
&& GetModuleHandleA( "ClientFX.fxd" ) != NULL
&& GetModuleHandleA( "CShell.dll" ) != NULL )
return true;
return false;
}
void MemCopy(void* Dest, const void* Src, int Len)
{
DWORD OldProtect;
DWORD OldProtect2;
VirtualProtect(Dest, Len, PAGE_EXECUTE_READWRITE, &OldProtect);
memcpy(Dest, Src, Len);
VirtualProtect(Dest, Len, OldProtect, &OldProtect2);
FlushInstructionCache(GetCurrentProcess(), Dest, Len);
}
void main()
{
while (!IsGameReadyForHook()){
Sleep(20);
}
bool boxes = false;
bool norecoil = false;
while(true){
if(GetAsyncKeyState(VK_NUMPAD1)<0){
if(boxes){
PushToConsole("ModelDebug_DrawBoxes 0");
boxes = false;
} else {
PushToConsole("ModelDebug_DrawBoxes 1");
boxes = true;
}
}
if(GetAsyncKeyState(VK_NUMPAD2)<0){
if(norecoil){
removed addies.
norecoil = false;
} else {
//removed addies
norecoil = true;
}
}
Sleep(20);
}
}
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
ShellExecute;
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&main, NULL, 0,NULL);
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}