Maybe this helps, it is in C# code:
[DllImport("KERNEL32.DLL")]
static extern bool WriteProcessMemory(uint hProcess, uint lpBaseAddress, byte[] lpBuffer, uint nSize, [Out] uint lpNumberOfBytesWritten);
usage:
uint BytesWritten = 0;
uint pid = 0;
uint handle = 0;
IntPtr hWnd = IntPtr.Zero;
byte[] tobe1 = {0x57, 0x89, 0x08, 0x89, 0x0D};
byte[] tobe2 = {0x97, 0x09, 0x01, 0x00, 0x50, 0x8B};
byte[] tobe3 = {0xCE, 0xE9, 0xB7, 0x5E, 0x46, 0x00};
byte[] tobe4 = {0xE9, 0x39, 0xA1, 0xB9, 0xFF};
hWnd = FindWindow(null, "[Conquer]");
GetWindowThreadProcessId(hWnd, out pid);
handle = OpenProcess(PROCESS_ALL_ACCESS, false, pid);
WriteProcessMemory(handle, 0x10976, tobe1, tobe1.Length, BytesWritten);
WriteProcessMemory(handle, 0x1097b, tobe2, tobe2.Length, BytesWritten);
WriteProcessMemory(handle, 0x10981, tobe3, tobe3.Length, BytesWritten);
WriteProcessMemory(handle, 0x476838, tobe4, tobe4.Length, BytesWritten);
CloseHandle(handle);
note.: you also nee to import OpenProcess, FindWindow, GetWindowThreadProcessId and define PROCESS_ALL_ACCESS (0x1F0FFF)
and in C++ code:
BOOL WriteProcessMemory(
HANDLE hProcess,
LPVOID lpBaseAddress,
LPCVOID lpBuffer,
SIZE_T nSize,
SIZE_T* lpNumberOfBytesWritten
);
usage:
HANDLE handle;
HWND hWnd;
DWORD pid;
DWORD BytesWritten;
BYTE tobe1[5] = {0x57, 0x89, 0x08, 0x89, 0x0D};
BYTE tobe2[6] = {0x97, 0x09, 0x01, 0x00, 0x50, 0x8B};
BYTE tobe3[6] = {0xCE, 0xE9, 0xB7, 0x5E, 0x46, 0x00};
BYTE tobe4[5] = {0xE9, 0x39, 0xA1, 0xB9, 0xFF};
hWnd = FindWindow(null, "[Conquer]");
GetwindowThreadProcessId(hWnd, &pid);
handle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
WriteProcessMemory(handle, (VOID *)0x10976, &tobe1, 5, &BytesWritten);
WriteProcessMemory(handle, (VOID *)0x1097b, &tobe2,6, &BytesWritten);
WriteProcessMemory(handle, (VOID *)0x10981, &tobe3, 6, &BytesWritten);
WriteProcessMemory(handle, (VOID *)0x476838, &tobe4, 5, &BytesWritten);
CloseHandle(handle);
note: don't forget to include windows.h oh and I'm not sure about it is &tobe or (void *)tobe, can't test it because I'm at 'work'