Results 1 to 8 of 8
  1. #1
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty

    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.
    Last edited by why06; 10-01-2009 at 10:02 AM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  2. #2
    BooYa's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    hre
    Posts
    111
    Reputation
    10
    Thanks
    19
    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?

  3. #3
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    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.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  4. #4
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    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
    Ah we-a blaze the fyah, make it bun dem!

  5. The Following User Says Thank You to Hell_Demon For This Useful Post:

    why06 (10-01-2009)

  6. #5
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    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

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  7. #6
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    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
    Ah we-a blaze the fyah, make it bun dem!

  8. #7
    zeco's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    683
    Reputation
    12
    Thanks
    78
    My Mood
    Cynical
    Is detours 1.5 only those 2 things? I downloaded 2.1 a while before but had'nt actually used/tested it

  9. #8
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    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 ==========

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

Similar Threads

  1. Fraps with speedhack :l
    By shawnyboi15 in forum Combat Arms Help
    Replies: 1
    Last Post: 09-05-2009, 11:36 AM
  2. help with speedhack
    By mongoose5697 in forum Combat Arms Help
    Replies: 19
    Last Post: 09-03-2009, 06:01 PM
  3. Help with speedhack!
    By Ragehax in forum Combat Arms Hacks & Cheats
    Replies: 1
    Last Post: 08-03-2009, 11:58 PM
  4. help with speedhack
    By crusader1 in forum Combat Arms Hacks & Cheats
    Replies: 4
    Last Post: 08-06-2008, 11:10 PM
  5. [RELEASE] Invisible With SpeedHack
    By quin123 in forum WarRock - International Hacks
    Replies: 26
    Last Post: 11-02-2006, 06:33 PM

Tags for this Thread