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
Copy file name to clipboardExpand all lines: docs/documentation.md
+36-2Lines changed: 36 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -289,6 +289,40 @@ This will fetch the number of techniques that have been detected as a `std::uint
289
289
290
290
<br>
291
291
292
+
## `VM::flag_to_string()`
293
+
This will take a technique flag enum as an argument and return the string version of it. For example:
294
+
```cpp
295
+
#include"vmaware.hpp"
296
+
#include<iostream>
297
+
298
+
intmain() {
299
+
const std::string name = VM::flag_to_string(VM::VMID);
300
+
std::cout << "VM::" << name << "\n";
301
+
// Output: VM::VMID
302
+
// (nothing more, nothing less)
303
+
}
304
+
```
305
+
306
+
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:
307
+
308
+
```cpp
309
+
#include"vmaware.hpp"
310
+
#include<iostream>
311
+
312
+
intmain() {
313
+
// this will loop through all the enums in the technique_vector variable,
314
+
// and then checks each of them and outputs the enum that was detected
315
+
for (const auto technique_enum : VM::technique_vector) {
316
+
if (VM::check(technique_enum)) {
317
+
const std::string name = VM::flag_to_string(technique_enum);
318
+
std::cout << "VM::" << name << " was detected\n";
319
+
}
320
+
}
321
+
}
322
+
```
323
+
324
+
<br>
325
+
292
326
# vmaware struct
293
327
If you prefer having an object to store all the relevant information about the program's environment instead of calling static member functions, you can use the `VM::vmaware` struct:
294
328
@@ -353,7 +387,7 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
353
387
|`VM::VM_FILES`| Find for VM-specific specific files | Windows | 25% |||||
354
388
|`VM::HWMODEL`| Check if the sysctl for the hwmodel does not contain the "Mac" string | MacOS | 100% |||||
355
389
|`VM::DISK_SIZE`| Check if disk size is under or equal to 50GB | Linux | 60% |||||
356
-
|`VM::VBOX_DEFAULT`| Check for default RAM and DISK sizes set by VirtualBox | Linux and Windows | 25% | Admin ||||
390
+
|`VM::VBOX_DEFAULT`| Check for default RAM and DISK sizes set by VirtualBox | Linux and Windows | 25% | Admin |||Admin only needed for Linux|
357
391
|`VM::VBOX_NETWORK`| Check for VirtualBox network provider string | Windows | 100% |||||
358
392
|`VM::COMPUTER_NAME`| Check if the computer name (not username to be clear) is VM-specific | Windows | 10% || GPL |||
359
393
|`VM::WINE_CHECK`| Check wine_get_unix_file_name file for Wine | Windows | 100% || GPL |||
@@ -424,7 +458,7 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
424
458
|`VM::VM_SIDT`| Check for unknown IDT base address | Windows | 100% |||||
425
459
|`VM::HDD_SERIAL`| Check for serial numbers of virtual disks | Windows | 100% |||||
426
460
|`VM::PORT_CONNECTORS`| Check for physical connection ports | Windows | 25% |||| This technique is known to false flag on devices like Surface Pro |
427
-
|`VM::GPU`| Check for GPU capabilities and specific GPU PCI vendor ids | Windows | 100% |||||
461
+
|`VM::GPU`| Check for GPU capabilities and specific GPU signatures related to VMs | Windows | 100% |Admin|||Admin only needed for some heuristics|
428
462
|`VM::VM_DEVICES`| Check for VM-specific devices | Windows | 45% |||||
429
463
|`VM::VM_MEMORY`| Check for specific VM memory traces in certain processes | Windows | 65% |||||
430
464
|`VM::IDT_GDT_MISMATCH`| Check if the IDT and GDT base virtual addresses mismatch between different CPU cores when called from usermode under a root partition | Windows | 50% |||||
0 commit comments