#include <iostream>
#include <windows.h>
#include <Windows.h>
// FindWindows();
// GetWindowThreadProcessId();
// OpenProcess();
//WriteProcessMemory();
using namespace std;
int main()
{
int newValue = 500;
HWND hWnd = FindWindow(0, "ac_Clinet");
if (hWnd == 0) {
cerr << ("Cannot find file") << endl;
}
else {
DWORD pId;
GetWindowThreadProcessId(hWnd, &pId);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);
if (!hProc) {
cerr << ("Cannot open Process") << endl;
}
else
{
int isSussessful = WriteProcessMemory(hProc, (LPVOID)0X00EDA5D8, &newValue, (DWORD)sizeof(newValue), NULL);
if (isSussessful > 0)
{
clog << "Process Memory Written." << endl;
}
else
{
cerr << ("Cannot Write Process Memory.") << endl;
}
CloseHandle(hProc);
}
}
return 0;
}