summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2015-04-11 13:56:03 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2015-04-11 13:56:03 +0200
commitefc94ee87ac3b4e3ecf4fb3ab4adac2ef0a6278f (patch)
treedb7429005900561dc0e61dd73de3c514e50cff12
parent6e482795afc203fe53e57739b3b8411352652b60 (diff)
Report Windows 8 and Windows server 2012 by name
-rw-r--r--src/misc.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/misc.c b/src/misc.c
index 9717533..0b02a54 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -54,7 +54,7 @@ const char *get_os(void)
{
static char buffer[100] = {0x00};
/* For more information, read
-http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getting_the_system_version.asp
+https://msdn.microsoft.com/en-us/library/windows/desktop/ms724834%28v=vs.85%29.aspx
*/
OSVERSIONINFOEX Ver;
int Extended = 1;
@@ -144,6 +144,20 @@ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/ge
else
snprintf(buffer, sizeof(buffer) - 1, "Windows Server 2008 R2 (%lu)", Ver.dwBuildNumber);
}
+ else if (Ver.dwMajorVersion == 6 && Ver.dwMinorVersion == 2)
+ {
+ if( Ver.wProductType == VER_NT_WORKSTATION )
+ snprintf(buffer, sizeof(buffer) - 1, "Windows 8 (%lu)", Ver.dwBuildNumber);
+ else
+ snprintf(buffer, sizeof(buffer) - 1, "Windows Server 2012 (%lu)", Ver.dwBuildNumber);
+ }
+ else if (Ver.dwMajorVersion == 6 && Ver.dwMinorVersion == 3)
+ {
+ if( Ver.wProductType == VER_NT_WORKSTATION )
+ snprintf(buffer, sizeof(buffer) - 1, "Windows 8.1 (%lu)", Ver.dwBuildNumber);
+ else
+ snprintf(buffer, sizeof(buffer) - 1, "Windows Server 2012 R2 (%lu)", Ver.dwBuildNumber);
+ }
else
{
snprintf(buffer, sizeof(buffer) - 1, "Windows %s %i.%i.%i",