Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- // #include <winbase.h>
- // #include <mmsystem.h>
- #include "detours.h"
- #pragma comment (lib, "winmm.lib")
- DWORD WINAPI GetTickCount_Detour(void);
- typedef DWORD ( WINAPI * tGetTickCount )();
- tGetTickCount oGetTickCount = 0;
- //DETOUR_TRAMPOLINE(DWORD WINAPI GetTickCount_Trampoline(void), GetTickCount);
- //set up our trampolines
- BOOL APIENTRY DllMain( HANDLE hModule, DWORD reason, LPVOID lpReserved)
- {
- if (reason == DLL_PROCESS_ATTACH){
- DisableThreadLibraryCalls(GetModuleHandle(NULL));
- oGetTickCount = (tGetTickCount)DetourFunction( (PBYTE)GetTickCount, (PBYTE)GetTickCount_Detour );
- // DetourFunction((PBYTE)GetTickCount,(PBYTE)oGetTickCount);
- // DetourFunctionWithTrampoline((PBYTE)GetTickCount_Trampoline, (PBYTE)GetTickCount_Detour);
- MessageBox(NULL,"Success.","DEBUG",0);
- }
- return true;
- }
- DWORD WINAPI GetTickCount_Detour(){
- DWORD ret = oGetTickCount();
- return ret;
- }
Add Comment
Please, Sign In to add comment