duo-labs / EFIgy

A small client application that uses the Duo Labs EFIgy API to inform you about the state of your Mac EFI firmware
http://efigy.io
BSD 3-Clause "New" or "Revised" License
513 stars 39 forks source link

Don't rely on ioreg for board-id #8

Closed Piker-Alpha closed 7 years ago

Piker-Alpha commented 7 years ago

This is how you do it: https://github.com/Piker-Alpha/HandyScripts/blob/master/efiver.py#L329

Piker-Alpha commented 7 years ago

You can do the same for smc-version with

def getMySMCVersion():
    return IORegistryEntryCreateCFProperty(IOServiceGetMatchingService(0, IOServiceMatching("AppleSMC")), "smc-version", None, 0)
MyNameIsMeerkat commented 7 years ago

Thanks, and 100% agree. Have updated the file to use IOKit/objc to get all of the base versions for EFI, SMC, and the Board_ID. Also updated the collection of sysUUID and the mac model to use objc calls as well with the following incase they're of use to you:

mac_model_code = IORegistryEntryCreateCFProperty(IOServiceGetMatchingService(0,IOServiceMatching("IOPlatformExpertDevice")), "model", None, 0)

sys_uuid = IORegistryEntryCreateCFProperty(IOServiceGetMatchingService(0, IOServiceMatching("IOPlatformExpertDevice")), "IOPlatformUUID", None, 0)

Appreciate the notes and helping to make the client better :)