Skip to content

Commit 6586add

Browse files
authored
Merge pull request #370 from NotRequiem/dev
merged techniques
2 parents 0dd487e + de76995 commit 6586add

3 files changed

Lines changed: 172 additions & 221 deletions

File tree

docs/documentation.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
444444
| `VM::TIMER` | Check for timing anomalies in the system | 🐧🪟🍏 | 45% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L8169 ) |
445445
| `VM::THREADCOUNT` | Check if there are only 1 or 2 threads, which is a common pattern in VMs with default settings (nowadays physical CPUs should have at least 4 threads for modern CPUs) | 🐧🪟🍏 | 35% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L2649) |
446446
| `VM::MAC` | Check if mac address starts with certain VM designated values | 🐧🪟 | 20% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L2671) |
447-
| `VM::TEMPERATURE` | Check if thermal directory in linux is present, might not be present in VMs | 🐧 | 15% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L2804) |
447+
| `VM::TEMPERATURE` | Check for device's temperature | 🐧🪟 | 15% | | | | Disabled by default | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L2804) |
448448
| `VM::SYSTEMD` | Check result from systemd-detect-virt tool | 🐧 | 35% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L2818) |
449449
| `VM::CVENDOR` | Check if the chassis vendor is a VM vendor | 🐧 | 65% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L2671) |
450450
| `VM::CTYPE` | Check if the chassis type is valid (it's very often invalid in VMs) | 🐧 | 20% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L2875) |
@@ -510,7 +510,6 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
510510
| `VM::VM_PROCS` | Check for a Xen VM process | 🐧 | 10% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L7161) |
511511
| `VM::VBOX_MODULE` | Check for a VBox kernel module | 🐧 | 15% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L7184) |
512512
| `VM::SYSINFO_PROC` | Check for potential VM info in /proc/sysinfo | 🐧 | 15% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L7211) |
513-
| `VM::DEVICE_TREE` | Check for specific files in /proc/device-tree directory | 🐧 | 20% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L7238) |
514513
| `VM::DMI_SCAN` | Check for string matches of VM brands in the linux DMI | 🐧 | 50% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L7256) |
515514
| `VM::SMBIOS_VM_BIT` | Check for the VM bit in the SMBIOS data | 🐧 | 50% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L7340) |
516515
| `VM::PODMAN_FILE` | Check for podman file in /run/ | 🐧 | 5% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L7374) |
@@ -526,8 +525,7 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
526525
| `VM::VM_DEVICES` | Check for VM-specific devices | 🪟 | 50% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L7848) |
527526
| `VM::PROCESSOR_NUMBER` | Check for number of processors | 🪟 | 50% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L7999) |
528527
| `VM::NUMBER_OF_CORES` | Check for number of cores | 🪟 | 50% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L8024) |
529-
| `VM::ACPI_TEMPERATURE` | Check for device's temperature | 🪟 | 25% | | | | Disabled by default | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L8057) |
530-
| `VM::SYS_QEMU` | Check for existence of "qemu_fw_cfg" directories within /sys/module and /sys/firmware | 🐧 | 70% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L8330) |
528+
| `VM::QEMU_FW_CFG` | Check for QEMU fw_cfg interface | 🐧 | 70% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L8330) |
531529
| `VM::LSHW_QEMU` | Check for QEMU string instances with lshw command | 🐧 | 80% | | | | Disabled by default | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L8364) |
532530
| `VM::VIRTUAL_PROCESSORS` | Check if the number of virtual and logical processors are reported correctly by the system | 🪟 | 50% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L8411) |
533531
| `VM::HYPERV_QUERY` | Check if a call to NtQuerySystemInformation with the 0x9f leaf fills a _SYSTEM_HYPERVISOR_DETAIL_INFORMATION structure | 🪟 | 100% | | | | | [link](https://github.com/kernelwernel/VMAware/blob/8cb2491b1c7d2cb7300d1d698b7c64c953b4ae75/src/vmaware.hpp#L8451) |

src/cli.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,7 @@ bool is_disabled(const VM::enum_flags flag) {
330330
switch (flag) {
331331
case VM::VMWARE_DMESG:
332332
case VM::PORT_CONNECTORS:
333-
case VM::ACPI_TEMPERATURE:
334-
case VM::LSHW_QEMU: return true;
333+
case VM::LSHW_QEMU:
335334
default: return false;
336335
}
337336
}
@@ -382,7 +381,6 @@ bool is_unsupported(VM::enum_flags flag) {
382381
case VM::VM_PROCS:
383382
case VM::VBOX_MODULE:
384383
case VM::SYSINFO_PROC:
385-
case VM::DEVICE_TREE:
386384
case VM::DMI_SCAN:
387385
case VM::SMBIOS_VM_BIT:
388386
case VM::PODMAN_FILE:
@@ -411,6 +409,7 @@ bool is_unsupported(VM::enum_flags flag) {
411409
case VM::TIMER:
412410
case VM::THREADCOUNT:
413411
case VM::MAC:
412+
case VM::TEMPERATURE:
414413
case VM::DLL:
415414
case VM::REGISTRY:
416415
case VM::VM_FILES:
@@ -456,7 +455,6 @@ bool is_unsupported(VM::enum_flags flag) {
456455
case VM::GPU_CAPABILITIES:
457456
case VM::PROCESSOR_NUMBER:
458457
case VM::NUMBER_OF_CORES:
459-
case VM::ACPI_TEMPERATURE:
460458
case VM::POWER_CAPABILITIES:
461459
case VM::SETUPAPI_DISK:
462460
case VM::VIRTUAL_PROCESSORS:
@@ -942,7 +940,6 @@ void general() {
942940
checker(VM::VM_PROCS, "various VM files in /proc");
943941
checker(VM::VBOX_MODULE, "VBox kernel module");
944942
checker(VM::SYSINFO_PROC, "/proc/sysinfo");
945-
checker(VM::DEVICE_TREE, "/proc/device-tree");
946943
checker(VM::DMI_SCAN, "DMI scan");
947944
checker(VM::SMBIOS_VM_BIT, "SMBIOS VM bit");
948945
checker(VM::PODMAN_FILE, "podman file");
@@ -957,8 +954,7 @@ void general() {
957954
checker(VM::GPU_VM_STRINGS, "GPU strings");
958955
checker(VM::PROCESSOR_NUMBER, "processor count");
959956
checker(VM::NUMBER_OF_CORES, "CPU core count");
960-
checker(VM::ACPI_TEMPERATURE, "thermal devices");
961-
checker(VM::POWER_CAPABILITIES, "power capabilities");
957+
checker(VM::POWER_CAPABILITIES, "Power capabilities");
962958
checker(VM::SETUPAPI_DISK, "SETUPDI diskdrive");
963959
checker(VM::QEMU_FW_CFG, "QEMU fw_cfg device");
964960
checker(VM::LSHW_QEMU, "QEMU in lshw output");

0 commit comments

Comments
 (0)