示例#1
0
        private void LoadProcesses <TKey>(Func <COMProcessEntry, TKey> orderby_selector)
        {
            ConfigureSymbols();
            IEnumerable <COMProcessEntry> processes = COMUtilities.LoadProcesses(this, m_registry);

            if (processes != null && processes.Any())
            {
                OpenView(COMRegistryViewer.DisplayMode.Processes, processes.OrderBy(orderby_selector));
            }
        }
示例#2
0
 internal void LoadProcessByProcessId(int pid)
 {
     try
     {
         ConfigureSymbols();
         OpenView(COMRegistryViewer.DisplayMode.Processes,
                  COMUtilities.LoadProcesses(new int[] { pid }, this));
     }
     catch (Exception ex)
     {
         Program.ShowError(this, ex);
     }
 }
示例#3
0
        internal void LoadProcessByProcessId(int pid)
        {
            try
            {
                ConfigureSymbols();
                var processes = COMUtilities.LoadProcesses(new int[] { pid }, this, m_registry);
                if (!processes.Any())
                {
                    throw new ArgumentException(string.Format("Process {0} has not initialized COM, or is inaccessible", pid));
                }

                HostControl(new PropertiesControl(m_registry, string.Format("Process {0}", pid), processes.First()));
            }
            catch (Exception ex)
            {
                EntryPoint.ShowError(this, ex);
            }
        }
示例#4
0
 internal void LoadIPid(Guid ipid)
 {
     try
     {
         ConfigureSymbols();
         var proc = COMUtilities.LoadProcesses(new int[] { COMUtilities.GetProcessIdFromIPid(ipid) }, this).FirstOrDefault();
         if (proc != null)
         {
             COMIPIDEntry ipid_entry = proc.Ipids.Where(e => e.Ipid == ipid).FirstOrDefault();
             if (ipid_entry != null)
             {
                 HostControl(new PropertiesControl(m_registry, string.Format("IPID: {0}", ipid.FormatGuid()), ipid_entry));
             }
         }
     }
     catch (Exception ex)
     {
         Program.ShowError(this, ex);
     }
 }
示例#5
0
        private void LoadProcesses <TKey>(Func <COMProcessEntry, TKey> orderby_selector)
        {
            if (!Properties.Settings.Default.SymbolsConfigured)
            {
                if (MessageBox.Show(this, "Symbol support has not been configured, would you like to do that now?",
                                    "Configure Symbols", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    using (ConfigureSymbolsForm frm = new ConfigureSymbolsForm())
                    {
                        frm.ShowDialog(this);
                    }
                }
            }

            IEnumerable <COMProcessEntry> processes = COMUtilities.LoadProcesses(this);

            if (processes != null && processes.Count() > 0)
            {
                OpenView(COMRegistryViewer.DisplayMode.Processes, processes.OrderBy(orderby_selector));
            }
        }
示例#6
0
        static bool GenerateSymbolFile(string symbol_dir)
        {
            try
            {
                Process proc  = Process.GetCurrentProcess();
                var     procs = COMUtilities.LoadProcesses(new Process[] { proc }, null, COMRegistry.Load(COMRegistryMode.UserOnly));
                if (!procs.Any())
                {
                    throw new ArgumentException("Couldn't parse the process information. Incorrect symbols?");
                }

                Dictionary <string, int> entries;
                if (Environment.Is64BitProcess)
                {
                    entries = SymbolResolverWrapper.GetResolvedNative();
                }
                else
                {
                    entries = SymbolResolverWrapper.GetResolved32Bit();
                }

                string        dll_name    = COMUtilities.GetCOMDllName();
                var           module      = SafeLoadLibraryHandle.GetModuleHandle(dll_name);
                string        output_file = Path.Combine(symbol_dir, $"{COMUtilities.GetFileMD5(module.FullPath)}.sym");
                List <string> lines       = new List <string>();
                lines.Add($"# {Environment.OSVersion.VersionString} {module.FullPath} {FileVersionInfo.GetVersionInfo(module.FullPath).FileVersion}");
                lines.AddRange(entries.Where(p => p.Key.StartsWith(dll_name)).Select(p => $"{p.Value} {p.Key}"));
                File.WriteAllLines(output_file, lines);
            }
            catch (Exception ex)
            {
                ShowError(null, ex);
                return(false);
            }
            return(true);
        }