I want to be able to read and write from another process's memory. I called the functions Readprocessmemory()
and WriteProcessmemory()
from Kernel32.dll
and I used the GetProcessByName()
function to look for the process. This succeeds.
I saw the example for taking the readprocessmemory()
function and declare it after I call it from kernel32.dll
, but I do not understand how it works - how do I use the function to read from another process? I would appreciate an example.
In order to read and write memory to another process you need to use the ReadProcessMemory and WriteProcessMemory functions provided by kernel32. If you are using C# you will need to use PInvoke to import these functions into your current process.
More generally, what you need to do is this:
Once this is done you can look at your local buffer and you'll see data that used to be in the foreign process, and life will be good.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.