
#include <windows.h>
bool cBase::IsGameReadyForHook(void)
{
if( GetModuleHandle( "d3d9.dll" ) != NULL
&& GetModuleHandle( "ClientFX.fxd" ) != NULL
&& GetModuleHandle( "CShell.dll" ) != NULL )
return true;
return false;
}
void cBase::Teleport(void)
{
while(1)
{
//save location
if( GetAsyncKeyState(0x5A) & 1 ) {
y = *(float*)posy;
x = *(float*)(posy+0x4);
z = *(float*)(posy-0x4);
}
//teleport
if( tele > 0 ) {
*(float*)posy= y;
*(float*)(posy+0x4)= x;
*(float*)(posy-0x4)= z;
}
}
}
DWORD WINAPI hack(LPVOID)
{
while( !Base.IsGameReadyForHook() )
Sleep(100);
Directx.Hook();
Base.Update();
return 0;
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
{
CreateThread(NULL, NULL, hack, NULL, NULL, NULL);
}
return TRUE;
}

void cBase::Teleport(void)
{
while(1)
{
posptr = NULL;
posptr = (DWORD)GetModuleHandleA("ClientFX.fxd");
posptr += charposoffset;
memcpy(&posy,(void *)(posptr),4);
posy += posyoffset;
//save location
if( GetAsyncKeyState(0x5A) & 1 ) {
y = *(float*)posy;
x = *(float*)(posy+0x4);
z = *(float*)(posy-0x4);
}
//teleport
if( tele > 0 ) {
*(float*)posy= y;
*(float*)(posy+0x4)= x;
*(float*)(posy-0x4)= z;
}
}
}

if( GetAsyncKeyState(0x5A) & 1 ) {
*(float*)posy= y;
*(float*)(posy+0x4)= x;
*(float*)(posy-0x4)= z;
}
