Skip to content

Commit 3659c33

Browse files
authored
Merge pull request #69 from kernelwernel/dev
Dev
2 parents 9b71d49 + 4393778 commit 3659c33

8 files changed

Lines changed: 212 additions & 195 deletions

File tree

.github/workflows/build_run_win_32.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ echo on
22
cd "%~dp0..\.."
33
mkdir build
44
cd build
5-
cmake -G "Visual Studio 17 2022" -A Win32 -S ..
5+
cmake -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 17 2022" -A Win32 -S ..
66
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.com" "VMAware.sln" /Build "Release|Win32" /Project "vmaware" /ProjectConfig "Release|Win32"
77
cd Release
88
vmaware.exe

.github/workflows/build_run_win_64.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ echo on
22
cd "%~dp0..\.."
33
mkdir build
44
cd build
5-
cmake -G "Visual Studio 17 2022" -A x64 -S ..
5+
cmake -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 17 2022" -A x64 -S ..
66
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.com" "VMAware.sln" /Build "Release|x64" /Project "vmaware" /ProjectConfig "Release|x64"
77
cd Release
88
vmaware.exe

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ set(TARGET "vmaware")
4747
if (MSVC)
4848
if(CMAKE_BUILD_TYPE MATCHES "Debug")
4949
MESSAGE(STATUS "Build set to debug mode")
50-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Od /RTC1 /debug")
50+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Od /debug")
5151
elseif(CMAKE_BUILD_TYPE MATCHES "Release")
5252
MESSAGE(STATUS "Build set to release mode")
5353
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ And if you found this project useful, a star would be appreciated :)
150150
- Tom Liston + Ed Skoudis
151151
- [Tobias Klein](https://www.trapkit.de/index.html)
152152
- [(S21sec) Alfredo Omella](https://www.s21sec.com/)
153-
- [(eEye Digital Security) Derek Soeder]()
153+
- [hfiref0x](https://github.com/hfiref0x)
154154

155155
<br>
156156

TODO.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@
1818
- [ ] fix memoization
1919
- [X] add a python script to automatically set the lines of the seperate sections in the header
2020
- [ ] add C++20 concepts for the VM::add_custom() function
21-
- [ ] check for valid monitor technique
21+
- [X] check for valid monitor technique
2222
- [ ] fix the is_admin code for windows
23-
- [ ] test it on compiler explorer with windows 32-bit settings
23+
- [X] test it on compiler explorer with windows 32-bit settings
24+
- [ ] upload the lib to dnf
25+
- [ ] upload the lib to apt
26+
- [X] add ARM support
27+
- [ ] look into what `fv-az663-325` is
28+
- [ ] implement techniques from [here](https://labs.nettitude.com/blog/vm-detection-tricks-part-3-hyper-v-raw-network-protocol/)
29+
- [ ] add multiple choice for VM::brand()
2430

2531
# Distant plans
26-
- add ARM support
2732
- add the library to conan.io when released

docs/documentation.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,18 @@ int main() {
7979
This will essentially return the VM brand as a `std::string`. The exact possible brand string return values are:
8080
- `VMware`
8181
- `VirtualBox`
82+
- `VMware`
83+
- `VMware Express`
84+
- `VMware ESX`
85+
- `VMware GSX`
86+
- `VMware Workstation`
8287
- `bhyve`
8388
- `KVM`
8489
- `QEMU`
8590
- `QEMU+KVM`
8691
- `Microsoft Hyper-V`
92+
- `Virtual PC`
93+
- `Microsoft Virtual PC/Hyper-V`
8794
- `Microsoft x86-to-ARM`
8895
- `Parallels`
8996
- `Xen HVM`
@@ -94,7 +101,6 @@ This will essentially return the VM brand as a `std::string`. The exact possible
94101
- `Docker`
95102
- `Wine`
96103
- `Virtual Apple`
97-
- `Virtual PC`
98104
- `Anubis`
99105
- `JoeBox`
100106
- `Thread Expert`
@@ -267,9 +273,9 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
267273
| `VM::PARALLELS_VM` | Check for indications of Parallels VM | Windows | 50% | | |
268274
| `VM::RDTSC_VMEXIT` | Check for RDTSC technique with VMEXIT | Yes | 50% | | |
269275
| `VM::LOADED_DLLS` | Check for DLLs of multiple VM brands | Windows | 75% | | GPL |
270-
| `VM::QEMU_BRAND` | Check for QEMU CPU brand with cpuid | Yes | 100% | | |
276+
| `VM::QEMU_BRAND` | Check for QEMU CPU brand with cpuid | Yes | 100% | | |
271277
| `VM::BOCHS_CPU` | Check for Bochs cpuid emulation oversights | Yes | 95% | | |
272-
| `VM::VPC_BOARD` | Check for VPC specific string in motherboard manufacturer | Windows | 20% | | |
278+
| `VM::VPC_BOARD` | Check for VPC specific string in motherboard manufacturer | Windows | 20% | | |
273279
| `VM::HYPERV_WMI` | Check for Hyper-V wmi output | Windows | 80% | | |
274280
| `VM::HYPERV_REG` | Check for Hyper-V strings in registry | Windows | 80% | | |
275281
| `VM::BIOS_SERIAL` | Check if BIOS serial number is null | Windows | 60% | | |

src/cli.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ int main(int argc, char* argv[]) {
218218
checker(VM::HYPERV_REG, "Hyper-V registry");
219219
checker(VM::HYPERV_WMI, "Hyper-V WMI output");
220220
checker(VM::VBOX_FOLDERS, "VirtualBox shared folders");
221-
checker(VM::VBOX_MSSMBIOS, "VirtualBox MSSMBIOS");
221+
checker(VM::MSSMBIOS, "MSSMBIOS");
222222
checker(VM::MAC_MEMSIZE, "MacOS hw.memsize");
223223
checker(VM::MAC_IOKIT, "MacOS registry IO-kit");
224224
checker(VM::IOREG_GREP, "IO registry grep");
@@ -247,15 +247,15 @@ int main(int argc, char* argv[]) {
247247
checker(VM::VMWARE_IOPORTS, "/proc/ioports file");
248248
checker(VM::VMWARE_SCSI, "/proc/scsi/scsi file");
249249
checker(VM::VMWARE_DMESG, "VMware dmesg");
250-
checker(VM::VMWARE_EMULATION, "VMware emulation mode");
251250
checker(VM::VMWARE_STR, "STR instruction");
252251
checker(VM::VMWARE_BACKDOOR, "VMware IO port backdoor");
253-
checker(VM::SMSW, "SMSW instruction");
254252
checker(VM::VMWARE_PORT_MEM, "VMware port memory");
253+
checker(VM::SMSW, "SMSW instruction");
254+
checker(VM::MUTEX, "mutex strings");
255255

256256
std::printf("\n");
257257

258-
const std::string brand = VM::brand();
258+
const std::string brand = VM::brand(VM::MULTIPLE);
259259

260260
std::cout << "VM brand: " << (brand == "Unknown" ? red : green) << brand << ansi_exit << "\n";
261261

@@ -309,7 +309,7 @@ int main(int argc, char* argv[]) {
309309
version();
310310
return 0;
311311
} else if (cmp(arg, "-b") || cmp(arg, "--brand")) {
312-
std::cout << VM::brand() << "\n";
312+
std::cout << VM::brand(VM::MULTIPLE) << "\n";
313313
return 0;
314314
} else if (cmp(arg, "-p") || cmp(arg, "--percent")) {
315315
std::cout << static_cast<std::uint32_t>(VM::percentage()) << "\n";

0 commit comments

Comments
 (0)