[C#] Read/Write Process Memory


Class File: Download

Address String: [Module Name] + [Base Address] + [Offset 1] + [Offset 2] + ...
Example: "Game.exe"+001023AF+28+A0

Guide:

   • Declare:
[Namespace].Memory memory = new [Namespace].Memory( [Process] );
   • Get Address:
IntPtr address = memory.GetAddress( [Address String] );
IntPtr address = memory.GetAddress( [Base Address] , int[] [offset] );
IntPtr address = memory.GetAddress( [Module Name] , [Base Address] , int[] [offset] );
   • Read Value:
uint Value = memory.ReadUInt32(address);
or
int Value = memory.ReadInt32(address);
   • Write Value:
uint value = 123;
memory.WriteUInt32(address, value);
or
int value = 123;
memory.WriteInt32(address, value);

Demo:
Process[] proclist = Process.GetProcessesByName("Game");
if (proclist.Length > 0)
{
   ReadWriteMemory.Memory memory = new ReadWriteMemory.Memory(proclist[0]);
   IntPtr address = memory.GetAddress("\"Game\"+001023AF+28+A0");
   MessageBox.Show(memory.ReadUInt32(address).ToString());
   uint NewValue = 123;
   memory.WriteUInt32(address, NewValue);
}