/// <summary> /// Load the textual properties into a list box /// </summary> private void LoadProperties() { listViewProperties.Columns.Add("Key"); listViewProperties.Columns.Add("Value"); foreach (KeyValuePair <string, string> pair in m_properties) { ListViewItem item = listViewProperties.Items.Add(pair.Key); item.SubItems.Add(pair.Value); } try { /* Also add IObjectSafety information if available */ IObjectSafety objSafety = m_pObject as IObjectSafety; if (objSafety != null) { Guid iid = COMInterfaceEntry.IID_IDispatch; objSafety.GetInterfaceSafetyOptions(ref iid, out uint supportedOptions, out uint enabledOptions); for (int i = 0; i < 4; i++) { int val = 1 << i; if ((val & supportedOptions) != 0) { ListViewItem item = listViewProperties.Items.Add(Enum.GetName(typeof(ObjectSafetyFlags), val)); } } } } catch { } ServerInformation info = COMUtilities.GetServerInformation(m_pObject); if (info.dwServerPid != 0) { listViewProperties.Items.Add("Server PID").SubItems.Add(info.dwServerPid.ToString()); listViewProperties.Items.Add("Server TID").SubItems.Add(info.dwServerTid.ToString()); listViewProperties.Items.Add("Server Address").SubItems.Add(string.Format("0x{0:X}", info.ui64ServerAddress)); } listViewProperties.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); }
internal COMCLSIDElevationEntry(RegistryKey key, RegistryKey vso_key, bool auto_approval) { Enabled = COMUtilities.ReadInt(key, null, "Enabled") != 0; IconReference = COMUtilities.ReadString(key, null, "IconReference"); HashSet <Guid> vsos = new HashSet <Guid>(); if (vso_key != null) { foreach (string value in vso_key.GetValueNames()) { if (Guid.TryParse(value, out Guid guid)) { vsos.Add(guid); } } } AutoApproval = auto_approval; VirtualServerObjects = new List <Guid>(vsos).AsReadOnly(); }
private void LoadFromKey(RegistryKey key) { var custom_properties = new Dictionary <string, string>(); using (var prop_key = key.OpenSubKeySafe("CustomProperties")) { if (prop_key != null) { foreach (var value_name in prop_key.GetValueNames()) { custom_properties[value_name] = prop_key.GetValue(value_name).ToString(); } } } CustomProperties = custom_properties; Description = COMUtilities.ReadString(key, null, "Description"); DisplayName = COMUtilities.ReadString(key, null, "DisplayName"); Icon = COMUtilities.ReadString(key, null, "Icon"); Vendor = COMUtilities.ReadString(key, null, "Vendor"); }
private void menuStorageNewStorage_Click(object sender, EventArgs e) { try { using (SaveFileDialog dlg = new SaveFileDialog()) { dlg.Filter = STORAGE_FILTER; if (dlg.ShowDialog(this) == DialogResult.OK) { Guid iid = typeof(IStorage).GUID; IStorage stg = COMUtilities.StgCreateStorageEx(dlg.FileName, STGM.SHARE_EXCLUSIVE | STGM.READWRITE, STGFMT.Storage, 0, null, IntPtr.Zero, ref iid); HostControl(new StorageViewer(stg, Path.GetFileName(dlg.FileName), false)); } } } catch (Exception ex) { EntryPoint.ShowError(this, ex, true); } }
private async void menuObjectFromMarshalledStream_Click(object sender, EventArgs e) { using (OpenFileDialog dlg = new OpenFileDialog()) { dlg.Filter = "All Files (*.*)|*.*"; if (dlg.ShowDialog(this) == DialogResult.OK) { try { byte[] data = File.ReadAllBytes(dlg.FileName); object comObj = COMUtilities.UnmarshalObject(data); await OpenObjectInformation(comObj, String.Format("Unmarshalled {0}", Path.GetFileName(dlg.FileName))); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
internal COMAppIDServiceEntry(RegistryKey key, ServiceController service) { DisplayName = service.DisplayName; Name = service.ServiceName; ServiceType = service.ServiceType; ServiceDll = string.Empty; ImagePath = string.Empty; UserName = string.Empty; if (key != null) { UserName = key.ReadString(null, "ObjectName"); ImagePath = key.ReadString(null, "ImagePath"); ServiceDll = key.ReadString("Parameters", "ServiceDll"); if (string.IsNullOrEmpty(ServiceDll)) { ServiceDll = key.ReadString(null, "ServiceDll"); } ProtectionLevel = (ServiceProtectionLevel)COMUtilities.ReadInt(key, null, "LaunchProtected"); } }
void LoadROT(bool trusted_only) { IBindCtx bindCtx; listViewROT.Items.Clear(); try { bindCtx = COMUtilities.CreateBindCtx(trusted_only ? 1U : 0U); IRunningObjectTable rot; IEnumMoniker enumMoniker; IMoniker[] moniker = new IMoniker[1]; bindCtx.GetRunningObjectTable(out rot); rot.EnumRunning(out enumMoniker); while (enumMoniker.Next(1, moniker, IntPtr.Zero) == 0) { string strDisplayName; moniker[0].GetDisplayName(bindCtx, null, out strDisplayName); Guid clsid = COMUtilities.GetObjectClass(moniker[0]); ListViewItem item = listViewROT.Items.Add(strDisplayName); item.Tag = new MonikerInfo(strDisplayName, clsid, moniker[0]); if (m_registry.Clsids.ContainsKey(clsid)) { item.SubItems.Add(m_registry.Clsids[clsid].Name); } else { item.SubItems.Add(clsid.FormatGuid()); } } } catch (Exception e) { EntryPoint.ShowError(this, e); } listViewROT.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); }
private void SetupProcessEntry(COMProcessEntry obj) { m_process = obj; textBoxProcessExecutablePath.Text = obj.ExecutablePath; textBoxProcessProcessId.Text = obj.ProcessId.ToString(); textBoxProcessAppId.Text = GetGuidValue(obj.AppId); textBoxProcessAccessPermissions.Text = GetStringValue(obj.AccessPermissions); btnProcessViewAccessPermissions.Enabled = !String.IsNullOrWhiteSpace(obj.AccessPermissions); textBoxProcessLrpcPermissions.Text = GetStringValue(obj.LRpcPermissions); textBoxProcessUser.Text = GetStringValue(obj.User); textBoxProcessSecurity.Text = String.Format("Capabilities: {0}, Authn Level: {1}, Imp Level: {2}, Unmarshal Policy: {3}", obj.Capabilities, obj.AuthnLevel, obj.ImpLevel, obj.UnmarshalPolicy); textBoxProcessStaHwnd.Text = String.Format("0x{0:X}", obj.STAMainHWnd.ToInt64()); SetupIpidEntries(obj.Ipids, false); listViewProcessIPids.ListViewItemSorter = new ListItemComparer(0); lblProcess64bit.Text = COMUtilities.FormatBitness(obj.Is64Bit); tabControlProperties.TabPages.Add(tabPageProcess); if (m_registry.AppIDs.ContainsKey(obj.AppId)) { SetupAppIdEntry((COMAppIDEntry)m_registry.AppIDs[obj.AppId]); } if (obj.Classes.Any()) { tabControlProperties.TabPages.Add(tabPageRegisteredClasses); foreach (var c in obj.Classes) { COMCLSIDEntry clsid = m_registry.MapClsidToEntry(c.Clsid); ListViewItem item = listViewRegisteredClasses.Items.Add(c.Clsid.FormatGuid()); item.SubItems.Add(clsid.Name); item.SubItems.Add(c.VTable); item.SubItems.Add(c.RegFlags.ToString()); item.SubItems.Add(c.Apartment.ToString()); item.SubItems.Add(c.Context.ToString()); item.Tag = c; } listViewRegisteredClasses.ListViewItemSorter = new ListItemComparer(0); listViewRegisteredClasses.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listViewRegisteredClasses.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); } }
private IMoniker ParseMoniker(IBindCtx bind_context, string moniker_string) { if (moniker_string == "new") { Guid IID_IUnknown = COMInterfaceEntry.IID_IUnknown; IntPtr unk; int hr = COMUtilities.CoCreateInstance(ref CLSID_NewMoniker, IntPtr.Zero, CLSCTX.INPROC_SERVER, ref IID_IUnknown, out unk); if (hr != 0) { Marshal.ThrowExceptionForHR(hr); } try { return((IMoniker)Marshal.GetObjectForIUnknown(unk)); } finally { Marshal.Release(unk); } } else { if (moniker_string.StartsWith("file:", StringComparison.OrdinalIgnoreCase) || moniker_string.StartsWith("http:", StringComparison.OrdinalIgnoreCase) || moniker_string.StartsWith("https:", StringComparison.OrdinalIgnoreCase)) { IMoniker moniker; int hr = COMUtilities.CreateURLMonikerEx(null, moniker_string, out moniker, CreateUrlMonikerFlags.Uniform); if (hr != 0) { Marshal.ThrowExceptionForHR(hr); } return(moniker); } int eaten = 0; return(COMUtilities.MkParseDisplayName(bind_context, moniker_string, out eaten)); } }
private void menuFileOpenPowershell_Click(object sender, EventArgs e) { try { string temp_file = Path.GetTempFileName(); m_registry.Save(temp_file); string startup_script = Path.Combine(COMUtilities.GetAppDirectory(), "Startup-Module.ps1"); if (!File.Exists(startup_script)) { throw new ArgumentException("PowerShell startup script is missing"); } using (Process.Start("powershell.exe", $"-NoExit -ExecutionPolicy Bypass -File \"{startup_script}\" \"{temp_file}\" -DeleteFile")) { } } catch (Exception ex) { EntryPoint.ShowError(this, ex); } }
private void menuStorageOpenStorage_Click(object sender, EventArgs e) { try { using (OpenFileDialog dlg = new OpenFileDialog()) { dlg.ShowReadOnly = true; dlg.ReadOnlyChecked = true; dlg.Filter = STORAGE_FILTER; if (dlg.ShowDialog(this) == DialogResult.OK) { IStorage stg = COMUtilities.StgOpenStorage(dlg.FileName, null, GetStorageAccess(dlg.ReadOnlyChecked), IntPtr.Zero, 0); HostControl(new StorageViewer(stg, Path.GetFileName(dlg.FileName), dlg.ReadOnlyChecked)); } } } catch (Exception ex) { EntryPoint.ShowError(this, ex, true); } }
private string GetTextFromTag(object tag) { var type = tag as Type; var proxy = tag as NdrComProxyDefinition; NdrComplexTypeReference str = tag as NdrComplexTypeReference; if (type != null) { return(COMUtilities.FormatComType(type)); } else if (proxy != null) { INdrFormatter formatter = GetNdrFormatter(true); return(formatter.FormatComProxy(proxy)); } else if (str != null) { INdrFormatter formatter = GetNdrFormatter(false); return(formatter.FormatComplexType(str)); } return(String.Empty); }
private void ConfigureSymbols() { if (_configured_symbols) { return; } _configured_symbols = true; 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 (SettingsForm frm = new SettingsForm()) { frm.ShowDialog(this); } } } COMUtilities.SetupCachedSymbols(); }
private string GetTextFromTag(object tag) { var type = tag as Type; var proxy = tag as NdrComProxyDefinition; NdrComplexTypeReference str = tag as NdrComplexTypeReference; if (type != null) { return(COMUtilities.FormatComType(type)); } else if (proxy != null) { INdrFormatter formatter = DefaultNdrFormatter.Create(m_iids_to_names, COMUtilities.DemangleWinRTName); return(formatter.FormatComProxy(proxy)); } else if (str != null) { INdrFormatter formatter = DefaultNdrFormatter.Create(m_iids_to_names); return(formatter.FormatComplexType(str)); } return(String.Empty); }
private void OpenRegistry(ComboBox comboBox) { using (OpenFileDialog dlg = new OpenFileDialog()) { dlg.Filter = "OleViewDotNet DB File (*.ovdb)|*.ovdb|All Files (*.*)|*.*"; if (dlg.ShowDialog(this) == DialogResult.OK) { try { COMRegistry registry = COMUtilities.LoadRegistry(this, dlg.FileName); comboBox.Items.Add(registry); comboBox.SelectedItem = registry; } catch (OperationCanceledException) { } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
public static void LoadInterfaceViewers() { if (m_viewfactory == null) { m_viewfactory = new Dictionary <Guid, ITypeViewerFactory>(); try { /* See if we have any registered in the current assembly */ LoadInterfaceViewersFromAssembly(Assembly.GetExecutingAssembly()); } catch { } try { string[] plugins = Directory.GetFiles(COMUtilities.GetPluginDirectory(), "*.dll"); foreach (string p in plugins) { try { Assembly a = Assembly.LoadFile(p); LoadInterfaceViewersFromAssembly(a); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.ToString()); } } } catch (Exception) { } } }
public void UpdateProcessList(ProcessAccessRights desired_access, bool require_token, bool filter_native) { NtToken.EnableDebugPrivilege(); ClearListView(); using (var ps = NtProcess.GetProcesses(ProcessAccessRights.QueryLimitedInformation | desired_access, true).ToDisposableList()) { foreach (var p in ps.OrderBy(p => p.ProcessId)) { if (p.Is64Bit && !Environment.Is64BitProcess && filter_native) { continue; } using (var result = NtToken.OpenProcessToken(p, TokenAccessRights.Query, false)) { if (!result.IsSuccess && require_token) { continue; } ListViewItem item = listViewProcesses.Items.Add(p.ProcessId.ToString()); item.SubItems.Add(p.Name); item.SubItems.Add(COMUtilities.FormatBitness(p.Is64Bit)); if (result.IsSuccess) { NtToken token = result.Result; item.SubItems.Add(p.User.Name); item.SubItems.Add(token.IntegrityLevel.ToString()); } item.Tag = _processes.AddResource(p.Duplicate()); } } } listViewProcesses.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listViewProcesses.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); listViewProcesses.ListViewItemSorter = new ListItemComparer(0); }
private void SetupIPIDEntry(COMIPIDEntry obj) { textBoxIPID.Text = obj.Ipid.FormatGuid(); textBoxIPIDIID.Text = obj.Iid.FormatGuid(); textBoxIPIDIIDName.Text = m_registry.MapIidToInterface(obj.Iid).Name; textBoxIPIDFlags.Text = obj.Flags.ToString(); textBoxIPIDInterface.Text = String.Format("0x{0:X}", obj.Interface.ToInt64()); textBoxIPIDInterfaceVTable.Text = GetStringValue(obj.InterfaceVTable); textBoxIPIDStub.Text = String.Format("0x{0:X}", obj.Stub.ToInt64()); textBoxIPIDStubVTable.Text = GetStringValue(obj.StubVTable); textBoxIPIDOXID.Text = obj.Oxid.FormatGuid(); textBoxIPIDReferences.Text = String.Format("Strong: {0}, Weak: {1}, Private: {2}", obj.StrongRefs, obj.WeakRefs, obj.PrivateRefs); textBoxIPIDProcessId.Text = COMUtilities.GetProcessIdFromIPid(obj.Ipid).ToString(); textBoxIPIDApartment.Text = COMUtilities.GetApartmentIdStringFromIPid(obj.Ipid); textBoxIPIDStaHwnd.Text = String.Format("0x{0:X}", obj.ServerSTAHwnd.ToInt64()); listViewIpidMethods.Items.AddRange(obj.Methods.Select((method, i) => { ListViewItem item = new ListViewItem(i.ToString()); item.SubItems.Add(method.Name); item.SubItems.Add(method.Address); item.SubItems.Add(method.Symbol); int count = method.Procedure != null ? method.Procedure.Params.Count : 0; if (i == 0) { count = 3; } item.SubItems.Add(count.ToString()); return(item); } ).ToArray()); listViewIpidMethods.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listViewIpidMethods.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); m_ipid = obj; tabControlProperties.TabPages.Add(tabPageIPID); }
private object CreateInstance(string server, bool factory) { if (!string.IsNullOrWhiteSpace(server)) { throw new ArgumentException("Specifying a remote server is not valid for this class type.", "server"); } IntPtr pObject = IntPtr.Zero; try { int hr; if (factory) { Guid iid = COMInterfaceEntry.IID_IUnknown; hr = COMUtilities.RoGetActivationFactory(Name, ref iid, out pObject); } else { hr = COMUtilities.RoActivateInstance(Name, out pObject); } if (hr != 0) { throw new Win32Exception(hr); } return(Marshal.GetObjectForIUnknown(pObject)); } finally { if (pObject != IntPtr.Zero) { Marshal.Release(pObject); } } }
internal void LoadIPid(Guid ipid) { try { ConfigureSymbols(); var proc = COMUtilities.LoadProcesses(new int[] { COMUtilities.GetProcessIdFromIPid(ipid) }, this, m_registry).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)); } } else { throw new Exception($"Couldn't load process for IPID: {ipid.FormatGuid()}"); } } catch (Exception ex) { EntryPoint.ShowError(this, ex); } }
private async void menuObjectFromSerializedStream_Click(object sender, EventArgs e) { using (OpenFileDialog dlg = new OpenFileDialog()) { dlg.Filter = "All Files (*.*)|*.*"; if (dlg.ShowDialog(this) == DialogResult.OK) { try { using (Stream stm = dlg.OpenFile()) { Guid clsid; object obj = COMUtilities.OleLoadFromStream(stm, out clsid); await HostObject(m_registry.MapClsidToEntry(clsid), obj, obj is IClassFactory); } } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
public static BaseComWrapper Wrap(object obj, COMIPIDEntry ipid) { return(Wrap(obj, COMUtilities.GetInterfaceType(ipid))); }
private void LoadFromKey(RegistryKey key) { HashSet <Guid> categories = new HashSet <Guid>(); object name = key.GetValue(null); Name = null; if (name != null) { string s = name.ToString().Trim(); if (s.Length > 0) { Name = name.ToString(); } } bool fake_name = false; if (Name == null) { fake_name = true; Name = Clsid.FormatGuidDefault(); } Dictionary <COMServerType, COMCLSIDServerEntry> servers = new Dictionary <COMServerType, COMCLSIDServerEntry>(); COMCLSIDServerEntry inproc_server = ReadServerKey(servers, key, COMServerType.InProcServer32); ReadServerKey(servers, key, COMServerType.LocalServer32); ReadServerKey(servers, key, COMServerType.InProcHandler32); Servers = new ReadOnlyDictionary <COMServerType, COMCLSIDServerEntry>(servers); if (fake_name && inproc_server != null && inproc_server.HasDotNet) { Name = string.Format("{0}, {1}", inproc_server.DotNet.ClassName, inproc_server.DotNet.AssemblyName); } AppID = COMUtilities.ReadGuid(key, null, "AppID"); if (AppID == Guid.Empty) { AppID = COMUtilities.ReadGuid(Registry.ClassesRoot, string.Format(@"AppID\{0}", COMUtilities.GetFileName(DefaultServer)), "AppID"); } if (AppID != Guid.Empty && !servers.ContainsKey(COMServerType.LocalServer32)) { servers.Add(COMServerType.LocalServer32, new COMCLSIDServerEntry(COMServerType.LocalServer32, "<APPID HOSTED>")); } TypeLib = COMUtilities.ReadGuid(key, "TypeLib", null); if (key.HasSubkey("Control")) { categories.Add(COMCategory.CATID_Control); } if (key.HasSubkey("Insertable")) { categories.Add(COMCategory.CATID_Insertable); } if (key.HasSubkey("DocObject")) { categories.Add(COMCategory.CATID_Document); } using (RegistryKey catkey = key.OpenSubKey("Implemented Categories")) { if (catkey != null) { string[] subKeys = catkey.GetSubKeyNames(); foreach (string s in subKeys) { if (Guid.TryParse(s, out Guid g)) { categories.Add(g); } } } } Categories = categories.ToList().AsReadOnly(); TreatAs = COMUtilities.ReadGuid(key, "TreatAs", null); using (RegistryKey elev_key = key.OpenSubKey("Elevation"), vso_key = key.OpenSubKey("VirtualServerObjects")) { if (elev_key != null) { using (var base_key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Default)) { int auto_approval = COMUtilities.ReadInt(base_key, @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\UAC\COMAutoApprovalList", Clsid.ToString("B")); Elevation = new COMCLSIDElevationEntry(elev_key, vso_key, auto_approval != 0); } } } ActivatableFromApp = _app_activatable.Contains(Clsid); using (RegistryKey trustkey = Registry.LocalMachine.OpenSubKey(@"Software\Classes\Unmarshalers\System\" + Clsid.ToString("B"))) { TrustedMarshaller = trustkey != null ? true : categories.Contains(COMCategory.CATID_TrustedMarshaler); } Source = key.GetSource(); }
public object CreateClassFactory(CLSCTX dwContext, string server) { return(COMUtilities.CreateClassFactory(Clsid, COMInterfaceEntry.IID_IUnknown, dwContext, server)); }
private void listViewProcessIPids_DoubleClick(object sender, EventArgs e) { COMIPIDEntry ipid = GetSelectedIpid(); if (ipid != null) { EntryPoint.GetMainForm(m_registry).HostControl(new PropertiesControl(m_registry, string.Format("IPID: {0}", COMUtilities.FormatGuid(ipid.Ipid)), ipid)); } }
private void viewProxyDefinitionToolStripMenuItem_Click(object sender, EventArgs e) { try { ListView view = GetListViewForMenu(sender); if (view != null && view.SelectedIndices.Count > 0) { ListViewItem item = view.SelectedItems[0]; Tuple <COMInterfaceInstance, COMInterfaceEntry> intf = item.Tag as Tuple <COMInterfaceInstance, COMInterfaceEntry>; if (m_registry.Clsids.ContainsKey(intf.Item2.ProxyClsid)) { COMCLSIDEntry clsid = m_registry.Clsids[intf.Item2.ProxyClsid]; using (var resolver = EntryPoint.GetProxyParserSymbolResolver()) { EntryPoint.GetMainForm(m_registry).HostControl(new TypeLibControl(m_registry, COMUtilities.GetFileName(clsid.DefaultServerName), COMProxyInstance.GetFromCLSID(clsid, resolver), intf.Item1.Iid)); } } } } catch (Exception ex) { EntryPoint.ShowError(this, ex); } }
private void SetupClsidEntry(COMCLSIDEntry entry) { textBoxClsidName.Text = entry.Name; textBoxClsid.Text = entry.Clsid.FormatGuid(); textBoxServerType.Text = entry.DefaultServerType.ToString(); textBoxThreadingModel.Text = entry.DefaultThreadingModel.ToString(); textBoxServer.Text = entry.DefaultServer; textBoxCmdLine.Text = GetStringValue(entry.DefaultCmdLine); textBoxTreatAs.Text = GetGuidValue(entry.TreatAs); btnTreatAsProps.Enabled = m_registry.Clsids.ContainsKey(entry.TreatAs); var progids = m_registry.Progids; foreach (string progid in m_registry.GetProgIdsForClsid(entry.Clsid).Select(p => p.ProgID)) { ListViewItem item = listViewProgIDs.Items.Add(progid); if (progids.ContainsKey(progid)) { item.Tag = progids[progid]; } } listViewProgIDs.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); foreach (Guid catid in entry.Categories) { ListViewItem item = listViewCategories.Items.Add(COMUtilities.GetCategoryName(catid)); item.Tag = catid; } listViewCategories.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); LoadInterfaceList(entry.Interfaces, listViewInterfaces); LoadInterfaceList(entry.FactoryInterfaces, listViewFactoryInterfaces); tabPageSupportedInterfaces.Tag = entry; tabControlProperties.TabPages.Add(tabPageClsid); tabControlProperties.TabPages.Add(tabPageSupportedInterfaces); if (m_registry.AppIDs.ContainsKey(entry.AppID)) { SetupAppIdEntry(m_registry.AppIDs[entry.AppID]); } IEnumerable <COMInterfaceEntry> proxies = m_registry.GetProxiesForClsid(entry); if (proxies.Any()) { foreach (COMInterfaceEntry intf in proxies.OrderBy(i => i.Name)) { ListViewItem item = listViewProxies.Items.Add(intf.Name); item.SubItems.Add(intf.Iid.FormatGuid()); item.Tag = intf; } listViewProxies.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listViewProxies.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); listViewProxies.ListViewItemSorter = new ListItemComparer(0); tabControlProperties.TabPages.Add(tabPageProxies); } if (entry.Servers.Count > 1) { foreach (COMCLSIDServerEntry server in entry.Servers.Values) { ListViewItem item = listViewCLSIDServers.Items.Add(server.ServerType.ToString()); item.SubItems.Add(server.Server); item.SubItems.Add(server.CommandLine); item.SubItems.Add(server.ThreadingModel.ToString()); item.Tag = server; } listViewCLSIDServers.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listViewCLSIDServers.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); listViewCLSIDServers.ListViewItemSorter = new ListItemComparer(0); tabControlProperties.TabPages.Add(tabPageServers); } SetupTypeLibVersionEntry(m_registry.GetTypeLibVersionEntry(entry.TypeLib, null)); if (entry.Elevation != null) { textBoxElevationEnabled.Text = entry.Elevation.Enabled.ToString(); textBoxElevationAutoApproval.Text = entry.Elevation.AutoApproval.ToString(); textBoxElevationIconReference.Text = GetStringValue(entry.Elevation.IconReference); foreach (COMCLSIDEntry vso in entry.Elevation.VirtualServerObjects.Select(v => m_registry.MapClsidToEntry(v))) { ListViewItem item = listViewElevationVSOs.Items.Add(vso.Name); item.SubItems.Add(vso.Clsid.ToString()); item.SubItems.Add(vso.CanElevate.ToString()); item.SubItems.Add(vso.AutoElevation.ToString()); item.Tag = vso; } listViewElevationVSOs.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); listViewElevationVSOs.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); listViewElevationVSOs.ListViewItemSorter = new ListItemComparer(0); tabControlProperties.TabPages.Add(tabPageElevation); } if (entry.Servers.ContainsKey(COMServerType.InProcServer32) && entry.Servers[COMServerType.InProcServer32].HasDotNet) { COMCLSIDServerDotNetEntry dotnet = entry.Servers[COMServerType.InProcServer32].DotNet; textBoxDotNetAssemblyName.Text = dotnet.AssemblyName; textBoxDotNetClassName.Text = dotnet.ClassName; textBoxDotNetCodeBase.Text = dotnet.CodeBase; textBoxDotNetRuntimeVersion.Text = dotnet.RuntimeVersion; tabControlProperties.TabPages.Add(tabPageDotNet); } m_clsid = entry; }
public AboutForm() { InitializeComponent(); labelText.Text = string.Format(labelText.Text, COMUtilities.GetVersion()); }
public override bool Equals(object obj) { if (base.Equals(obj)) { return(true); } if (!(obj is COMRuntimeExtensionEntry right)) { return(false); } return(AppId == right.AppId && PackageId == right.PackageId && ContractId == right.ContractId && Description == right.Description && DisplayName == right.DisplayName && Icon == right.Icon && Vendor == right.Vendor && COMUtilities.EqualsDictionary(CustomProperties, right.CustomProperties) && Source == right.Source); }
public override int GetHashCode() { return(AppId.GetHashCode() ^ PackageId.GetHashCode() ^ ContractId.GetHashCode() ^ Description.GetHashCode() ^ DisplayName.GetHashCode() ^ Icon.GetHashCode() ^ Vendor.GetHashCode() ^ COMUtilities.GetHashCodeDictionary(CustomProperties) ^ Source.GetHashCode()); }