Here is an example in C, but it works only for 2 byte adresses:
#include <windows.h>
void WriteMem(char* window, LPCVOID address, int value)
{
HWND hWnd = FindWindow(0, window);
DWORD PID;
GetWindowThreadProcessId(hWnd, &PID);
HANDLE Process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID);
BYTE newdata[]={value};
DWORD size = sizeof(newdata);
WriteProcessMemory(Process, (LPVOID)address, &newdata, size, 0);
CloseHandle(Process);
}
int main(int argc, char *argv[])
{
HANDLE WarRock = FindWindow(NULL, "WarRock");
if (WarRock == NULL)
{
MessageBox(NULL, "Process could not be attached!\nPlease run WarRock at first and then the hack...", "WarRock is not running!", MB_ICONERROR);
return 0;
}
else{
WriteMem("WarRock", (LPCVOID)0x/* Put your adress in here */, /* and the value here */);
}
return 0;
}