Guest User

Untitled

a guest
Apr 25th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. #include <windows.h>
  2. // #include <winbase.h>
  3. // #include <mmsystem.h>
  4. #include "detours.h"
  5. #pragma comment (lib, "winmm.lib")
  6. DWORD WINAPI GetTickCount_Detour(void);
  7. typedef DWORD ( WINAPI * tGetTickCount )();
  8. tGetTickCount oGetTickCount = 0;
  9.  
  10. //DETOUR_TRAMPOLINE(DWORD WINAPI GetTickCount_Trampoline(void), GetTickCount);
  11. //set up our trampolines
  12.  
  13. BOOL APIENTRY DllMain( HANDLE hModule, DWORD reason, LPVOID lpReserved)
  14. {
  15. if (reason == DLL_PROCESS_ATTACH){
  16. DisableThreadLibraryCalls(GetModuleHandle(NULL));
  17. oGetTickCount = (tGetTickCount)DetourFunction( (PBYTE)GetTickCount, (PBYTE)GetTickCount_Detour );
  18. // DetourFunction((PBYTE)GetTickCount,(PBYTE)oGetTickCount);
  19. // DetourFunctionWithTrampoline((PBYTE)GetTickCount_Trampoline, (PBYTE)GetTickCount_Detour);
  20.  
  21. MessageBox(NULL,"Success.","DEBUG",0);
  22. }
  23.  
  24. return true;
  25. }
  26.  
  27. DWORD WINAPI GetTickCount_Detour(){
  28. DWORD ret = oGetTickCount();
  29. return ret;
  30. }
Add Comment
Please, Sign In to add comment