public static byte[] ReadRawMemory(this Process process, ulong memoryPointer, int size) { byte[] buffer = new byte[size]; if (!NT.ReadProcessMemory(process.Handle, memoryPointer, buffer, buffer.Length, 0)) { throw new Exception($"ReadRawMemory - ReadProcessMemory() failed - {Marshal.GetLastWin32Error().ToString("x2")}"); } return(buffer); }