BolterV2.SigScan.DumpMemory C# (CSharp) Method

DumpMemory() private method

DumpMemory Internal memory dump function that uses the set class properties to dump a memory region.
private DumpMemory ( ) : bool
return bool
        private bool DumpMemory()
        {
            try
            {
                // Checks to ensure we have valid data.
                if (m_vProcess == null)
                    return false;
                if (m_vProcess.HasExited == true)
                    return false;
                if (m_vAddress == IntPtr.Zero)
                    return false;
                if (m_vSize == 0)
                    return false;

                // Create the region space to dump into.
                m_vDumpedRegion = new byte[m_vSize];

                var bReturn = false;
                var nBytesRead = 0;

                // Dump the memory.
                bReturn = ReadProcessMemory(
                    m_vProcess.Handle, m_vAddress, m_vDumpedRegion, m_vSize, out nBytesRead
                    );

                // Validation checks.
                if (bReturn == false || nBytesRead != m_vSize)
                    return false;
                return true;
            }
            catch
            {
                return false;
            }
        }