You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Notes and overall things to avoid](#notes-and-overall-things-to-avoid)
17
17
-[Flag table](#flag-table)
@@ -25,7 +25,7 @@
25
25
26
26
## `VM::detect()`
27
27
28
-
This is basically the main function you're looking for, which returns a bool. If no parameter is provided, all the recommended checks will be performed. But you can optionally set what techniques are used.
28
+
This is basically the main function you're looking for, which returns a bool. If no parameter is provided, all the recommended checks will be performed. But you can optionally set which techniques are used.
29
29
30
30
```cpp
31
31
#include"vmaware.hpp"
@@ -46,10 +46,9 @@ int main() {
46
46
47
47
/**
48
48
* All checks are performed including techniques that are
49
-
* disabled by default for a viariety of reasons. There are
50
-
* around 5 technique that are disabled. If you want all
51
-
* techniques for the sake of completeness, then you can use
52
-
* this flag but remember that there may be potential
49
+
* disabled by default for a viariety of reasons. If you
50
+
* want all techniques for the sake of completeness, then
51
+
* you can use this flag but remember that there may be potential
53
52
* performance bottlenecks and an increase in false positives.
54
53
*/
55
54
bool is_vm3 = VM::detect(VM::ALL);
@@ -99,7 +98,7 @@ int main() {
99
98
<br>
100
99
101
100
## `VM::percentage()`
102
-
This will return a `std::uint8_t` between 0 and 100. It'll return the certainty of whether it has detected a VM based on all the techniques available as a percentage. The lower the value, the less chance it's a VM. The higher the value, the more likely it is.
101
+
This will return a `std::uint8_t` between 0 and 100. It'll return the certainty of whether it has detected a VM based on all the techniques available as a percentage.
103
102
104
103
```cpp
105
104
#include"vmaware.hpp"
@@ -118,8 +117,8 @@ int main() {
118
117
std::cout << "Unsure if it's a VM\n";
119
118
}
120
119
121
-
// converted to std::uint32_t for console character encoding reasons
@@ -322,22 +321,18 @@ This will detect whether the environment has any hardening indications as a `boo
322
321
323
322
Internally, this function works by analysing which combination of techniques are expected to be detected together. If a certain combination rule is mismatched, it indicates some kind of tampering of the system which assumes some sort of VM hardening.
324
323
325
-
326
-
> [!WARNING]
327
-
> This function should **NOT** be depended on for critical code. This is still a beta feature that hasn't been widely stress-tested as of 2.5.0. It works more as a heuristic assumption rather than a concrete guarantee.
324
+
Similiary to `VM::brand()`, do not rely on this function for critical operations. This is meant to be a heuristic assumption rather than a concrete guarantee.
This will take a technique flag enum as an argument and return the string version of it. For example:
350
+
351
351
```cpp
352
352
#include"vmaware.hpp"
353
353
#include<iostream>
@@ -362,7 +362,7 @@ int main() {
362
362
}
363
363
```
364
364
365
-
The reason why this exists is because it can be useful for debugging purposes. It should be noted that the "VM::" part is not included in the string output, so that's based on the programmer's choice if it should remain in the string or not. The example given above is obviously useless since the whole code can be manually handwritten, but the function is especially convenient if it's being used with [`VM::technique_vector`](#variables). For example:
365
+
The reason why this exists is because it can be useful for debugging and infodumping purposes. It should be noted that the "VM::" part is not included in the string output, so that's based on the programmer's choice if it should remain in the string or not. The example given above is obviously useless since the whole code can be manually handwritten, but the function is especially convenient if it's being used with [`VM::technique_vector`](#variables). For example:
366
366
367
367
```cpp
368
368
#include"vmaware.hpp"
@@ -382,9 +382,15 @@ int main() {
382
382
}
383
383
```
384
384
385
+
</details>
386
+
385
387
<br>
386
388
387
-
## `VM::detected_enums()`
389
+
## (Advanced) `VM::detected_enums()`
390
+
391
+
<details>
392
+
<summary>Show</summary>
393
+
388
394
This is a function that will return a vector of all the technique flags that were detected as running in a VM. The return type is `std::vector<VM::enum_flags>`, and it's designed to give a more programmatic overview of the result.
0 commit comments