alright
well then,
i have been coding in c++ and vb for several years, ive just found my d3d base and im currently working on a hack. although all the hacks ive tried to compile havent worked, thats where my coders come in, i need someone to compile my hack for me........ because i cant, heres what i have so far
#include "stdafx.h"
#include "stdafx.h"
#include <windows.h>
#include <shellapi.h>
#pragma comment(lib,"shell32.lib")
void __cdecl PushToConsole( const char* szCommand )
{
DWORD *L***ient = ( DWORD* )( 0x37775D68 );
void* CONoff = ( void* )*( DWORD* )( *L***ient + 0x208 );
__asm
{
push szCommand;
call CONoff;
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);
DWORD GetAddressPtr(int index)
{
DWORD dwBase = *(DWORD*)dwDevicePointer;
if(dwBase == 0) return 0;
dwBase = *(DWORD*)dwBase;
if(dwBase == 0) return 0;
dwBase = *(DWORD*)dwBase;
if(dwBase == 0) return 0;
return dwBase+4*index;
}
DWORD GetD3DHSApi(int index)
{
DWORD dwVA = dwHSDevicePointer;
if(IsBadReadPtr((void*)dwVA, 4)) return 0;
dwVA = *(DWORD*)dwVA;
if(!dwVA || IsBadReadPtr((void*)dwVA, 0x200)) return 0;
return dwVA + (4*index);
}
#define HOOKD3DAPI(a, b) \
if(*(DWORD*)GetAddressPtr(b) != (DWORD)&hk##a) { \
p##a = (a##_t) *(DWORD*)GetAddressPtr(b); \
*(DWORD*)GetAddressPtr(b) = (DWORD)&hk##a; \
*(DWORD*)GetD3DHSApi(b) = (DWORD)&hk##a; \
}
DWORD WINAPI HookD3DApis(LPVOID)
{
bool bValid = false;
while(true) {
bValid = GetAddressPtr(0) > 0;
if(bValid) {
HOOKD3DAPI(Reset, 16)
HOOKD3DAPI(EndScene, 42)
HOOKD3DAPI(DrawIndexedPrimitive, 82)
HOOKD3DAPI(SetStreamSource, 100)
}
Sleep(300);
}
return 1;
}
dwHSDevicePointer = g_pTools->dwFindPattern((DWORD)GetModuleHandle(ehsvc), 0x90000, (PBYTE)"\x8B\x84\x11\x00\x00\x00\x00\x8B\x8D\xCC\x FD\xFF\xFF\x8B\x95", "xxx????xxxxxxxx");
if(dwHSDevicePointer) {
dwHSDevicePointer = *(DWORD*)(dwHSDevicePointer+3);
dwHSDevicePointer += 0x10;
}
DWORD dwTempDevicePointer = g_pTools->dwFindPattern((DWORD)GetModuleHandle(0), (DWORD)0xFFFFFFFF, (PBYTE)"\xA1\x00\x00\x00\x00\x89\x45\xF8\x8D", "x????xxxx");
if(dwTempDevicePointer) {
dwDevicePointer = *(DWORD*)(dwTempDevicePointer+1);
}
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;
}
all i need is what goes inbetween
then compile which i cant do,
then inject
ps
credits to bravia for base and hook