diff --git a/CMakeLists.txt b/CMakeLists.txt index be5f4d764..9ba505650 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1144,7 +1144,7 @@ elseif(WIN32) src/detection/initsystem/initsystem_windows.c src/detection/keyboard/keyboard_windows.c src/detection/libc/libc_windows.cpp - src/detection/lm/lm_nosupport.c + src/detection/lm/lm_windows.c src/detection/loadavg/loadavg_nosupport.c src/detection/locale/locale_windows.c src/detection/localip/localip_windows.c diff --git a/src/detection/lm/lm_windows.c b/src/detection/lm/lm_windows.c new file mode 100644 index 000000000..79cffba2b --- /dev/null +++ b/src/detection/lm/lm_windows.c @@ -0,0 +1,19 @@ +#include "lm.h" + +#include "common/windows/version.h" +#include "common/windows/nt.h" + +#include + +const char* ffDetectLM(FFLMResult* result) { + ffStrbufSetStatic(&result->service, "LogonUI"); + ffStrbufSetStatic(&result->prettyName, "Logon User Interface"); + + if (instance.config.general.detectVersion) { + wchar_t exePath[MAX_PATH]; + _snwprintf(exePath, ARRAY_SIZE(exePath), L"%ls\\system32\\%ls", (const wchar_t*) SharedUserData->NtSystemRoot, L"LogonUI.exe"); + ffGetFileVersion(exePath, nullptr, &result->version); + } + + return nullptr; +}