ReadProcessMemory() private method

private ReadProcessMemory ( IntPtr hProcess, IntPtr lpBaseAddress, [ buffer, UInt32 size, IntPtr &lpNumberOfBytesRead ) : Int32
hProcess System.IntPtr
lpBaseAddress System.IntPtr
buffer [
size System.UInt32
lpNumberOfBytesRead System.IntPtr
return System.Int32
コード例 #1
0
ファイル: MemoryReader.cs プロジェクト: zappybiby/SimShift
        public virtual bool Read(int memoryAddress, byte[] buffer)
        {
            if (Diagnostic)
            {
                _readCalls++;
            }
            IntPtr ptrBytesReaded;

            MemoryReaderApi.ReadProcessMemory(m_hProcess, (IntPtr)memoryAddress, buffer, (uint)buffer.Length, out ptrBytesReaded);
            return((int)ptrBytesReaded == buffer.Length);
        }
コード例 #2
0
ファイル: MemoryReader.cs プロジェクト: zappybiby/SimShift
        public virtual byte[] Read(IntPtr memoryAddress, uint bytesToRead)
        {
            if (Diagnostic)
            {
                _readCalls++;
            }
            IntPtr ptrBytesReaded;
            var    buffer = new byte[bytesToRead];

            MemoryReaderApi.ReadProcessMemory(m_hProcess, memoryAddress, buffer, bytesToRead, out ptrBytesReaded);
            return(buffer);
        }