in Windows, lets say I have used DLL Injection to get into another process. I have also done some screencaptures of the memory on the process I have injected into and know the location of the data I want to pull out. Lets say there is data in the other process at 0xaaaaaaaa that contains a certain value. How do I grab this value from that process so I can use it in my injecting app? Since I am injected into the process, can I just use something like memcpy?
memcpy(value, 0xaaaaaaaa, 10);
I'm assuming it's probably more involved than this?
EDIT: To the responses below, I don't see how WM_COPYDATA helps me as it is for sending data to another application, not for retrieving data FROM an existing application.
You should be able to use the ReadProcessMemory function.
See also How to write a Perl, Python, or Ruby program to change the memory of another process on Windows?