Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 986 Bytes

File metadata and controls

38 lines (26 loc) · 986 Bytes

vmaware-rs

Rust bindings for VMAware, a cross-platform C++ framework for virtual machine detection.

The package is published as vmaware-rs, while the Rust library is imported as vmaware.

Installation

[dependencies]
vmaware-rs = { git = "https://github.com/MarcelDev/vmaware-rs.git" }

This crate builds a small C++17 wrapper around the vendored VMAware header. A working C++ compiler is required.

Usage

fn main() -> Result<(), vmaware::Error> {
    println!("is vm: {}", vmaware::detect()?);
    println!("brand: {}", vmaware::brand()?);
    println!("type: {}", vmaware::vm_type()?);
    println!("conclusion: {}", vmaware::conclusion()?);
    println!("percentage: {}%", vmaware::percentage()?);

    Ok(())
}

You can run a small example:

cargo run --example basic

License

Licensed under the MIT License, matching upstream VMAware. The vendored VMAware header is at deps/vmaware.hpp