Guest User

Untitled

a guest
Feb 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #include <windows.h>
  2. using namespace System;
  3.  
  4. #include <iostream>
  5. #include <conio.h>
  6. #define WIN32_LEAN_AND_MEAN
  7. #pragma comment( lib, "Msimg32.lib" )
  8. #pragma comment(lib, "user32.lib")
  9. using namespace std;
  10.  
  11.  
  12. void main()
  13. {
  14. DWORD money = 0xB7CE50;
  15. DWORD address1 = 0x00B6F5F0;
  16. DWORD offset = 0x540;
  17. DWORD address2;
  18. int value = 0;
  19. DWORD pid;
  20. HWND hwnd;
  21. hwnd = FindWindow(NULL,L"GTA:SA:MP");
  22. if(!hwnd)
  23. {
  24. cout <<"Window not found!\n";
  25. cin.get();
  26. }
  27. else
  28. {
  29. GetWindowThreadProcessId(hwnd,&pid);
  30. HANDLE phandle = OpenProcess(PROCESS_VM_READ,0,pid);
  31. if(!phandle)
  32. {
  33. cout <<"Could not get handle!\n";
  34. cin.get();
  35. }
  36. else
  37. {
  38. while(1)
  39. {
  40. ReadProcessMemory(phandle,(void*)money,&value,sizeof(value),0);
  41. cout << value << "\n";
  42. ReadProcessMemory(phandle,(void*)address1,&address2,sizeof(long),0);
  43. address2 = address2+offset ;
  44. ReadProcessMemory(phandle, (void*)address2, &value, sizeof(int),0);
  45. cout << value << "\n";
  46. Sleep(1000);
  47. }
  48. }
  49. }
  50. }
Add Comment
Please, Sign In to add comment