Exemple #1
0
        /// <summary>
        ///     Converts the specified information.
        /// </summary>
        /// <param name="info">The information.</param>
        /// <returns>IPdbInfo.</returns>
        public IPdbInfo Convert(ClrMd.PdbInfo info)
        {
            if (info == null)
            {
                return(null);
            }
            var item = new PdbInfoAdapter(this, info);

            return(Cache.GetOrAdd <IPdbInfo>(info, () => item, () => item.Setup()));
        }
Exemple #2
0
        private void InitData()
        {
            if (_dataReader == null)
            {
                return;
            }

            if (_pdb != null && _managed != null)
            {
                return;
            }

            PEFile file = null;

            try
            {
                file = PEFile.TryLoad(new ReadVirtualStream(_dataReader, (long)ImageBase, (long)FileSize), true);
                if (file == null)
                {
                    return;
                }

                _managed = file.Header.ComDescriptorDirectory.VirtualAddress != 0;

                if (file.GetPdbSignature(out string pdbName, out Guid guid, out int age))
                {
                    _pdb = new PdbInfo()
                    {
                        FileName = pdbName,
                        Guid     = guid,
                        Revision = age
                    };
                }
            }
            catch
            {
            }
            finally
            {
                if (file != null)
                {
                    file.Dispose();
                }
            }
        }
Exemple #3
0
        private void InitData()
        {
            if (_dataReader == null)
                return;

            if (_pdb != null && _managed != null)
                return;

            PdbInfo pdb = null;
            PEFile file = null;
            try
            {
                file = PEFile.TryLoad(new ReadVirtualStream(_dataReader, (long)ImageBase, (long)FileSize), true);
                if (file == null)
                    return;

                _managed = file.Header.ComDescriptorDirectory.VirtualAddress != 0;

                string pdbName;
                Guid guid;
                int age;
                if (file.GetPdbSignature(out pdbName, out guid, out age))
                {
                    pdb = new PdbInfo();
                    pdb.FileName = pdbName;
                    pdb.Guid = guid;
                    pdb.Revision = age;
                    _pdb = pdb;
                }
            }
            catch
            {
            }
            finally
            {
                if (file != null)
                    file.Dispose();
            }
        }