
.#include <windows.h>
#include <detours.h>
bool speedhacking=false;
DWORD oldtGT=0;
DWORD (*timeGetTime_orig)(void);
DWORD timeGetTime_hooked(void)
{
if(oldtGT==0)
{
oldtGT=(*timeGetTime_orig)();
return oldtGT;
}
DWORD factor;
DWORD ret;
ret = (*timeGetTime_orig)();
if(speedhacking == 1)
{
factor = 2.0;
//factor = 3.0;
//factor = 5.0;
}
else
{
factor = 1.0;
}
DWORD newret;
newret = ret+((oldtGT-ret)*(factor-1));
oldtGT=ret;
return newret;
}
bool WINAPI DllMain( HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved )
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
timeGetTime_orig = (DWORD (__cdecl *)(void))DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("winmm.dll"), "timeGetTime"), (PBYTE)timeGetTime_hooked);
case DLL_PROCESS_DETACH:
DetourRemove((PBYTE)GetProcAddress(GetModuleHandle("winmm.dll"), "timeGetTime"), (PBYTE)timeGetTime_hooked);
}
return TRUE;
}
#include <windows.h>
#include <detours.h>
bool speedhacking=false;
DWORD oldtick=0;
DWORD (WINAPI *GetTickCount_orig)(void);
DWORD WINAPI GetTickCount_hooked(void)
{
if(oldtick==0)
{
oldtick=(*GetTickCount_orig)();
return oldtick;
}
DWORD factor;
DWORD ret;
ret = (*GetTickCount_orig)();
if(speedhacking == 1)
{
factor = 2.0;
//factor = 3.0;
//factor = 5.0;
}
else
{
factor = 1.0;
}
DWORD newret;
newret = ret+((oldtick-ret)*(factor-1));
oldtick=ret;
return newret;
}
bool WINAPI DllMain( HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved )
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
GetTickCount_orig = (DWORD (__stdcall *)(void))DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("Kernel32.dll"), "GetTickCount"), (PBYTE)GetTickCount_hooked);
case DLL_PROCESS_DETACH:
DetourRemove((PBYTE)GetProcAddress(GetModuleHandle("Kernel32.dll"), "GetTickCount"), (PBYTE)GetTickCount_hooked);
}
return TRUE;
}
#include <windows.h> DWORD (*timeGetTime_orig)(void); DWORD timeGetTime_hooked(void)
bool WINAPI DllMain( HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved )
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
timeGetTime_orig = (DWORD (__cdecl *)(void))DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("winmm.dll"), "timeGetTime"), (PBYTE)timeGetTime_hooked);
case DLL_PROCESS_DETACH:
DetourRemove((PBYTE)GetProcAddress(GetModuleHandle("winmm.dll"), "timeGetTime"), (PBYTE)timeGetTime_hooked);
}
return TRUE;
}


DWORD WINAPI GetTickCount_hooked(void)
{
if(oldtick==0)
{
oldtick=(*GetTickCount_orig)();
return oldtick;
}
DWORD factor;
DWORD ret;
ret = (*GetTickCount_orig)();
if(speedhacking == 1)
{
factor = 2.0;
//factor = 3.0;
//factor = 5.0;
}
else
{
factor = 1.0;
}
DWORD newret;
newret = ret+((oldtick-ret)*(factor-1));
oldtick=ret;
return newret;
}
