No Need COM WMI

I was messing around with Windows. I was poking Windows with a big stick.

I ended up falling down a rabbit hole (Google Project Zero, UnknownCheats) and managed to do WMI stuff from C without using the Windows COM.

These APIs are extremely undocumented and were kind of a pain in the butt cheeks. There is more stuff you can do. However, for the time being here is my proof-of-concept for getting SYSTEM_INFORMATION in C.

PS C:\Users\User\Desktop> ([WMIClass]"root\wmi:MS_SystemInformation").GetText(
>>     [System.Management.TextFormat]::Mof
>> )
[WMI, dynamic: ToInstance, provider("WMIProv"), Guid("{98A2B9D7-94DD-496a-847E-67A5557A59F2}"), Locale(1033)]
class MS_SystemInformation
{
        [key, read] string InstanceName;
        [read] boolean Active;
        [read, WMIDataID(1)] string BaseBoardManufacturer;
        [read, WMIDataID(2)] string BaseBoardProduct;
        [read, WMIDataID(3)] string BaseBoardVersion;
        [read, WMIDataID(4)] string BIOSReleaseDate;
        [read, WMIDataID(5)] string BIOSVendor;
        [read, WMIDataID(6)] string BIOSVersion;
        [read, WMIDataID(7)] string SystemFamily;
        [read, WMIDataID(8)] string SystemManufacturer;
        [read, WMIDataID(9)] string SystemProductName;
        [read, WMIDataID(10)] string SystemSKU;
        [read, WMIDataID(11)] string SystemVersion;
        [read, WMIDataID(12)] uint8 BiosMajorRelease;
        [read, WMIDataID(13)] uint8 BiosMinorRelease;
        [read, WMIDataID(14)] uint8 ECFirmwareMajorRelease;
        [read, WMIDataID(15)] uint8 ECFirmwareMinorRelease;
};

Last updated