Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- using namespace std;
- int main(int argc, char **argv)
- {
- DWORD proc_id;
- HWND window = FindWindow(0, "GTA:SA:MP");
- if (window == NULL) {
- cout << "A big problems, gta_sa.exe not found!" << endl;
- return 1;
- }
- GetWindowThreadProcessId(window, &proc_id);
- cout << "Process id: " << proc_id << endl;
- HANDLE handler = OpenProcess(PROCESS_ALL_ACCESS, true, proc_id);
- BYTE buffer = 0x0;
- SIZE_T bytes;
- int result = WriteProcessMemory(handler, (LPVOID)0xBA6794, &buffer, sizeof(buffer), &bytes);
- cout << "Result: " << result << " Writted bytes: " << bytes << endl;
- if (CloseHandle(handler)) cout << "Process handle closed" << endl;
- else cout << "Process handle not closed" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment