예제 #1
0
        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);
        }
예제 #2
0
        public virtual bool Close()
        {
            if (m_hProcess == null || m_hProcess == IntPtr.Zero)
            {
                return(false);
            }

            var iRetValue = ProcessMemoryReaderApi.CloseHandle(m_hProcess);

            return(iRetValue != 0);
        }
예제 #3
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);
 }
예제 #4
0
        protected void Write(IntPtr address, byte[] data)
        {
            int bytesWritten;

            ProcessMemoryReaderApi.WriteProcessMemory(m_hProcess, address, data, (UIntPtr)data.Length, out bytesWritten);
        }
예제 #5
0
 public virtual bool Open()
 {
     m_hProcess = ProcessMemoryReaderApi.OpenProcess(PROCESS_VM_READ, 0, (uint)m_ReadProcess.Id);
     return((m_hProcess == IntPtr.Zero) ? false : true);
 }