diff --git a/src/detection/bios/bios_windows.c b/src/detection/bios/bios_windows.c index 482ed48c2..69930a178 100644 --- a/src/detection/bios/bios_windows.c +++ b/src/detection/bios/bios_windows.c @@ -1,5 +1,6 @@ #include "bios.h" #include "util/windows/registry.h" +#include "util/smbiosHelper.h" const char* ffDetectBios(FFBiosResult* bios) { @@ -10,8 +11,11 @@ const char* ffDetectBios(FFBiosResult* bios) if(!ffRegReadStrbuf(hKey, L"BIOSVersion", &bios->version, NULL)) return "\"HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSVersion\" doesn't exist"; + ffCleanUpSmbiosValue(&bios->version); ffRegReadStrbuf(hKey, L"BIOSVendor", &bios->vendor, NULL); + ffCleanUpSmbiosValue(&bios->vendor); ffRegReadStrbuf(hKey, L"BIOSReleaseDate", &bios->date, NULL); + ffCleanUpSmbiosValue(&bios->date); uint32_t major, minor; if( diff --git a/src/detection/board/board_windows.c b/src/detection/board/board_windows.c index 16db05161..a2bfce4ff 100644 --- a/src/detection/board/board_windows.c +++ b/src/detection/board/board_windows.c @@ -1,5 +1,6 @@ #include "board.h" #include "util/windows/registry.h" +#include "util/smbiosHelper.h" const char* ffDetectBoard(FFBoardResult* board) { @@ -11,8 +12,11 @@ const char* ffDetectBoard(FFBoardResult* board) if(!ffRegReadStrbuf(hKey, L"BaseBoardProduct", &board->name, NULL)) return "ffRegReadStrbuf(hKey, L\"BaseBoardProduct\") failed"; + ffCleanUpSmbiosValue(&board->name); ffRegReadStrbuf(hKey, L"BaseBoardManufacturer", &board->vendor, NULL); + ffCleanUpSmbiosValue(&board->vendor); ffRegReadStrbuf(hKey, L"BaseBoardVersion", &board->version, NULL); + ffCleanUpSmbiosValue(&board->version); return NULL; } diff --git a/src/detection/host/host_windows.c b/src/detection/host/host_windows.c index 9498fa5e6..afc2b242c 100644 --- a/src/detection/host/host_windows.c +++ b/src/detection/host/host_windows.c @@ -1,5 +1,6 @@ #include "host.h" #include "util/windows/registry.h" +#include "util/smbiosHelper.h" const char* ffDetectHost(FFHostResult* host) { @@ -9,10 +10,15 @@ const char* ffDetectHost(FFHostResult* host) return "ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L\"HARDWARE\\DESCRIPTION\\System\\BIOS\", &hKey, NULL) failed"; ffRegReadStrbuf(hKey, L"SystemProductName", &host->productName, NULL); + ffCleanUpSmbiosValue(&host->productName); ffRegReadStrbuf(hKey, L"SystemFamily", &host->productFamily, NULL); + ffCleanUpSmbiosValue(&host->productFamily); ffRegReadStrbuf(hKey, L"SystemVersion", &host->productVersion, NULL); + ffCleanUpSmbiosValue(&host->productVersion); ffRegReadStrbuf(hKey, L"SystemSKU", &host->productSku, NULL); + ffCleanUpSmbiosValue(&host->productSku); ffRegReadStrbuf(hKey, L"SystemManufacturer", &host->sysVendor, NULL); + ffCleanUpSmbiosValue(&host->sysVendor); return NULL; }