예제 #1
0
        private void MemInfo(IntPtr pHandle)
        {
            IntPtr lpAddress = new IntPtr();

            while (true)
            {
                patch.MEMORY_BASIC_INFORMATION lpBuffer = new patch.MEMORY_BASIC_INFORMATION();
                if (patch.VirtualQueryEx(pHandle, lpAddress, out lpBuffer, Marshal.SizeOf((object)lpBuffer)) != 0)
                {
                    if (((int)lpBuffer.State & 4096) != 0 && ((int)lpBuffer.Protect & 256) == 0)
                    {
                        patch.MemReg.Add(lpBuffer);
                    }
                    lpAddress = new IntPtr(lpBuffer.BaseAddress.ToInt32() + lpBuffer.RegionSize.ToInt32());
                }
                else
                {
                    break;
                }
            }
        }
예제 #2
0
 protected static extern int VirtualQueryEx(IntPtr hProcess, IntPtr lpAddress, out patch.MEMORY_BASIC_INFORMATION lpBuffer, int dwLength);