Results 1 to 6 of 6
  1. #1
    Nimboso's Avatar
    Join Date
    Sep 2015
    Gender
    male
    Posts
    554
    Reputation
    21
    Thanks
    2,635

    Internal speedhack - Same three hooks as Cheat Engine

    Code:
    #include <Windows.h>
    #include "detours.h"																// Version 3.0 use for this hook. Be sure to include the library and includes to your project in visual studio
    																					// Detours: https://www.microsof*****m/en-us/research/project/detours/
    
    #pragma comment(lib,"detours.lib")													// Need to include this so we can use Detours
    #pragma comment(lib,"Kernel32.lib")													// Need to include this since we're hooking QueryPerformanceCounter and GetTickCount which reside inside the Kernel32 library
    #pragma comment(lib,"Winmm.lib")													// Neet to include this since we're hooking timeGetTime which resides inside the Winmm library
    
    extern"C" {
    	static BOOL(WINAPI *originalQueryPerformanceCounter)(LARGE_INTEGER *performanceCounter) = QueryPerformanceCounter;
    	static DWORD(WINAPI *originalGetTickCount)() = GetTickCount;
    	static DWORD(WINAPI *originalTimeGetTime)() = timeGetTime;
    }
    
    HMODULE hModule;
    
    float multiplier = 2;																// Game speed multiplier
    
    LARGE_INTEGER prevLi;
    LARGE_INTEGER currentLi;
    LARGE_INTEGER falseLi;
    
    // QueryPerformanceCounter is generally what is used to calculate how much time has passed between frames. It will set the performanceCounter to the amount of micro seconds the machine has been running
    // https://msdn.microsof*****m/en-us/library/windows/desktop/ms644904(v=vs.85).aspx
    
    BOOL WINAPI newQueryPerformanceCounter(LARGE_INTEGER *counter) {
    	originalQueryPerformanceCounter(&currentLi);									// Get real current performance counter
    	falseLi.QuadPart += ((currentLi.QuadPart - prevLi.QuadPart) * multiplier);		// Add the difference between this frame and the pervious * our multiplier to our false counter variable
    	prevLi = currentLi;																// Set the previous to our current we just calculated
    
    	*counter = falseLi;																// Make sure the caller gets our fake counter value
    	return true;																	// Return true
    }
    
    
    DWORD prevTickCount;
    DWORD currentTickCount;
    DWORD falseTickCount;
    
    // GetTickCount can also be used to calculate time between frames, but is used less since it's less accurate than QueryPerformanceCounter
    // https://msdn.microsof*****m/en-us/library/windows/desktop/ms724408%28v=vs.85%29.aspx
    
    DWORD WINAPI newGetTickCount() {
    	currentTickCount = originalGetTickCount();										// Get the real current tick count
    	falseTickCount += ((currentTickCount - prevTickCount) * multiplier);			// Add the difference between this frame and the pervious * our multiplier to our false tick count variable
    	prevTickCount = currentTickCount;												// Set the previous to our current we just calculated
    
    	return falseTickCount;															// Return false tick count
    }
    
    DWORD prevTime;
    DWORD currentTime;
    DWORD falseTime;
    
    // timeGetTime can also be used to caluclate time between frames, as with GetTickCount it isn't as accurate as QueryPerformanceCounter
    // https://msdn.microsof*****m/en-us/library/windows/desktop/dd757629(v=vs.85).aspx
    
    DWORD WINAPI newTimeGetTime() {
    	currentTime = originalTimeGetTime();											// Get real current time
    	falseTime += ((currentTime - prevTime) * multiplier);							// Add the difference between this frame and the pervious * our multiplier to our false tick count variable
    	prevTime = currentTime;															// Set the previous to our current we just calculated
    
    	return falseTime;																// Return false time
    }
    
    
    void enable() {																		// Enable speedhack by hooking the 3 functions games use to keep track of time between frames 
    
    																					// Set initial values for hooked calculations
    	originalQueryPerformanceCounter(&prevLi);										// Set previous frame QueryPerformanceCounter since it hasn't been hooked yet
    	falseLi = prevLi;																// Set false value which we use to keep track of the returned value each frame
    
    	prevTickCount = originalGetTickCount();											// Set previous frame GetTickCount since it hasn't been hooked yet
    	falseTickCount = prevTickCount;													// Set false value which we use to keep track of the returned value each frame
    
    	prevTime = originalTimeGetTime();												// Set previous frame timeGetTime since it hasn't been hooked yet
    	falseTime = prevTime;															// Set false value which we use to keep track of the returned value each frame
    
    																					// Basic detours
    	DisableThreadLibraryCalls(hModule);												
    	DetourTransactionBegin();
    	DetourUpdateThread(GetCurrentThread());
    	DetourAttach(&(PVOID&)originalQueryPerformanceCounter, newQueryPerformanceCounter);
    	DetourAttach(&(PVOID&)originalGetTickCount, newGetTickCount);
    	DetourAttach(&(PVOID&)originalTimeGetTime, newTimeGetTime);
    	DetourTransactionCommit();
    }
    
    BOOL APIENTRY DllMain(HMODULE hModule,
    	DWORD ul_reason_for_call,
    	LPVOID lpReserved
    )
    {
    	switch (ul_reason_for_call)
    	{
    
    	case DLL_PROCESS_ATTACH:
    		CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)enable, NULL, 0, NULL);		// Detours the 3 functions, enabling the speed hack
    		break;
    	case DLL_PROCESS_DETACH:
    		break;
    	case DLL_THREAD_ATTACH:
    		break;
    	case DLL_THREAD_DETACH:
    		break;
    
    	}
    	return TRUE;
    }

  2. The Following 3 Users Say Thank You to Nimboso For This Useful Post:

    affe2626 (10-22-2017),Void (09-22-2017),Zaczero (08-25-2017)

  3. #2
    Zaczero's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Location
    localhost
    Posts
    3,288
    Reputation
    1517
    Thanks
    14,262
    My Mood
    Angelic
    I like this one
    Nice!
    . . . malsignature.com . . .



    [ global rules ] [ scam report ] [ image title ] [ name change ] [ anime force ]
    [ league of legends marketplace rules ] [ battlefield marketplace rules ]

    "because everytime you post a picture of anime in here
    your virginity's time increases by 1 month"
    ~Smoke 2/18/2018


    Former Staff 09-29-2018
    Battlefield Minion 07-21-2018
    Premium Seller 03-04-2018
    Publicist 12-10-2017
    League of Legends Minion 05-31-2017
    Premium 02-05-2017
    Member 10-13-2013

  4. #3
    amagooliver's Avatar
    Join Date
    Aug 2017
    Gender
    male
    Posts
    7
    Reputation
    10
    Thanks
    0
    nc one a

  5. #4
    Cambian's Avatar
    Join Date
    Dec 2016
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0
    No Idea how to use this can anyone help me i really need this im getting a lot of errors

    Severity Code Description Project File Line Suppression State
    Error (active) E0020 identifier "DetourAttach" is undefined ChetEngaine c:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 84
    Error (active) E1696 cannot open source file "detours.h" ChetEngaine c:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 2
    Error (active) E0020 identifier "DetourTransactionBegin" is undefined ChetEngaine c:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 82
    Error (active) E0020 identifier "DetourUpdateThread" is undefined ChetEngaine c:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 83
    Error (active) E0020 identifier "DetourTransactionCommit" is undefined ChetEngaine c:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 87
    Error C2065 'timeGetTime': undeclared identifier ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 13
    Warning C4305 'initializing': truncation from 'double' to 'float' ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 18
    Warning C4244 '+=': conversion from 'float' to 'LONGLONG', possible loss of data ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 29
    Warning C4244 '+=': conversion from 'float' to 'DWORD', possible loss of data ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 46
    Warning C4244 '+=': conversion from 'float' to 'DWORD', possible loss of data ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 61
    Error C3861 'DetourTransactionBegin': identifier not found ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 82
    Error C3861 'DetourUpdateThread': identifier not found ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 83
    Error C3861 'DetourAttach': identifier not found ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 84
    Error C3861 'DetourAttach': identifier not found ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 85
    Error C3861 'DetourAttach': identifier not found ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 86
    Error C3861 'DetourTransactionCommit': identifier not found ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 87

  6. #5
    Nimboso's Avatar
    Join Date
    Sep 2015
    Gender
    male
    Posts
    554
    Reputation
    21
    Thanks
    2,635
    Quote Originally Posted by Cambian View Post
    No Idea how to use this can anyone help me i really need this im getting a lot of errors

    Severity Code Description Project File Line Suppression State
    Error (active) E0020 identifier "DetourAttach" is undefined ChetEngaine c:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 84
    Error (active) E1696 cannot open source file "detours.h" ChetEngaine c:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 2
    Error (active) E0020 identifier "DetourTransactionBegin" is undefined ChetEngaine c:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 82
    Error (active) E0020 identifier "DetourUpdateThread" is undefined ChetEngaine c:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 83
    Error (active) E0020 identifier "DetourTransactionCommit" is undefined ChetEngaine c:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 87
    Error C2065 'timeGetTime': undeclared identifier ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 13
    Warning C4305 'initializing': truncation from 'double' to 'float' ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 18
    Warning C4244 '+=': conversion from 'float' to 'LONGLONG', possible loss of data ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 29
    Warning C4244 '+=': conversion from 'float' to 'DWORD', possible loss of data ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 46
    Warning C4244 '+=': conversion from 'float' to 'DWORD', possible loss of data ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 61
    Error C3861 'DetourTransactionBegin': identifier not found ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 82
    Error C3861 'DetourUpdateThread': identifier not found ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 83
    Error C3861 'DetourAttach': identifier not found ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 84
    Error C3861 'DetourAttach': identifier not found ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 85
    Error C3861 'DetourAttach': identifier not found ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 86
    Error C3861 'DetourTransactionCommit': identifier not found ChetEngaine C:\Users\pc\source\repos\ChetEngaine\ChetEngaine\C hetEngaine.cpp 87
    Learn C++ at least a little. Every line is commented and if you read it, it will tell you what you need to do.

  7. #6
    theshadowbg651's Avatar
    Join Date
    May 2018
    Gender
    female
    Posts
    3
    Reputation
    10
    Thanks
    4
    where i can have kernel32.lib file ?? pls

Similar Threads

  1. [Preview] Xtrap and Kiki's UCE hook usermode (Cheat Engine Undetected)
    By zmodteam in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 6
    Last Post: 02-23-2017, 12:25 AM
  2. [Help] Cheat Engine [speedhack.dll]
    By Happy Herbs in forum C++/C Programming
    Replies: 1
    Last Post: 08-17-2014, 07:45 AM
  3. CHEAT ENGINE SPEEDHACK PATCHED !
    By lorenzopruim in forum WolfTeam General
    Replies: 9
    Last Post: 07-02-2011, 01:19 AM
  4. [Release] Working Cheat Engine + MHS + TNT Chams + Speedhack
    By randomnamekabe in forum Combat Arms Hacks & Cheats
    Replies: 106
    Last Post: 01-08-2010, 01:45 AM
  5. [Release] WiirtuallCA Cheat Engine Hook V 1.2 [64BIT Vista/7Only]
    By Wiirtuallca in forum Combat Arms Europe Hacks
    Replies: 11
    Last Post: 12-16-2009, 05:40 PM