const int PROCESS_WM_READ = 0x0010;
[DllImport("kernel32.dll")]
static extern bool ReadProcessMemory(int hProcess, Int64 lpBaseAddress, byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesRead);
Process P = Process.GetProcessesByName(ProcessName)[0]; // Process
IntPtr PH = OpenProcess(PROCESS_WM_READ, false, P.Id); // ProcessHandle
IntPTr BA = P.MainModule.BaseAddress; // BaseAddress
int bytesRead = 0; // Keep track of how many bytes we've read
byte[] buffer = new byte[4]; // Prepare a byte array which we'll populate as we read
ReadProcessMemory((int) this.PH , 0x2445BC56E00, buffer, buffer.Length, ref bytesRead);
Console.WriteLine(BitConverter.ToString(buffer));
>>
54-B1-01-00
const int PROCESS_WM_READ = 0x0010;
[DllImport("kernel32.dll")]
static extern bool ReadProcessMemory(int hProcess, Int64 lpBaseAddress, byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesRead);
Process P = Process.GetProcessesByName(ProcessName)[0]; // Process
IntPtr PH = OpenProcess(PROCESS_WM_READ, false, P.Id); // ProcessHandle
IntPTr BA = P.MainModule.BaseAddress; // BaseAddress
int bytesRead = 0; // Keep track of how many bytes we've read
byte[] buffer = new byte[4]; // Prepare a byte array which we'll populate as we read
ReadProcessMemory((int) this.PH , 0x2445BC56E00, buffer, buffer.Length, ref bytesRead);
Console.WriteLine(BitConverter.ToString(buffer));
>>
54-B1-01-00