#detect #x86-64 #vm #hypervisor #inspect #virtual #running

vm-detect

Detect if your rust code is running under a virtual machine (only for x86_64 and x86)

1 unstable release

0.1.0 Sep 1, 2023

#194 in Emulators

Download history 6/week @ 2024-02-19 14/week @ 2024-02-26 1/week @ 2024-03-11 19/week @ 2024-04-01 47/week @ 2024-04-15

66 downloads per month

MIT license

6KB
106 lines

Basic VM detection for x86 and x86_64

Usage:

use vm_detect::{vm_detect, Detection};

fn main() {
    // Run detection
    let detection = vm_detect();

    // Inspect detections
    if detection.contains(Detection::HYPERVISOR_BIT) {
        println!("Hypervisor bit set!");
    }
}

Dependencies

~115KB