Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C++/C Programming › Tinkering with Speedhack

Tinkering with Speedhack

Posts 1–8 of 8 · Page 1 of 1
why06
why06
Tinkering with Speedhack
Ok I've been tinkering around with HD's speedhack source for about a month now, and think I'm about to give up on it till I fully understand Windows API:
Code:
#include <windows.h>
#include <detours.h>

bool speedhacking = false;
bool (__stdcall *QPG_orig)(LARGE_INTEGER *lp);
bool __stdcall QPC_hooked(LARGE_INTEGER *lp) 
DWORD oldtick=0;
DWORD (WINAPI *GetTickCount_orig)(void);
DWORD WINAPI GetTickCount_hooked(void)
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; 
}
{ 
	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; 
}
{ 
	static __int64 oldfake = 0;
	static __int64 oldreal = 0;
	__int64 factor;

	__int64 newvalue;
	int ret;

	if( oldfake == 0 || oldreal == 0 )
	{
		oldfake = lp->QuadPart;
		oldreal = lp->QuadPart;
	}

	ret = (*QPC_orig)(lp);

	newvalue  = lp->QuadPart;

	if(speedhacking == 1)
	{
		//factor = 2.0;
		factor = 3.0;
		//factor = 5.0;
	}
	else
	{
		factor = 1.0;
	}

	newvalue = oldfakevalue + (__int64)((newvalue - oldrealvalue) * tempfactor);

	oldrealvalue = lp->QuadPart;
	oldfakevalue = newvalue;

	lp->QuadPart = newvalue;
	return ret; 
}

void KeyHooks(void)
{
	while(1)
	{
		while(GetAsyncKeyState(0x52)&1)
		{
			speedhacking = true; // Controls all speed hacks
		}		
		Sleep(100);
	}
}

bool APIENTRY DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
	switch(dwReason)
	{
	case DLL_PROCESS_ATTACH:
		DisableThreadLibraryCalls(hDll);
		CreateThread(0,0, (LPTHREAD_START_ROUTINE)KeyHooks, 0, 0, 0);
		GetTickCount_orig = (DWORD (__stdcall *)(void))DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("Kernel32.dll"), "GetTickCount"), (PBYTE)GetTickCount_hooked);
		QPC_orig = (bool (__stdcall*)(LARGE_INTEGER*))DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("kernel32.dll"), "QueryPerformanceCounter"), (PBYTE)QPC_hooked);
		timeGetTime_orig = (DWORD (__cdecl *)(void))DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("winmm.dll"), "timeGetTime"), (PBYTE)timeGetTime_hooked);
	case DLL_PROCESS_DETACH:
		DetourRemove((PBYTE)GetProcAddress(GetModuleHandle("kernel32.dll"), "QueryPerformanceCounter"), (PBYTE)QPC_hooked);
		DetourRemove((PBYTE)GetProcAddress(GetModuleHandle("Kernel32.dll"), "GetTickCount"), (PBYTE)GetTickCount_hooked);
		DetourRemove((PBYTE)GetProcAddress(GetModuleHandle("winmm.dll"), "timeGetTime"), (PBYTE)timeGetTime_hooked);
		break;
	}
	return true;
}
Look at that I try to compile it and I get this error:
Code:
Cannot open include file: 'detours.h': No such file or directory
... So you know what I do? I add the directory... >_>






I compile it again and guess what? Now I get all of these errors:
Code:
1>------ Build started: Project: Speedhack2, Configuration: Debug Win32 ------
1>Compiling...
1>dllmain.cpp
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(7) : error C3646: 'DWORD' : unknown override specifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(7) : error C3646: 'oldtick' : unknown override specifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(7) : error C2072: 'QPC_hooked' : initialization of a function
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(7) : error C2440: 'initializing' : cannot convert from 'int' to 'bool (LARGE_INTEGER *)'
1>        There are no conversions to function types, although there are conversions to references or pointers to functions
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(10) : error C3646: 'DWORD' : unknown override specifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(10) : error C3646: 'oldtGT' : unknown override specifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(10) : error C2072: 'GetTickCount_hooked' : initialization of a function
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(10) : error C2440: 'initializing' : cannot convert from 'int' to 'DWORD (void)'
1>        There are no conversions to function types, although there are conversions to references or pointers to functions
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(14) : error C2065: 'oldtGT' : undeclared identifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(16) : error C2065: 'oldtGT' : undeclared identifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(17) : error C2065: 'oldtGT' : undeclared identifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(27) : warning C4244: '=' : conversion from 'double' to 'DWORD', possible loss of data
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(32) : warning C4244: '=' : conversion from 'double' to 'DWORD', possible loss of data
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(35) : error C2065: 'oldtGT' : undeclared identifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(37) : error C2065: 'oldtGT' : undeclared identifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(40) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(67) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(124) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [13]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(124) : error C3861: 'DetourFunction': identifier not found
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(125) : error C2065: 'QPC_orig' : undeclared identifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(125) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [13]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(125) : error C3861: 'DetourFunction': identifier not found
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(126) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [10]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(126) : error C3861: 'DetourFunction': identifier not found
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(128) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [13]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(128) : error C3861: 'DetourRemove': identifier not found
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(129) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [13]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(129) : error C3861: 'DetourRemove': identifier not found
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(130) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [10]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(130) : error C3861: 'DetourRemove': identifier not found
1>Build log was saved at "file://c:\Users\Shaun\Documents\Visual Studio 2008\Projects\Speedhack2\Speedhack2\Debug\BuildLog.htm"
1>Speedhack2 - 28 error(s), 2 warning(s)
So now the type names don't even exist >_> wth?!

Do you want to know what's really weird? If I include detours before windows I get an entirely new set of errors o_O:
Code:
1>------ Build started: Project: Speedhack2, Configuration: Debug Win32 ------
1>Compiling...
1>dllmain.cpp
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(34) : error C2146: syntax error : missing ';' before identifier 'Data1'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(34) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(34) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(35) : error C2146: syntax error : missing ';' before identifier 'Data2'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(36) : error C2146: syntax error : missing ';' before identifier 'Data3'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(37) : error C2146: syntax error : missing ';' before identifier 'Data4'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(37) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(37) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(85) : error C2146: syntax error : missing ';' before identifier 'cbHeaderSize'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(85) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(85) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(86) : error C2146: syntax error : missing ';' before identifier 'nSignature'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(86) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(86) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(87) : error C2146: syntax error : missing ';' before identifier 'nDataOffset'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(87) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(87) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(88) : error C2146: syntax error : missing ';' before identifier 'cbDataSize'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(88) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(88) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(90) : error C2146: syntax error : missing ';' before identifier 'nOriginalImportVirtualAddress'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(90) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(90) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(91) : error C2146: syntax error : missing ';' before identifier 'nOriginalImportSize'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(91) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(91) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(92) : error C2146: syntax error : missing ';' before identifier 'nOriginalBoundImportVirtualAddress'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(92) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(92) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(93) : error C2146: syntax error : missing ';' before identifier 'nOriginalBoundImportSize'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(93) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(93) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(95) : error C2146: syntax error : missing ';' before identifier 'nOriginalIatVirtualAddress'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(95) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(95) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(96) : error C2146: syntax error : missing ';' before identifier 'nOriginalIatSize'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(96) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(96) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(97) : error C2146: syntax error : missing ';' before identifier 'nOriginalSizeOfImage'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(97) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(97) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(98) : error C2146: syntax error : missing ';' before identifier 'cbPrePE'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(98) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(98) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(100) : error C2146: syntax error : missing ';' before identifier 'nOriginalClrFlags'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(100) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(100) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(101) : error C2146: syntax error : missing ';' before identifier 'reserved1'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(101) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(101) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(102) : error C2146: syntax error : missing ';' before identifier 'reserved2'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(102) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(102) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(103) : error C2146: syntax error : missing ';' before identifier 'reserved3'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(103) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(103) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(110) : error C2146: syntax error : missing ';' before identifier 'cbBytes'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(110) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(110) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(111) : error C2146: syntax error : missing ';' before identifier 'nReserved'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(111) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(111) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(118) : error C2146: syntax error : missing ';' before identifier 'cb'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(118) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(118) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(119) : error C2146: syntax error : missing ';' before identifier 'MajorRuntimeVersion'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(119) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(119) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(120) : error C2146: syntax error : missing ';' before identifier 'MinorRuntimeVersion'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(120) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(120) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(123) : error C2146: syntax error : missing ';' before identifier 'MetaData'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(123) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(123) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(124) : error C2146: syntax error : missing ';' before identifier 'Flags'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(124) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(124) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(131) : error C2146: syntax error : missing ';' before identifier 'cb'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(131) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(131) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(133) : error C2146: syntax error : missing ';' before identifier 'pidh'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(133) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(133) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(134) : error C2146: syntax error : missing ';' before identifier 'pinh'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(134) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(134) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(135) : error C2146: syntax error : missing ';' before identifier 'pclrFlags'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(135) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(135) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(136) : error C2146: syntax error : missing ';' before identifier 'impDirProt'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(136) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(136) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(138) : error C2146: syntax error : missing ';' before identifier 'idh'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(138) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(138) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(139) : error C2146: syntax error : missing ';' before identifier 'inh'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(139) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(139) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(140) : error C2146: syntax error : missing ';' before identifier 'clrFlags'
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(140) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(140) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(165) : error C2065: 'CALLBACK' : undeclared identifier
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(165) : error C2065: 'PF_DETOUR_BINARY_BYWAY_CALLBACK' : undeclared identifier
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(165) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft research\detours express 2.1\src\detours.h(165) : fatal error C1903: unable to recover from previous error(s); stopping compilation
1>Build log was saved at "file://c:\Users\Shaun\Documents\Visual Studio 2008\Projects\Speedhack2\Speedhack2\Debug\BuildLog.htm"
1>Speedhack2 - 109 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
It's as if the types don't even exist.

Please help me.
#1 · edited 16y ago · 16y ago
BO
BooYa
Well u need something in ur detours.h file, cause there's no point in including it if it's empty.

What compiler did u use? Visual C++ 2008?
#2 · 16y ago
why06
why06
Quote Originally Posted by BooYa View Post
Well u need something in ur detours.h file, cause there's no point in including it if it's empty.

What compiler did u use? Visual C++ 2008?
Well ofcourse that's why I downloaded Detours 2.1 Express Edition SDK

And yeh VC++08.
#3 · 16y ago
Hell_Demon
Hell_Demon
When it comes to anything released by microsoft: old files > new files.

Detours 1.5 > Detours 2.1
Windows XP > Windows 7 > Windows Vista

could go on and on listing stuff of which the old ones own the new ones.


Attached is detours 1.5
#4 · 16y ago
why06
why06
Wow. I think that might have actually worked. Now I just need to fix all the other errors xD. But atleast that got the include file working working. Thanks HD. And I await ur tut on DLL's. I will have to make you really bored and not post at all this weekend :P
#5 · 16y ago
Hell_Demon
Hell_Demon
Quote Originally Posted by why06 View Post
Now I just need to fix all the other errors xD
Post errors pl0x

Quote Originally Posted by why06 View Post
Thanks HD. And I await ur tut on DLL's. I will have to make you really bored and not post at all this weekend :P
That sir, would really make me sad! I might jump infront of a parked car if you do that
#6 · 16y ago
ZE
zeco
Is detours 1.5 only those 2 things? I downloaded 2.1 a while before but had'nt actually used/tested it
#7 · 16y ago
why06
why06
Revised source:
Code:
#include <windows.h>
#include <detours.h>

bool speedhacking = false;
bool (__stdcall *QPG_orig)(LARGE_INTEGER *lp);

DWORD oldtick=0;
DWORD (WINAPI *GetTickCount_orig)(void);

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; 
}
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 __stdcall QPC_hooked(LARGE_INTEGER *lp) 
{ 
	static __int64 oldfake = 0;
	static __int64 oldreal = 0;
	__int64 factor;

	__int64 newvalue;
	int ret;

	if( oldfake == 0 || oldreal == 0 )
	{
		oldfake = lp->QuadPart;
		oldreal = lp->QuadPart;
	}

	ret = (*QPC_orig)(lp);

	newvalue  = lp->QuadPart;

	if(speedhacking == 1)
	{
		//factor = 2.0;
		factor = 3.0;
		//factor = 5.0;
	}
	else
	{
		factor = 1.0;
	}

	newvalue = oldfakevalue + (__int64)((newvalue - oldrealvalue) * tempfactor);

	oldrealvalue = lp->QuadPart;
	oldfakevalue = newvalue;

	lp->QuadPart = newvalue;
	return ret; 
}

void KeyHooks(void)
{
	while(1)
	{
		while(GetAsyncKeyState(0x52)&1)
		{
			speedhacking = true; // Controls all speed hacks
		}		
		Sleep(100);
	}
}

bool APIENTRY DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
	switch(dwReason)
	{
	case DLL_PROCESS_ATTACH:
		DisableThreadLibraryCalls(hDll);
		CreateThread(0,0, (LPTHREAD_START_ROUTINE)KeyHooks, 0, 0, 0);
		GetTickCount_orig = (DWORD (__stdcall *)(void))DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("Kernel32.dll"), "GetTickCount"), (PBYTE)GetTickCount_hooked);
		QPC_orig = (bool (__stdcall*)(LARGE_INTEGER*))DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("kernel32.dll"), "QueryPerformanceCounter"), (PBYTE)QPC_hooked);
		timeGetTime_orig = (DWORD (__cdecl *)(void))DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("winmm.dll"), "timeGetTime"), (PBYTE)timeGetTime_hooked);
	case DLL_PROCESS_DETACH:
		DetourRemove((PBYTE)GetProcAddress(GetModuleHandle("kernel32.dll"), "QueryPerformanceCounter"), (PBYTE)QPC_hooked);
		DetourRemove((PBYTE)GetProcAddress(GetModuleHandle("Kernel32.dll"), "GetTickCount"), (PBYTE)GetTickCount_hooked);
		DetourRemove((PBYTE)GetProcAddress(GetModuleHandle("winmm.dll"), "timeGetTime"), (PBYTE)timeGetTime_hooked);
		break;
	}
	return true;
}
Current errors:
Code:
1>------ Build started: Project: Speedhack2, Configuration: Debug Win32 ------
1>Compiling...
1>dllmain.cpp
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(28) : warning C4244: '=' : conversion from 'double' to 'DWORD', possible loss of data
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(33) : warning C4244: '=' : conversion from 'double' to 'DWORD', possible loss of data
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(56) : warning C4244: '=' : conversion from 'double' to 'DWORD', possible loss of data
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(61) : warning C4244: '=' : conversion from 'double' to 'DWORD', possible loss of data
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(84) : error C2065: 'QPC_orig' : undeclared identifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(91) : warning C4244: '=' : conversion from 'double' to '__int64', possible loss of data
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(96) : warning C4244: '=' : conversion from 'double' to '__int64', possible loss of data
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(99) : error C2065: 'oldfakevalue' : undeclared identifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(99) : error C2065: 'oldrealvalue' : undeclared identifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(99) : error C2065: 'tempfactor' : undeclared identifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(101) : error C2065: 'oldrealvalue' : undeclared identifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(102) : error C2065: 'oldfakevalue' : undeclared identifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(105) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(127) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [13]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(128) : error C2065: 'QPC_orig' : undeclared identifier
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(128) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [13]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(129) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [10]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(131) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [13]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(132) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [13]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\users\shaun\documents\visual studio 2008\projects\speedhack2\speedhack2\dllmain.cpp(133) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [10]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Build log was saved at "file://c:\Users\Shaun\Documents\Visual Studio 2008\Projects\Speedhack2\Speedhack2\Debug\BuildLog.htm"
1>Speedhack2 - 13 error(s), 7 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#8 · 16y ago
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

  • [RELEASE] Invisible With SpeedHackBy quin123 in WarRock - International Hacks
    26Last post 19y ago
  • help with speedhackBy crusader1 in Combat Arms Hacks & Cheats
    4Last post 18y ago
  • Help with speedhack!By Ragehax in Combat Arms Hacks & Cheats
    1Last post 17y ago
  • help with speedhackBy mongoose5697 in Combat Arms Help
    19Last post 17y ago
  • Fraps with speedhack :lBy shawnyboi15 in Combat Arms Help
    1Last post 17y ago

Tags for this Thread

#speedhack#tinkering