Guest User

Untitled

a guest
Feb 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 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. float health = 0;
  20. DWORD pid;
  21. HWND hwnd;
  22. hwnd = FindWindow(NULL,L"GTA:SA:MP");
  23. if(!hwnd)
  24. {
  25. cout <<"Window not found!\n";
  26. cin.get();
  27. }
  28. else
  29. {
  30. GetWindowThreadProcessId(hwnd,&pid);
  31. HANDLE phandle = OpenProcess(PROCESS_VM_READ,0,pid);
  32. if(!phandle)
  33. {
  34. cout <<"Could not get handle!\n";
  35. cin.get();
  36. }
  37. else
  38. {
  39. while(1)
  40. {
  41. ReadProcessMemory(phandle,(void*)money,&value,sizeof(value),0);
  42. cout << value << "\n";
  43. ReadProcessMemory(phandle,(void*)address1,&address2,sizeof(long),0);
  44. address2 = address2+offset ;
  45. ReadProcessMemory(phandle, (float*)address2, &health, sizeof(float),0);
  46. cout << health << "\n";
  47. Sleep(1000);
  48. }
  49. }
  50. }
  51. }
Add Comment
Please, Sign In to add comment