Skip to content

Commit 319eb35

Browse files
committed
pre-1.4 release
1 parent 910c414 commit 319eb35

5 files changed

Lines changed: 1031 additions & 26 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
1515
if (MSVC)
1616
set(CMAKE_CXX_FLAGS "/Wall /W4 /std:c++20 /EHsc")
1717
else()
18-
set(CMAKE_CXX_FLAGS "-Wextra -Wall -Wextra -Wconversion -Wdouble-promotion -Wno-unused-parameter -Wno-unused-function -Wno-sign-conversion")
18+
set(CMAKE_CXX_FLAGS "-Wextra -Wall -Wextra -Wconversion -Wdouble-promotion -Wno-unused-parameter -Wno-unused-function -Wno-sign-conversion -fmax-errors=20")
1919
endif()
2020

2121
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")

TODO.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
- [ ] implement smbios version technique [here](https://github.com/Print3M/Anti-VM/blob/eb524ed89e783b36c149acc450b2350d4198b06b/detectors.cpp#L88)
3434
- [ ] implement a display size technique for linux with EDID
3535
- [ ] implement a technique that matches the CPU product name and match it with a database of core counts for that specific CPU product
36+
- [ ] add usage example in the .hpp file directly below the banner
3637

3738
# Distant plans
3839
- add the library to conan.io when released

docs/documentation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,4 +346,5 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
346346
| `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. |
347347
| `VM::EXTREME` | This will disregard the weights/biases and its 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. |
348348
| `VM::DEFAULT` | This represents a range of flags which are enabled if no default argument is provided. The reason why this exists is to easily disable any bits manually (shown in the is_vm6 example in the `VM::detect()` section)
349-
| `VM::WIN_HYPERV_DEFAULT` | Windows 11 (and sometimes 10) may have Hyper-V as a default virtualisation software for any program even if the OS is running as host, which is one of the main hurdles of the library to overcome between host virtualisation and actual virtualisation. The library will discard any Hyper-V brand suspicions as "not running in a VM". This flag will basically mean "I'm aware this program is running in a default virtualised environment even when the user is only using host, "but i'll still count this as running in a VM" |
349+
| `VM::WIN_HYPERV_DEFAULT` | Windows 11 (and sometimes 10) may have Hyper-V as a default virtualisation software for any program even if the OS is running as host, which is one of the main hurdles of the library to overcome between host virtualisation and actual virtualisation. The library will discard any Hyper-V brand suspicions as "not running in a VM". This flag will basically mean "I'm aware this program is running in a default virtualised environment even when the user is only using host, "but i'll still count this as running in a VM" |
350+
| `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. |

src/cli.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ std::string message(const std::uint8_t score, const std::string &brand) {
113113
inside_vm = "Running inside a " + brand + " VM";
114114
}
115115

116-
if (score == 0) { return baremetal; }
116+
if (score == 0) { return baremetal; }
117117
else if (score <= 12) { return very_unlikely; }
118118
else if (score <= 25) { return unlikely; }
119119
else if (score < 50) { return potentially; }
@@ -237,6 +237,7 @@ int main(int argc, char* argv[]) {
237237
checker(VM::MUTEX, "mutex strings");
238238
checker(VM::UPTIME, "uptime");
239239
checker(VM::ODD_CPU_THREADS, "unusual thread count");
240+
checker(VM::INTEL_THREAD_MISMATCH, "Intel thread count mismatch");
240241

241242
std::printf("\n");
242243

@@ -266,7 +267,7 @@ int main(int argc, char* argv[]) {
266267
brand == "Virtual PC" ||
267268
brand == "Microsoft Virtual PC/Hyper-V"
268269
) {
269-
std::cout << note << " If you know you are running on host, Hyper-V virtualises all applications by default within host system, see here https://github.com/kernelwernel/VMAware/issues/75\n";
270+
std::cout << note << " If you know you are running on host, Hyper-V virtualises all applications by default within the host system, see here https://github.com/kernelwernel/VMAware/issues/75\n";
270271
}
271272

272273
const char* conclusion_color = color(percent);

0 commit comments

Comments
 (0)