Skip to content

MarcelDev/vmaware-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vmaware-rs

Rust bindings to VMAware, a cross-platform C++ single-header library for VM detection.

Requirements

A working C++ compiler

Libclang (because rust-bindgen uses it)

Usage

[dependencies]
vmaware = { git = "https://github.com/MarcelDev/vmaware-rs" }
use vmaware::{detect, brand, vm_type, conclusion, percentage, detected_count, is_hardened, check, flags};

fn main() -> Result<(), vmaware::VmawareError> {
    println!("is vm: {}", detect()?);
    println!("brand: {}", brand()?);
    println!("type: {}", vm_type()?);
    println!("conclusion: {}", conclusion()?);
    println!("percentage: {}%", percentage()?);
    println!("detected techniques: {}", detected_count()?);
    println!("hardened: {}", is_hardened()?);

    // check a single technique
    if check(flags::HYPERVISOR_BIT)? {
        println!("hypervisor bit is set");
    }

    Ok(())
}

License

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

About

Rust bindings for VMAware, a cross-platform library for VM detection

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages