This is how i do speedhack, notice that this is similar to a qpc hook so it will speedup everything...
Credit me if u use this, hope you like my first post...
btw this is for PW MY-EN
Credit me if u use this, hope you like my first post...
btw this is for PW MY-EN
Code:
DWORD MallocAddress = (DWORD)malloc;
DWORD MemcpyAddress = (DWORD)memcpy;
int SpeedMeter=2;
__declspec(naked) int __cdecl Reroute(BYTE* source,BYTE* target,int len)
{
__asm
{
push ebx;
push ebp;
push esi;
mov esi,[esp+0Ch+dword ptr 0Ch];
lea eax,[esi+5];
push edi;
push eax;
call MallocAddress;
mov ebx,[esp+14h+dword ptr 4];
mov ebp,ds:VirtualProtect;
add esp,4;
lea ecx,[esp+10h+dword ptr 0Ch];
push ecx;
push 4;
push esi;
push ebx;
mov edi,eax;
call ebp;
push esi;
push ebx;
push edi;
call MemcpyAddress;
mov ecx,[esp+1Ch+dword ptr 8];
add edi,esi;
mov edx,ebx;
sub edx,edi;
add esp,0Ch;
lea eax,[edx+esi-5];
mov byte ptr [edi],0E9h;
mov [edi+1],eax;
mov eax,[esp+10h+dword ptr 0Ch];
lea edx,[esp+10h+dword ptr 0Ch];
push edx;
push eax;
sub ecx,ebx;
push esi;
sub ecx,5;
push ebx;
mov byte ptr [ebx],0E9h;
mov [ebx+1],ecx;
call ebp;
mov eax,edi;
pop edi;
sub eax,esi;
pop esi;
pop ebp;
pop ebx;
retn
}
}
BOOL (__cdecl* pGameSpeed)();
BOOL __cdecl myGameSpeed()
{
BOOL bRet;
__int64 GameFactor;
__int64 OurFactor = 1000000 * SpeedMeter;
struct _SYSTEMTIME SystemTime;
struct _FILETIME FileTime;
LARGE_INTEGER PerformanceCount;
LARGE_INTEGER bTemp = *(LARGE_INTEGER*)0x9482D8;
bool GetFrequency = *(bool*)0x008FC268;
if(bTemp.HighPart)
{
GetLocalTime(&SystemTime);
SystemTimeToFileTime(&SystemTime, &FileTime);
return 1000 * FileTime.dwLowDateTime;
}
if(bTemp.LowPart)
return 1000 * timeGetTime();
if(GetFrequency)
{
bRet = QueryPerformanceFrequency(&bTemp);
if(!bRet)
return bRet;
GetFrequency = false;
}
bRet = QueryPerformanceCounter(&PerformanceCount);
if(bRet)
{
GameFactor = *(__int64*)&PerformanceCount;
PerformanceCount.LowPart = OurFactor* *(UINT64*)&PerformanceCount % *(UINT64*)&bTemp / *(UINT64*)&bTemp;
bRet = OurFactor* GameFactor / *(UINT64*)&bTemp + (DWORD)PerformanceCount.LowPart;
}
return bRet;
}
//Set the hook once where u wish...
pGameSpeed=(BOOL(__cdecl*)())\
Reroute((BYTE*)0x006F93C0,(BYTE*)myGameSpeed,5);