Rust bindings to VMAware, a cross-platform C++ single-header library for VM detection.
A working C++ compiler
Libclang (because rust-bindgen uses it)
[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(())
}Licensed under the MIT License, matching upstream VMAware. The vendored VMAware header is at deps/vmaware.hpp.