Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <windows.h>
  3. #include <tchar.h>
  4. #include "hook.h"
  5.  
  6. void FuckOffMinesweeper();
  7. void StartMagic();
  8.  
  9. const TCHAR *g_szPrintf = _T("Not here.\n");
  10. DWORD *dwTimeGame = NULL;
  11.  
  12. BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) {
  13.     if (dwReason == DLL_PROCESS_ATTACH) {
  14.         AllocConsole();
  15.         freopen("CONOUT$", "w", stdout);
  16.        
  17.         printf("FuckOffMinesweeper enable\n\n");
  18.         FuckOffMinesweeper();
  19.     }
  20.  
  21.     return TRUE;
  22. }
  23.  
  24. void FuckOffMinesweeper() {
  25.     DWORD dwAddrMinesweeper = (DWORD) GetModuleHandle(NULL);
  26.  
  27.     /*0100319B    8802            MOV BYTE PTR DS:[EDX],AL*/
  28.     HookInMemory(0xE9, NULL, NULL, dwAddrMinesweeper + 0x319B, (DWORD) StartMagic, NULL);
  29. }
  30.  
  31. __declspec (naked) void StartMagic() {
  32.     __asm {
  33.         pushad
  34.         cmp al, 0x80
  35.         jne done
  36.         push g_szPrintf
  37.         call wprintf
  38.         add esp, 0x04
  39.         done:
  40.         popad
  41.         mov byte ptr ds:[edx], al
  42.         retn 8
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement