Solved How to hook GetTickCount()

Hexui Undetected CSGO Cheats PUBG Accounts

uNdead

Newbie
Full Member
Jan 6, 2013
16
468
0
Hey Guys, I tried to hook the the GetTickCount() function, so I can create a little speedhack (not for a online game) ;)

The Problem is that the DLL Injection works and I get the message that its attached but the Detour don't work :/ I never done anything like that because I normally only write external stuff xD does anybody know what I done wrong?

C++:
DWORD	WINAPI GetTickCount_Detour(void);								
DWORD	INITTICK = GetTickCount();

DETOUR_TRAMPOLINE(DWORD WINAPI GetTickCount_Trampoline(void),GetTickCount);	
								
BOOL APIENTRY DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
{
	switch(ul_reason_for_call)
	{
		case DLL_PROCESS_ATTACH:
			// WORKS
			MessageBox(NULL, "ATTACHED", NULL, MB_OK);
			DisableThreadLibraryCalls(hModule);
	        DetourFunction((PBYTE)GetTickCount_Trampoline,(PBYTE)GetTickCount_Detour);
		break;

		case DLL_PROCESS_DETACH:
		   MessageBox(NULL, "DETACHED", NULL, MB_OK);
	       DetourRemove((PBYTE)GetTickCount_Trampoline,(PBYTE)GetTickCount_Detour);
			
		break;
	}
	return true;
}

DWORD WINAPI GetTickCount_Detour()
{	
	// NEVER COMES TO THIS POINT
	MessageBox(NULL, "DETOUR", NULL, MB_OK);

    DWORD CURRENTTICK = GetTickCount_Trampoline();

	return ( INITTICK + (CURRENTTICK - INITTICK) * 250 );

}
PASTEBIN LINK

Thx ;)
 
Last edited:

ndani14

Nick
Dank Tier Donator
Nobleman
Aug 27, 2012
52
708
1
it looks ok, how are you doing the hook in DetourFunction?
 

ndani14

Nick
Dank Tier Donator
Nobleman
Aug 27, 2012
52
708
1
yeah the rest looks ok, so there might be something wrong in that?
 
Community Mods