Advertisement
rdsedmundo

paciencia spider.cpp

May 31st, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.43 KB | None | 0 0
  1. // FirstHack.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <Windows.h>
  6.  
  7. int _tmain(int argc, _TCHAR* argv[])
  8. {
  9.     printf("Pacient Spider hacker.\n");
  10.  
  11.     HWND Proc = FindWindow(0, L"PaciΓͺncia Spider");
  12.    
  13.     if(Proc == 0) {
  14.         printf("Error: Window not found\n");
  15.         return 0;
  16.     }
  17.         printf("Game found: running\n");
  18.  
  19.     DWORD proc_Id;
  20.     GetWindowThreadProcessId(Proc, &proc_Id);
  21.  
  22.     HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_Id);
  23.  
  24.     if(!hProc) {
  25.         printf("I couldn't open the process for hacking.\n");
  26.         return 0;
  27.     } else {
  28.         printf("Process memory opened\n");
  29.     }
  30.  
  31.     DWORD Pointer = 0x0012E1B8, Pointed;
  32.     WORD Offset = 0x0014;
  33.  
  34.     int CurrentPoints = 0, newVal = 0;
  35.    
  36.     while(1) {
  37.         int ACT;
  38.         printf("1- View score\n2- Change score\n3- Exit");
  39.         scanf("%d", &ACT);
  40.  
  41.         switch(ACT) {
  42.         case 1:
  43.                 ReadProcessMemory(hProc, (LPCVOID)(Pointer), &Pointed, 4, NULL);
  44.                 ReadProcessMemory(hProc, (LPCVOID)(Pointed+Offset), &CurrentPoints, 4, NULL);
  45.  
  46.                 printf("Score: %d\n", CurrentPoints);
  47.  
  48.                 system("pause");
  49.                 break;
  50.         case 2:
  51.                 ReadProcessMemory(hProc, (LPCVOID)(Pointer), &Pointed, 4, NULL);
  52.                 printf("Type the new value: ");
  53.                 scanf("%d", &newVal);
  54.                 WriteProcessMemory(hProc, (LPVOID)(Pointed+Offset), &newVal, (DWORD)sizeof(newVal), NULL);
  55.  
  56.                 system("pause");
  57.                 break;
  58.         case 3:
  59.                 exit(1);
  60.         default:
  61.             continue;
  62.         }
  63.     }
  64.     return 0;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement