Oct 5, 2015 at 10:05pm UTC
hello i can simply handle process by using HANDLE hProcess = OpenProcess(stuffhere);
how can i basicly go throught all the adresses in the process and find the exactly one which is equal to the value i entered
so lets say i entered 50
then i want to find all the adresses of the process which after dereferencing contains the value 50 is this possible ?
Last edited on Oct 5, 2015 at 10:06pm UTC
Oct 5, 2015 at 10:27pm UTC
It is indeed possible.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
char getbytefromprocess(DWORD pid, uint64_t loc) {
HANDLE pHandle;
SYSTEM_INFO si;
MEMORY_BASIC_INFORMATION mbi;
LPVOID lpMem;
DWORD ret, totalRead;
pHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
if (pHandle == NULL) {
return false ; //You may want to do some error handling here
}
lpMem = (void *)loc;
char buf;
ReadProcessMemory(pHandle, lpMem, (LPVOID)(&buf), 1, &totalRead);
CloseHandle(pHandle);
return buf;
}
Last edited on Oct 5, 2015 at 10:27pm UTC
Oct 6, 2015 at 5:05pm UTC
not just one variable might containt the value so basicly i need loop? 0x0400000 to 0xFFFFFFF or smth like that?
Oct 8, 2015 at 4:34pm UTC
Windows program's memory location changes between executions, you'll have to generally either have to search for it every time or possibly start the other program as a child process.