public virtual byte[] Read(IntPtr memoryAddress, uint bytesToRead) { IntPtr ptrBytesReaded; var buffer = new byte[bytesToRead]; ProcessMemoryReaderApi.ReadProcessMemory(m_hProcess, memoryAddress, buffer, bytesToRead, out ptrBytesReaded); return(buffer); }
public virtual bool Close() { if (m_hProcess == null || m_hProcess == IntPtr.Zero) { return(false); } var iRetValue = ProcessMemoryReaderApi.CloseHandle(m_hProcess); return(iRetValue != 0); }
public override bool Open() { m_hProcess = ProcessMemoryReaderApi.OpenProcess(PROCESS_VM_WRITE | PROCESS_VM_READ, 0, (uint)m_ReadProcess.Id); return(m_hProcess != IntPtr.Zero); }
protected void Write(IntPtr address, byte[] data) { int bytesWritten; ProcessMemoryReaderApi.WriteProcessMemory(m_hProcess, address, data, (UIntPtr)data.Length, out bytesWritten); }
public virtual bool Open() { m_hProcess = ProcessMemoryReaderApi.OpenProcess(PROCESS_VM_READ, 0, (uint)m_ReadProcess.Id); return((m_hProcess == IntPtr.Zero) ? false : true); }