Skip to content

Commit

Permalink
Merge pull request ayoubfaouzi#212 from LordNoteworthy/Noteworthy
Browse files Browse the repository at this point in the history
Add Is Windows Genuine Check
  • Loading branch information
ayoubfaouzi authored Jun 4, 2020
2 parents 5ff2a16 + ad06d71 commit 8c7a5f3
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

#### 0.80

- Add Windows Genuine check.
- Improve GetOSDisplayString by adding Windows Server 2019.
- Fixed the encoding of some files thanks to @not-matthias.
- Add Missing manifest makes version checks return incorrect values.
- Fix EnumProcessModulesEx crash on XP and some versions of Win7.
- Fixed path names in vmware_files() and vbox_files() due to wow64 fs redirection.
- Fixed string comparaison in check_adapter_name().
- Anti anti-debug trick: trap flag.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Al-Khaser v0.79
## Al-Khaser v0.80

![Logo](https://www.mindmeister.com/files/avatars/0035/8332/original/avatar.jpg)

Expand Down Expand Up @@ -123,7 +123,7 @@ Please, if you encounter any of the anti-analysis tricks which you have seen in
- Sandbox known product IDs (todo)
- Color of background pixel (todo)
- Keyboard layout (Win32/Banload) (todo)

- Genuine Windows installation.


### Anti-Virtualization / Full-System Emulation
Expand Down Expand Up @@ -315,7 +315,7 @@ Please, if you encounter any of the anti-analysis tricks which you have seen in



## Contributors
## Authors
- [mrexodia](http://mrexodia.cf): Main developer of [x64dbg](http://x64dbg.com/)
- [Mattiwatti](https://github.com/Mattiwatti): Matthijs Lavrijsen
- [gsuberland](https://twitter.com/gsuberland): Graham Sutherland
Expand Down
3 changes: 2 additions & 1 deletion al-khaser/Al-khaser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int main(void)
resize_console_window();

/* Display general informations */
_tprintf(_T("[al-khaser version 0.79]"));
_tprintf(_T("[al-khaser version 0.80]"));

print_category(TEXT("Initialisation"));
API::Init();
Expand Down Expand Up @@ -146,6 +146,7 @@ int main(void)
exec_check(&cim_voltagesensor_wmi, TEXT("Checking CIM_VoltageSensor with WMI "));
exec_check(&cim_physicalconnector_wmi, TEXT("Checking CIM_PhysicalConnector with WMI "));
exec_check(&cim_slot_wmi, TEXT("Checking CIM_Slot with WMI "));
exec_check(&pirated_windows, TEXT("Checking if Windows is Genuine "));
}

/* VirtualBox Detection */
Expand Down
27 changes: 27 additions & 0 deletions al-khaser/AntiVM/Generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1490,3 +1490,30 @@ BOOL cim_voltagesensor_wmi()
return FALSE;
}

/*
Checks whether the specified application is a genuine Windows installation.
*/

#define WINDOWS_SLID \
{ 0x55c92734, \
0xd682, \
0x4d71, \
{ 0x98, 0x3e, 0xd6, 0xec, 0x3f, 0x16, 0x05, 0x9f } \
}

BOOL pirated_windows()
{
CONST SLID AppId = WINDOWS_SLID;
SL_GENUINE_STATE GenuineState;
HRESULT hResult;

hResult = SLIsGenuineLocal(&AppId, &GenuineState, NULL);

if (hResult == S_OK) {
if (GenuineState != SL_GEN_STATE_IS_GENUINE) {
return TRUE;
}
}
return FALSE;
}
2 changes: 1 addition & 1 deletion al-khaser/AntiVM/Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ BOOL cim_sensor_wmi();
BOOL cim_slot_wmi();
BOOL cim_temperaturesensor_wmi();
BOOL cim_voltagesensor_wmi();

BOOL pirated_windows();
2 changes: 2 additions & 0 deletions al-khaser/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <SetupAPI.h>
#include <algorithm>
#include <cctype>
#include <slpublic.h> // SLIsGenuineLocal

#pragma comment(lib, "wbemuuid.lib")
#pragma comment(lib, "Shlwapi.lib")
Expand All @@ -53,6 +54,7 @@
#pragma comment(lib, "Winmm.lib")
#pragma comment(lib, "setupapi.lib")
#pragma comment(lib, "powrprof.lib")
#pragma comment(lib, "Slwga.lib")

#include "Shared/Common.h"
#include "Shared/VersionHelpers.h"
Expand Down

0 comments on commit 8c7a5f3

Please sign in to comment.