I have an address that I would like to modify. I have the process. I have the new value. So now what?
// My Process
var p = Process.GetProcessesByName("ePSXe").FirstOrDefault();
// Address
var addr = 0x00A66E11;
// Value
var val = 0x63;
How can I write 0x63
(99) to this address on another process memory?
@Harvey, from your answer I dug up and found a lot:
Open, Close and Write signatures:
Flags:
Make my life easier method:
Writing into another process memory:
Despite P/Invoke native functions such as
WriteProcessMemory
works perfectly, libraries dedicated to memory editing exist and enables you to accomplish this task in an easier way.Using the library MemorySharp, this can be summarized as:
The previous code assumes the address where the value is written is not rebased.
You can use WriteProcessMemory, but be aware that you need to turn on debug privileges, and that it won't work with lots of secured processes in Vista and later.
And that you'll probably shoot yourself in the foot and crash things a few times. I suggest you don't have any important programs running when you do this.
Good luck, you'll need it. :)
Check out WriteProcessMemory at pinvoke.net
Here is another similar post on StackOverflow but they are talking about C++. You can do the same using pinvoke.