|
19 | 19 | * - Full credits: https://github.com/kernelwernel/VMAware#credits-and-contributors-%EF%B8%8F |
20 | 20 | * - License: GPL-3.0 |
21 | 21 | * |
| 22 | + * |
22 | 23 | * ================================ SECTIONS ================================== |
23 | | - * - enums for publicly accessible techniques => line 252 |
24 | | - * - struct for internal cpu operations => line 447 |
25 | | - * - struct for internal memoization => line 684 |
26 | | - * - struct for internal utility functions => line 757 |
27 | | - * - struct for internal core components => line 5713 |
28 | | - * - start of internal VM detection techniques => line 1423 |
29 | | - * - start of public VM detection functions => line 5786 |
30 | | - * - start of externally defined variables => line 6053 |
| 24 | + * - enums for publicly accessible techniques => line 282 |
| 25 | + * - struct for internal cpu operations => line 480 |
| 26 | + * - struct for internal memoization => line 772 |
| 27 | + * - struct for internal utility functions => line 834 |
| 28 | + * - struct for internal core components => line 7073 |
| 29 | + * - start of internal VM detection techniques => line 1510 |
| 30 | + * - start of public VM detection functions => line 7187 |
| 31 | + * - start of externally defined variables => line 7487 |
| 32 | + * |
| 33 | + * |
| 34 | + * ================================ EXAMPLE ================================== |
| 35 | +#include "vmaware.hpp" |
| 36 | +#include <iostream> |
| 37 | +
|
| 38 | +int main() { |
| 39 | + if (VM::detect()) { |
| 40 | + std::cout << "Virtual machine detected!" << std::endl; |
| 41 | + std::cout << "VM name: " << VM::brand() << std::endl; |
| 42 | + } else { |
| 43 | + std::cout << "Running in baremetal" << std::endl; |
| 44 | + } |
| 45 | + |
| 46 | + std::cout << "VM certainty: " << (int)VM::percentage() << "%" << std::endl; |
| 47 | +} |
| 48 | +
|
31 | 49 | */ |
32 | 50 |
|
| 51 | + |
33 | 52 | #if (defined(_MSC_VER) || defined(_WIN32) || defined(_WIN64) || defined(__MINGW32__)) |
34 | 53 | #define MSVC 1 |
35 | 54 | #define LINUX 0 |
|
0 commit comments