Original Post
I want to change the programme when he run.
To do it I use SDK fonction but i can read the progamme that run but I can write on it can you tell me why.
this is some of the code
char tab[100];
unsigned long longu;
MODULEENTRY32 me32;
HANDLE hProcess;
HWND target;
DWORD proc_id;
// get Handel to window I''m looking for => WORK
target = FindWindow(NULL, target_window);
// get id of this windows => WORK
GetWindowThreadProcessId(target, &proc_id);
//get base offset => WORK
GetProcessModule(proc_id, &me32, sizeof(MODULEENTRY32));
// ask to have all access to process => look to WORK
hProcess = OpenProcess (PROCESS_ALL_ACCESS, FALSE, proc_id);
// read some data from process => WORK
ReadProcessMemory(hProcess,(LPVOID)base_offset,tab,100,&longu);
// write somme data from process => DON''T WORK
WriteProcessMemory(hProcess, (LPVOID)(base_offset + patch_offset[c]), &patch[c], 1, NULL);
//return 998 Invalid access to memory location.
DWORD error = GetLastError();
// close handle
CloseHandle (hProcess);
So if you know why it don''t work or how I can do it tell me