Skip to content

Commit 2acf36d

Browse files
authored
Merge pull request #152 from kernelwernel/dev
Dev
2 parents 8a077fb + a5fa156 commit 2acf36d

12 files changed

+273
-33
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ You can view the full docs [here](docs/documentation.md). All the details such a
141141
> Hyper-V has an obscure feature where if it's enabled in the host system, the CPU hardware values makes it look like the whole system is running inside Hyper-V, which isn't true. This makes it a challenge to determine whether the hardware values the library is collecting is either a real Hyper-V VM, or just the artifacts of what Hyper-V has left as a consequence of having it enabled in the host system. The reason why this is a problem is because the library might falsely conclude that your the host system is running in Hyper-V, which is a false positive. This is where the **Hyper-X** mechanism comes into play to distinguish between these two. This was designed by <a href="https://github.com/NotRequiem">Requiem</a>
142142
143143
<p align="center">
144-
<img src="assets/Hyper-X_version_3.png" align="center" title="Hyper-X">
144+
<img src="assets/hyper-x/v4/Hyper-X_version_4.drawio.png" align="center" title="Hyper-X">
145145
<br>
146146
</details>
147147

TODO.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
- [ ] /sys/class/dmi/id/product_name check this in qemu
5555
- [ ] update sourceforge
5656
- [X] fix the VM::vmaware struct
57-
57+
- [ ] do the ACPI technique and add it to hyper-x
58+
- [ ]
5859

5960
# Distant plans
6061
- add the library to conan.io when released
File renamed without changes.
File renamed without changes.
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0" version="24.7.17">
2+
<diagram name="Page-1" id="zGf0Ftu6_07F7baFzf_Y">
3+
<mxGraphModel dx="1875" dy="788" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
4+
<root>
5+
<mxCell id="0" />
6+
<mxCell id="1" parent="0" />
7+
<mxCell id="x2cThCooTCoZfJnJUzE6-1" value="" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
8+
<mxGeometry x="-30" y="130" width="990" height="540" as="geometry" />
9+
</mxCell>
10+
<mxCell id="x2cThCooTCoZfJnJUzE6-2" value="START" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
11+
<mxGeometry x="790" y="360" width="120" height="60" as="geometry" />
12+
</mxCell>
13+
<mxCell id="x2cThCooTCoZfJnJUzE6-3" value="&lt;div&gt;Run the VM::HYPERVISOR_STR&lt;/div&gt;&lt;div&gt;technique, fetch eax.&lt;br&gt;&lt;/div&gt;" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
14+
<mxGeometry x="780" y="220" width="140" height="85" as="geometry" />
15+
</mxCell>
16+
<mxCell id="x2cThCooTCoZfJnJUzE6-8" value="Hyper-X mechanism (v4)" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=34;fontStyle=1" parent="1" vertex="1">
17+
<mxGeometry x="265" y="160" width="400" height="30" as="geometry" />
18+
</mxCell>
19+
<mxCell id="x2cThCooTCoZfJnJUzE6-10" value="Not Hyper-V, continue as normal" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" vertex="1">
20+
<mxGeometry y="207" width="110" height="110" as="geometry" />
21+
</mxCell>
22+
<mxCell id="x2cThCooTCoZfJnJUzE6-23" value="Does the SMBIOS show any strings related to Hyper-V?&lt;br&gt;(VM::MSSMBIOS)" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
23+
<mxGeometry x="240" y="390" width="150" height="80" as="geometry" />
24+
</mxCell>
25+
<mxCell id="x2cThCooTCoZfJnJUzE6-24" value="Does the motherboard match with Hyper-V&lt;br&gt;or VirtualPC?&lt;br&gt;(VM::VPC_BOARD)" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
26+
<mxGeometry x="70" y="390" width="150" height="80" as="geometry" />
27+
</mxCell>
28+
<mxCell id="x2cThCooTCoZfJnJUzE6-32" value="&lt;div&gt;&lt;font style=&quot;font-size: 11px;&quot;&gt;Hyper-V detected,&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font style=&quot;font-size: 11px;&quot;&gt;this is in fact a VM&lt;/font&gt;&lt;/div&gt;" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
29+
<mxGeometry x="610" y="520" width="110" height="110" as="geometry" />
30+
</mxCell>
31+
<mxCell id="x2cThCooTCoZfJnJUzE6-33" value="Hyper-V host artifacts detected, this is NOT a VM" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" vertex="1">
32+
<mxGeometry x="130" y="520" width="110" height="110" as="geometry" />
33+
</mxCell>
34+
<mxCell id="4PM8ViUepl_GfYZcxHRn-10" value="Does the CPU match with the VMProtect technique for Hyper-V root partition detection?" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
35+
<mxGeometry x="180" y="222" width="150" height="80" as="geometry" />
36+
</mxCell>
37+
<mxCell id="mEdIK6QNIQfA6IXG1Q04-6" value="Does eax have the &lt;br&gt;&lt;div&gt;value of 11?&lt;/div&gt;" style="rhombus;whiteSpace=wrap;html=1;" parent="1" vertex="1">
38+
<mxGeometry x="580" y="212.5" width="170" height="100" as="geometry" />
39+
</mxCell>
40+
<mxCell id="mEdIK6QNIQfA6IXG1Q04-16" value="Do the Windows event logs show any indication of Hyper-V?&lt;br&gt;(VM::EVENT_LOGS)" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
41+
<mxGeometry x="410" y="390" width="150" height="80" as="geometry" />
42+
</mxCell>
43+
<mxCell id="mEdIK6QNIQfA6IXG1Q04-20" value="Are at least one &lt;br&gt;of these true?" style="rhombus;whiteSpace=wrap;html=1;" parent="1" vertex="1">
44+
<mxGeometry x="340" y="525" width="170" height="100" as="geometry" />
45+
</mxCell>
46+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-1" value="Does eax have the &lt;br&gt;&lt;div&gt;value of 12?&lt;/div&gt;" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
47+
<mxGeometry x="370" y="212" width="170" height="100" as="geometry" />
48+
</mxCell>
49+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-2" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="mEdIK6QNIQfA6IXG1Q04-6" target="x2cThCooTCoZfJnJUzE6-32">
50+
<mxGeometry width="50" height="50" relative="1" as="geometry">
51+
<mxPoint x="310" y="550" as="sourcePoint" />
52+
<mxPoint x="360" y="500" as="targetPoint" />
53+
</mxGeometry>
54+
</mxCell>
55+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-3" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="x2cThCooTCoZfJnJUzE6-2" target="x2cThCooTCoZfJnJUzE6-3">
56+
<mxGeometry width="50" height="50" relative="1" as="geometry">
57+
<mxPoint x="340" y="550" as="sourcePoint" />
58+
<mxPoint x="390" y="500" as="targetPoint" />
59+
</mxGeometry>
60+
</mxCell>
61+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-4" value="" style="endArrow=classic;html=1;rounded=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="x2cThCooTCoZfJnJUzE6-3" target="mEdIK6QNIQfA6IXG1Q04-6">
62+
<mxGeometry width="50" height="50" relative="1" as="geometry">
63+
<mxPoint x="340" y="550" as="sourcePoint" />
64+
<mxPoint x="390" y="500" as="targetPoint" />
65+
</mxGeometry>
66+
</mxCell>
67+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-5" value="" style="endArrow=classic;html=1;rounded=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="mEdIK6QNIQfA6IXG1Q04-6" target="6Mm_VMVsP4fTWzJjbTtz-1">
68+
<mxGeometry width="50" height="50" relative="1" as="geometry">
69+
<mxPoint x="340" y="550" as="sourcePoint" />
70+
<mxPoint x="390" y="500" as="targetPoint" />
71+
</mxGeometry>
72+
</mxCell>
73+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-6" value="" style="endArrow=classic;html=1;rounded=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="6Mm_VMVsP4fTWzJjbTtz-1" target="4PM8ViUepl_GfYZcxHRn-10">
74+
<mxGeometry width="50" height="50" relative="1" as="geometry">
75+
<mxPoint x="340" y="550" as="sourcePoint" />
76+
<mxPoint x="390" y="500" as="targetPoint" />
77+
</mxGeometry>
78+
</mxCell>
79+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-7" value="" style="endArrow=classic;html=1;rounded=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="4PM8ViUepl_GfYZcxHRn-10" target="x2cThCooTCoZfJnJUzE6-10">
80+
<mxGeometry width="50" height="50" relative="1" as="geometry">
81+
<mxPoint x="300" y="310" as="sourcePoint" />
82+
<mxPoint x="350" y="260" as="targetPoint" />
83+
</mxGeometry>
84+
</mxCell>
85+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-8" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" target="x2cThCooTCoZfJnJUzE6-24">
86+
<mxGeometry width="50" height="50" relative="1" as="geometry">
87+
<mxPoint x="260" y="360" as="sourcePoint" />
88+
<mxPoint x="420" y="260" as="targetPoint" />
89+
<Array as="points">
90+
<mxPoint x="145" y="360" />
91+
</Array>
92+
</mxGeometry>
93+
</mxCell>
94+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-11" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" target="mEdIK6QNIQfA6IXG1Q04-16">
95+
<mxGeometry width="50" height="50" relative="1" as="geometry">
96+
<mxPoint x="260" y="360" as="sourcePoint" />
97+
<mxPoint x="420" y="260" as="targetPoint" />
98+
<Array as="points">
99+
<mxPoint x="485" y="360" />
100+
</Array>
101+
</mxGeometry>
102+
</mxCell>
103+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-12" value="" style="endArrow=none;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;endFill=0;" edge="1" parent="1">
104+
<mxGeometry width="50" height="50" relative="1" as="geometry">
105+
<mxPoint x="250" y="302" as="sourcePoint" />
106+
<mxPoint x="315" y="360" as="targetPoint" />
107+
<Array as="points">
108+
<mxPoint x="250" y="330" />
109+
<mxPoint x="315" y="330" />
110+
</Array>
111+
</mxGeometry>
112+
</mxCell>
113+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-13" value="" style="endArrow=none;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;endFill=0;" edge="1" parent="1" source="6Mm_VMVsP4fTWzJjbTtz-1">
114+
<mxGeometry width="50" height="50" relative="1" as="geometry">
115+
<mxPoint x="450" y="320" as="sourcePoint" />
116+
<mxPoint x="310" y="330" as="targetPoint" />
117+
<Array as="points">
118+
<mxPoint x="455" y="330" />
119+
</Array>
120+
</mxGeometry>
121+
</mxCell>
122+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-15" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" target="x2cThCooTCoZfJnJUzE6-23">
123+
<mxGeometry width="50" height="50" relative="1" as="geometry">
124+
<mxPoint x="315" y="360" as="sourcePoint" />
125+
<mxPoint x="380" y="420" as="targetPoint" />
126+
</mxGeometry>
127+
</mxCell>
128+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-16" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="x2cThCooTCoZfJnJUzE6-24" target="mEdIK6QNIQfA6IXG1Q04-20">
129+
<mxGeometry width="50" height="50" relative="1" as="geometry">
130+
<mxPoint x="330" y="420" as="sourcePoint" />
131+
<mxPoint x="380" y="370" as="targetPoint" />
132+
<Array as="points">
133+
<mxPoint x="145" y="500" />
134+
<mxPoint x="425" y="500" />
135+
</Array>
136+
</mxGeometry>
137+
</mxCell>
138+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-17" value="" style="endArrow=none;html=1;rounded=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" target="x2cThCooTCoZfJnJUzE6-23">
139+
<mxGeometry width="50" height="50" relative="1" as="geometry">
140+
<mxPoint x="315" y="500" as="sourcePoint" />
141+
<mxPoint x="430" y="370" as="targetPoint" />
142+
</mxGeometry>
143+
</mxCell>
144+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-18" value="" style="endArrow=none;html=1;rounded=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" target="mEdIK6QNIQfA6IXG1Q04-16">
145+
<mxGeometry width="50" height="50" relative="1" as="geometry">
146+
<mxPoint x="420" y="500" as="sourcePoint" />
147+
<mxPoint x="430" y="370" as="targetPoint" />
148+
<Array as="points">
149+
<mxPoint x="485" y="500" />
150+
</Array>
151+
</mxGeometry>
152+
</mxCell>
153+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-19" value="" style="endArrow=classic;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="mEdIK6QNIQfA6IXG1Q04-20" target="x2cThCooTCoZfJnJUzE6-32">
154+
<mxGeometry width="50" height="50" relative="1" as="geometry">
155+
<mxPoint x="380" y="420" as="sourcePoint" />
156+
<mxPoint x="430" y="370" as="targetPoint" />
157+
</mxGeometry>
158+
</mxCell>
159+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-20" value="" style="endArrow=classic;html=1;rounded=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="mEdIK6QNIQfA6IXG1Q04-20" target="x2cThCooTCoZfJnJUzE6-33">
160+
<mxGeometry width="50" height="50" relative="1" as="geometry">
161+
<mxPoint x="380" y="420" as="sourcePoint" />
162+
<mxPoint x="430" y="370" as="targetPoint" />
163+
</mxGeometry>
164+
</mxCell>
165+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-21" value="No" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
166+
<mxGeometry x="280" y="545" width="60" height="30" as="geometry" />
167+
</mxCell>
168+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-22" value="Yes" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
169+
<mxGeometry x="510" y="545" width="60" height="30" as="geometry" />
170+
</mxCell>
171+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-23" value="No" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
172+
<mxGeometry x="120" y="230" width="60" height="30" as="geometry" />
173+
</mxCell>
174+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-24" value="No" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
175+
<mxGeometry x="323" y="231" width="60" height="30" as="geometry" />
176+
</mxCell>
177+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-25" value="Yes" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
178+
<mxGeometry x="395" y="302" width="60" height="30" as="geometry" />
179+
</mxCell>
180+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-26" value="Yes" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
181+
<mxGeometry x="250" y="302" width="60" height="30" as="geometry" />
182+
</mxCell>
183+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-27" value="No" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
184+
<mxGeometry x="530" y="231" width="60" height="30" as="geometry" />
185+
</mxCell>
186+
<mxCell id="6Mm_VMVsP4fTWzJjbTtz-30" value="Yes" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
187+
<mxGeometry x="605" y="312" width="60" height="30" as="geometry" />
188+
</mxCell>
189+
</root>
190+
</mxGraphModel>
191+
</diagram>
192+
</mxfile>
113 KB
Loading

src/cli.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ bool are_perms_required(const VM::enum_flags flag) {
311311
default: return false;
312312
}
313313
#else
314+
(void)flag;
314315
return false;
315316
#endif
316317
}

0 commit comments

Comments
 (0)