Skip to content

Commit 6105621

Browse files
author
Requiem
committed
Fixed Hyper-X returning "none found" after a root partition is detected
1 parent 5bf5ec5 commit 6105621

2 files changed

Lines changed: 18 additions & 21 deletions

File tree

src/vmaware.hpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
*
2626
*
2727
* ============================== SECTIONS ==================================
28-
* - enums for publicly accessible techniques => line 551
29-
* - struct for internal cpu operations => line 744
30-
* - struct for internal memoization => line 1198
31-
* - struct for internal utility functions => line 1323
32-
* - struct for internal core components => line 10057
33-
* - start of VM detection technique list => line 2522
34-
* - start of public VM detection functions => line 10721
35-
* - start of externally defined variables => line 11644
28+
* - enums for publicly accessible techniques => line 553
29+
* - struct for internal cpu operations => line 746
30+
* - struct for internal memoization => line 1200
31+
* - struct for internal utility functions => line 1325
32+
* - struct for internal core components => line 10055
33+
* - start of VM detection technique list => line 2521
34+
* - start of public VM detection functions => line 10719
35+
* - start of externally defined variables => line 11642
3636
*
3737
*
3838
* ============================== EXAMPLE ===================================
@@ -184,6 +184,7 @@
184184
#pragma once
185185

186186
#if defined(_WIN32) || defined(_WIN64)
187+
#define WIN32_LEAN_AND_MEAN
187188
#define WINDOWS 1
188189
#define LINUX 0
189190
#define APPLE 0
@@ -1931,9 +1932,6 @@ struct VM {
19311932
* These child partitions have limited privileges and access to hypervisor resources,
19321933
* which is reflected in the maximum input value for hypervisor CPUID information as 11.
19331934
* Essentially, it indicates that the hypervisor is managing the VM and that the VM is not running directly on hardware but rather in a virtualized environment.
1934-
*
1935-
* On the other hand, in bare-metal systems running Hyper-V, the EAX value is 12.
1936-
* This higher value corresponds to the root partition, which has more privileges and control over virtualization resources compared to child partitions.
19371935
*/
19381936
auto eax = []() -> u32 {
19391937
char out[sizeof(int32_t) * 4 + 1] = { 0 };
@@ -2626,7 +2624,6 @@ struct VM {
26262624
#if (!x86)
26272625
return false;
26282626
#else
2629-
26302627
if (util::hyper_x() == HYPERV_ARTIFACT_VM) {
26312628
return false;
26322629
}

src/vmaware_MIT.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@
4747
*
4848
*
4949
* ============================== SECTIONS ==================================
50-
* - enums for publicly accessible techniques => line 573
51-
* - struct for internal cpu operations => line 759
52-
* - struct for internal memoization => line 1214
53-
* - struct for internal utility functions => line 1340
54-
* - struct for internal core components => line 9863
55-
* - start of VM detection technique list => line 2541
56-
* - start of public VM detection functions => line 10538
57-
* - start of externally defined variables => line 11463
50+
* - enums for publicly accessible techniques => line 575
51+
* - struct for internal cpu operations => line 761
52+
* - struct for internal memoization => line 1216
53+
* - struct for internal utility functions => line 1342
54+
* - struct for internal core components => line 9861
55+
* - start of VM detection technique list => line 2540
56+
* - start of public VM detection functions => line 10536
57+
* - start of externally defined variables => line 11461
5858
*
5959
*
6060
* ============================== EXAMPLE ===================================
@@ -206,6 +206,7 @@
206206
#pragma once
207207

208208
#if defined(_WIN32) || defined(_WIN64)
209+
#define WIN32_LEAN_AND_MEAN
209210
#define WINDOWS 1
210211
#define LINUX 0
211212
#define APPLE 0
@@ -2642,7 +2643,6 @@ struct VM {
26422643
#if (!x86)
26432644
return false;
26442645
#else
2645-
26462646
if (util::hyper_x() == HYPERV_ARTIFACT_VM) {
26472647
return false;
26482648
}

0 commit comments

Comments
 (0)