Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- using namespace System;
- #include <iostream>
- #include <conio.h>
- #define WIN32_LEAN_AND_MEAN
- #pragma comment( lib, "Msimg32.lib" )
- #pragma comment(lib, "user32.lib")
- using namespace std;
- void main()
- {
- DWORD money = 0xB7CE50;
- DWORD address1 = 0x00B6F5F0;
- DWORD offset = 0x540;
- DWORD address2;
- int value = 0;
- float health = 0;
- DWORD pid;
- HWND hwnd;
- hwnd = FindWindow(NULL,L"GTA:SA:MP");
- if(!hwnd)
- {
- cout <<"Window not found!\n";
- cin.get();
- }
- else
- {
- GetWindowThreadProcessId(hwnd,&pid);
- HANDLE phandle = OpenProcess(PROCESS_VM_READ,0,pid);
- if(!phandle)
- {
- cout <<"Could not get handle!\n";
- cin.get();
- }
- else
- {
- while(1)
- {
- ReadProcessMemory(phandle,(void*)money,&value,sizeof(value),0);
- cout << value << "\n";
- ReadProcessMemory(phandle,(void*)address1,&address2,sizeof(long),0);
- address2 = address2+offset ;
- ReadProcessMemory(phandle, (float*)address2, &health, sizeof(float),0);
- cout << health << "\n";
- Sleep(1000);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment