#include <iostream> #include <conio.h> #include <windows.h> using namespace std; int main() { static int base = 0x00509B74; static int health = 0xF8; const int value = 100; HWND window = FindWindow(0, ("AssaultCube")); DWORD pid = GetWindowThreadProcessId(window, &pid); HANDLE hproc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid); int localplayer; ReadProcessMemory(hproc, (LPCVOID*)(base), &localplayer, (DWORD)sizeof(int), NULL); cout << localplayer << endl; int address = localplayer + health; cout << address << endl; WriteProcessMemory(hproc, (LPCVOID*)base, &value, (DWORD)sizeof(int), NULL); _getch(); return 0; }
GetLastError()
Quote:To open a handle to another local process and obtain full access rights, you must enable the SeDebugPrivilege privilege. For more information, see Changing Privileges in a Token.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)