public Memory(Process process) { if (process == null) { throw new InvalidOperationException("Process is invalid."); } this.processHandle = SystemWin32.OpenProcess(SystemWin32.PROCESS_ALL_ACCESS, false, process.Id); }
public bool Write(IntPtr address, byte[] buffer) { return(SystemWin32.WriteProcessMemory(processHandle, address, buffer, buffer.Length, ref lastOpProcessedBytes)); }
public byte[] Read(IntPtr address, Int32 size) { byte[] buffer = new byte[size]; SystemWin32.ReadProcessMemory(processHandle, address, buffer, buffer.Length, ref lastOpProcessedBytes); return(buffer); }