Example #1
0
        // Token: 0x06000BE1 RID: 3041 RVA: 0x0002359C File Offset: 0x0002179C
        public static ICollection <RamStick> GetRamSticks()
        {
            List <RamStick> list = new List <RamStick>();

            string[] properties = new string[]
            {
                "Capacity",
                "ConfiguredClockSpeed",
                "Manufacturer",
                "SerialNumber",
                "PositionInRow"
            };
            WmiInstanceClassCollection wmiInstanceClassCollection = WmiInstance.Query("Win32_PhysicalMemory", properties, null);

            if (wmiInstanceClassCollection == null)
            {
                return(list);
            }
            foreach (WmiInstanceClass wmiInstanceClass in wmiInstanceClassCollection)
            {
                RamStick item = new RamStick((ulong?)wmiInstanceClass["Capacity"].Value, (uint?)wmiInstanceClass["ConfiguredClockSpeed"].Value, (string)wmiInstanceClass["Manufacturer"].Value, (string)wmiInstanceClass["SerialNumber"].Value, (uint?)wmiInstanceClass["PositionInRow"].Value);
                list.Add(item);
            }
            return(list);
        }
Example #2
0
        // Token: 0x06000C12 RID: 3090 RVA: 0x00024124 File Offset: 0x00022324
        public static ICollection <SecurityProduct> GetSecurityProducts(SecurityProductType productType)
        {
            List <SecurityProduct> list  = new List <SecurityProduct>();
            ManagementScope        scope = new ManagementScope(SecurityGatherer.SecurityScope);

            string[] properties = new string[]
            {
                "displayName",
                "pathToSignedProductExe"
            };
            WmiInstanceClassCollection wmiInstanceClassCollection;

            switch (productType)
            {
            case SecurityProductType.AntiVirus:
                wmiInstanceClassCollection = WmiInstance.Query("AntivirusProduct", properties, scope);
                break;

            case SecurityProductType.AntiSpyware:
                wmiInstanceClassCollection = WmiInstance.Query("AntiSpyWareProduct", properties, scope);
                break;

            case SecurityProductType.Firewall:
                wmiInstanceClassCollection = WmiInstance.Query("FirewallProduct", properties, scope);
                break;

            default:
                wmiInstanceClassCollection = null;
                break;
            }
            if (wmiInstanceClassCollection == null)
            {
                return(list);
            }
            foreach (WmiInstanceClass wmiInstanceClass in wmiInstanceClassCollection)
            {
                SecurityProduct item = new SecurityProduct((string)wmiInstanceClass["displayName"].Value, (string)wmiInstanceClass["pathToSignedProductExe"].Value);
                list.Add(item);
            }
            return(list);
        }
        // Token: 0x06000C13 RID: 3091 RVA: 0x00024218 File Offset: 0x00022418
        public static ICollection <UserAccount> GetUsers()
        {
            List <UserAccount> list = new List <UserAccount>();

            string[] properties = new string[]
            {
                "Name",
                "FullName",
                "Disabled"
            };
            WmiInstanceClassCollection wmiInstanceClassCollection = WmiInstance.Query("Win32_UserAccount", properties, null);

            if (wmiInstanceClassCollection == null)
            {
                return(list);
            }
            foreach (WmiInstanceClass wmiInstanceClass in wmiInstanceClassCollection)
            {
                UserAccount item = new UserAccount((string)wmiInstanceClass["Name"].Value, (string)wmiInstanceClass["FullName"].Value, (bool?)wmiInstanceClass["Disabled"].Value);
                list.Add(item);
            }
            return(list);
        }
Example #4
0
        public static BaseBoard GetBaseBoard()
        {
            string condition = "PoweredOn = TRUE";

            string[] properties = new string[6]
            {
                "Model",
                "Product",
                "Name",
                "Manufacturer",
                "SerialNumber",
                "PoweredOn"
            };
            WmiInstanceClassCollection wmiInstanceClassCollection = WmiInstance.Query("Win32_Baseboard", properties, condition);

            if (wmiInstanceClassCollection == null || wmiInstanceClassCollection.Count == 0)
            {
                return(null);
            }
            WmiInstanceClass wmiInstanceClass = wmiInstanceClassCollection[0];

            return(new BaseBoard((string)wmiInstanceClass["Model"].Value, (string)wmiInstanceClass["Product"].Value, (string)wmiInstanceClass["Name"].Value, (string)wmiInstanceClass["Manufacturer"].Value, (string)wmiInstanceClass["SerialNumber"].Value));
        }
Example #5
0
        public static ICollection <NetworkAdapter> GetNetworkAdapter()
        {
            List <NetworkAdapter> list = new List <NetworkAdapter>();

            string[] properties = new string[4]
            {
                "Caption",
                "Description",
                "IPEnabled",
                "MacAddress"
            };
            WmiInstanceClassCollection wmiInstanceClassCollection = WmiInstance.Query("Win32_NetworkAdapterConfiguration", properties);

            if (wmiInstanceClassCollection == null)
            {
                return(list);
            }
            foreach (WmiInstanceClass item2 in wmiInstanceClassCollection)
            {
                NetworkAdapter item = new NetworkAdapter((string)item2["Caption"].Value, (string)item2["Description"].Value, (bool?)item2["IPEnabled"].Value, (string)item2["MACAddress"].Value);
                list.Add(item);
            }
            return(list);
        }
Example #6
0
        public static ICollection <HardDrive> GetHardDrives()
        {
            List <HardDrive> list = new List <HardDrive>();

            string[] properties = new string[4]
            {
                "Caption",
                "Model",
                "Signature",
                "Size"
            };
            WmiInstanceClassCollection wmiInstanceClassCollection = WmiInstance.Query("Win32_DiskDrive", properties);

            if (wmiInstanceClassCollection == null)
            {
                return(list);
            }
            foreach (WmiInstanceClass item2 in wmiInstanceClassCollection)
            {
                HardDrive item = new HardDrive((string)item2["Caption"].Value, (string)item2["Model"].Value, (uint?)item2["Signature"].Value, (ulong?)item2["Size"].Value);
                list.Add(item);
            }
            return(list);
        }
Example #7
0
        public static ICollection <GraphicsCard> GetGraphicsCards()
        {
            List <GraphicsCard> list = new List <GraphicsCard>();

            string[] properties = new string[4]
            {
                "AdapterRAM",
                "Caption",
                "Description",
                "Name"
            };
            WmiInstanceClassCollection wmiInstanceClassCollection = WmiInstance.Query("Win32_VideoController", properties);

            if (wmiInstanceClassCollection == null)
            {
                return(list);
            }
            foreach (WmiInstanceClass item2 in wmiInstanceClassCollection)
            {
                GraphicsCard item = new GraphicsCard((uint?)item2["AdapterRAM"].Value, (string)item2["Caption"].Value, (string)item2["Description"].Value, (string)item2["Name"].Value);
                list.Add(item);
            }
            return(list);
        }
Example #8
0
 // Token: 0x06000C2A RID: 3114 RVA: 0x00009615 File Offset: 0x00007815
 public static WmiInstanceClassCollection Query(string wmiclass, ManagementScope scope = null)
 {
     return(WmiInstance.Query(wmiclass, null, scope));
 }