diff --git a/src/detection/board/board_apple.c b/src/detection/board/board_apple.c index 6381590d8..dca906bc3 100644 --- a/src/detection/board/board_apple.c +++ b/src/detection/board/board_apple.c @@ -9,9 +9,19 @@ const char* ffDetectBoard(FFBoardResult* result) if (!service) return "No IOPlatformExpertDevice found"; - io_name_t name; - if (IORegistryEntryGetName(service, name) == kIOReturnSuccess) - ffStrbufSetS(&result->name, name); + FF_CFTYPE_AUTO_RELEASE CFTypeRef boardId = IORegistryEntryCreateCFProperty(service, CFSTR("board-id"), kCFAllocatorDefault, kNilOptions); + if (boardId) + ffCfStrGetString(boardId, &result->name); + else + { + io_name_t name; + if (IORegistryEntryGetName(service, name) == kIOReturnSuccess) + ffStrbufSetS(&result->name, name); + } + + FF_CFTYPE_AUTO_RELEASE CFStringRef version = IORegistryEntryCreateCFProperty(service, CFSTR("version"), kCFAllocatorDefault, kNilOptions); + if (version) + ffCfStrGetString(version, &result->version); FF_CFTYPE_AUTO_RELEASE CFTypeRef manufacturer = IORegistryEntryCreateCFProperty(service, CFSTR("manufacturer"), kCFAllocatorDefault, kNilOptions); if (manufacturer) diff --git a/src/detection/host/host_apple.c b/src/detection/host/host_apple.c index c83b09684..2477ea7e9 100644 --- a/src/detection/host/host_apple.c +++ b/src/detection/host/host_apple.c @@ -36,6 +36,10 @@ const char* getOthersByIokit(FFHostResult* host) if (manufacturer) ffCfStrGetString(manufacturer, &host->vendor); + FF_CFTYPE_AUTO_RELEASE CFStringRef version = IORegistryEntryCreateCFProperty(registryEntry, CFSTR("version"), kCFAllocatorDefault, kNilOptions); + if (version) + ffCfStrGetString(version, &host->version); + return NULL; }