Skip to content

Commit 7eba4d7

Browse files
committed
1.6 release
1 parent 97ce2b3 commit 7eba4d7

4 files changed

Lines changed: 1617 additions & 570 deletions

File tree

docs/documentation.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,6 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
407407
| `VM::HYPERV_CPUID` | Check for Hyper-V specific CPUID results in ecx | | 35% | | | |
408408
| `VM::CUCKOO_DIR` | Check for Cuckoo specific directory | Windows | 15% | | | |
409409
| `VM::CUCKOO_PIPE` | Check for Cuckoo specific piping mechanism | Windows | 20% | | | |
410-
| `VM::USB_DRIVE` | Check for absence of USB drives | Windows | 5% | | | |
411410
| `VM::HYPERV_HOSTNAME` | Check for default Azure hostname format (Azure uses Hyper-V as their base VM brand) | Windows, Linux | 50% | | | |
412411
| `VM::GENERAL_HOSTNAME` | Check for general hostnames that match with certain VM brands | Windows, Linux | 20% | | | |
413412
| `VM::SCREEN_RESOLUTION` | Check for pre-set screen resolutions commonly found in VMs | Windows | 10% | | | |
@@ -423,7 +422,7 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
423422
| `VM::NO_MEMO` | This will disable memoization, meaning the result will not be fetched through a previous computation of the `VM::detect()` function. Use this if you're only using a single function from the `VM` struct for a performance boost. |
424423
| `VM::EXTREME` | This will disregard the weights/biases in the scoring system. It will essentially treat any technique that found a hit as a VM detection no matter how low that technique's certainty is, so if a single technique is positive then it will return true. |
425424
| `VM::DEFAULT` | This represents a range of flags which are enabled if no default argument is provided. |
426-
| `VM::ENABLE_HYPERV_HOST` | Windows 11 (and 10 if enabled manually) may have Hyper-V as a default virtualisation solution for any host program even if the OS is running as host. There isn't a way to detect whether the host program is ran in default virtualisation mode, or manually intended virtualisation, which is one of the main hurdles of the library to overcome. This is a Hyper-V specific problem, and the library will discard any Hyper-V brand suspicions as not running in a VM by default. But if this flag is enabled then it will still count it regardless of the risk that it might be Hyper-V's default host virtualisation for every host program. So basically this flag means that "I'm aware this program might be running in a default virtualised environment on host, but I'll still count this as running in a VM anyway whether it's default virtualisation or manually intended virtualisation". |
425+
| `VM::ENABLE_HYPERV_HOST` | Windows 11 (and 10 if enabled manually) may have Hyper-V as a default virtualisation solution for any host program even if the OS is running as host. There isn't a way to detect whether the host program is ran in default virtualisation mode, or manually intended virtualisation. This is a Hyper-V specific problem, and the library will use heuristical methods to discard Hyper-V's host virtualiser as not running in a VM by default. But if this flag is enabled then it will still count it regardless of the risk that it might be Hyper-V's default host virtualisation for every host program. So basically this flag means that "I'm aware this program might be running in a default virtualised environment on host, but I'll still count this as running in a VM anyway whether it's default virtualisation or manually intended virtualisation". |
427426
| `VM::WIN_HYPERV_DEFAULT` | ⚠️ **DEPRECATED** ⚠️ Same as above, but deprecated as of 1.5 release. |
428427
| `VM::MULTIPLE` | This is specific to `VM::brand()`. This will basically return a `std::string` message of what brands could be involved. For example, it could return "`VMware or VirtualBox`" instead of having a single brand string output. This has no effect if applied to any other functions than `VM::brand()`. |
429428
| `VM::HIGH_THRESHOLD` | This is specific to `VM::detect()` and `VM::percentage()`, which will set the threshold bar to confidently detect a VM by 3.5x higher. |

src/cli.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
#include <windows.h>
3737
#endif
3838

39-
constexpr const char* ver = "1.5";
40-
constexpr const char* date = "June 2024";
39+
constexpr const char* ver = "1.6";
40+
constexpr const char* date = "July 2024";
4141

4242
constexpr const char* bold = "\033[1m";
4343
constexpr const char* ansi_exit = "\x1B[0m";
@@ -297,7 +297,7 @@ void general(const bool enable_hyperv = true) {
297297
std::cout << "VM brand: " << (brand == "Unknown" ? red : green) << brand << ansi_exit << "\n";
298298

299299
const char* percent_color = "";
300-
const std::uint8_t percent = (enable_hyperv ? VM::percentage(/*VM::ENABLE_HYPERV_HOST*/) : VM::percentage());
300+
const std::uint8_t percent = (enable_hyperv ? VM::percentage(VM::ENABLE_HYPERV_HOST) : VM::percentage());
301301

302302
if (percent == 0) { percent_color = red; }
303303
else if (percent < 25) { percent_color = red_orange; }
@@ -307,7 +307,7 @@ void general(const bool enable_hyperv = true) {
307307

308308
std::cout << "VM likeliness: " << percent_color << static_cast<std::uint32_t>(percent) << "%" << ansi_exit << "\n";
309309

310-
const bool is_detected = (enable_hyperv ? VM::detect(/*VM::ENABLE_HYPERV_HOST*/) : VM::detect());
310+
const bool is_detected = (enable_hyperv ? VM::detect(VM::ENABLE_HYPERV_HOST) : VM::detect());
311311

312312
std::cout << "VM confirmation: " << (is_detected ? green : red) << std::boolalpha << is_detected << std::noboolalpha << ansi_exit << "\n";
313313

src/vmaware.hpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* ██║ ██║██╔████╔██║███████║██║ █╗ ██║███████║██████╔╝█████╗
55
* ╚██╗ ██╔╝██║╚██╔╝██║██╔══██║██║███╗██║██╔══██║██╔══██╗██╔══╝
66
* ╚████╔╝ ██║ ╚═╝ ██║██║ ██║╚███╔███╔╝██║ ██║██║ ██║███████╗
7-
* ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ 1.5 (June 2024)
7+
* ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ 1.6 (July 2024)
88
*
99
* C++ VM detection library
1010
*
@@ -22,14 +22,14 @@
2222
*
2323
*
2424
* ================================ SECTIONS ==================================
25-
* - enums for publicly accessible techniques => line 293
26-
* - struct for internal cpu operations => line 488
27-
* - struct for internal memoization => line 859
28-
* - struct for internal utility functions => line 949
29-
* - struct for internal core components => line 7337
30-
* - start of internal VM detection techniques => line 1727
31-
* - start of public VM detection functions => line 7693
32-
* - start of externally defined variables => line 8038
25+
* - enums for publicly accessible techniques => line 302
26+
* - struct for internal cpu operations => line 519
27+
* - struct for internal memoization => line 891
28+
* - struct for internal utility functions => line 996
29+
* - struct for internal core components => line 7781
30+
* - start of internal VM detection techniques => line 1815
31+
* - start of public VM detection functions => line 8277
32+
* - start of externally defined variables => line 8672
3333
*
3434
*
3535
* ================================ EXAMPLE ==================================
@@ -8096,6 +8096,7 @@ struct VM {
80968096

80978097
core_debug("HYPERV_HOST_CHECK: technique_check = ", no_possible_brand);
80988098

8099+
// by the end of this, if it doesn't find it possible to have Hyper-V then that assumes the result has been tampered somehow
80998100
return (no_possible_brand);
81008101
};
81018102

@@ -8896,4 +8897,4 @@ const std::map<VM::u8, VM::core::technique> VM::core::technique_table = {
88968897
// __TABLE_LABEL, add your technique above
88978898
// { VM::FUNCTION, { POINTS, FUNCTION_POINTER }}
88988899
// ^ template
8899-
};
8900+
};

0 commit comments

Comments
 (0)