libmicrovmi
A cross-platform unified interface on top of hypervisor's VMI APIs
Table of Contents
Overview
libmicrovmi simply aims to provide a cross-platform unified Virtual Machine Introspection API and the necessary drivers to be
compatible with the diversity of hypervisors available today.
The term micro (μ) refers to the library's simplicity as well as the letter U
standing for Unified interface.
The grand goal is to be the foundation for a VMI abstraction library that will be
- multi-hypervisor
- multi-emulator
- cross-plaform
- high-level API
- OS-level semantics
- stealth breakpoints
- virtual address translation

Virtual Machine Introspection Apps
- Debugging
- Dynamic Analysis / Sandboxing
- Live Memory Analysis
- Volatility with the
VMIAddressSpace - Rekall with the
VMIAddressSpace
- Volatility with the
- OS Hardening
- Cloud Monitoring
- Fuzzing
Drivers
- Xen
- KVM (based on KVM-VMI)
- VirtualBox (based on icebox)
- Hyper-V (based on LiveCloudKd)
- QEMU (based on TCG Plugins)
VMI API
- Query and modify the VM hardware state
- read/write VCPU registers
- read/write physical memory
- Subscribe and listen to hardware events
- mov to/from CR3/CR8
- mov to/from DRx
- mov to/from MSR
- interrupts
- singlestep (MTF)
- hypercalls
- descriptors
- SLAT (Second Level Address Translation) events
r/w/xevent on a page- dynamically switch to multiple memory views using alternate SLAT pointers
- Intel Processor Trace packets
- Utilities
- foreign mapping
- pagefault injection
For more detailed information, please check the Wiki
Requirements
Ruststablecargoclang(bindgen)
Build
To build the library, simply run
cargo build
By default, only the Dummy driver will be available (it does nothing).
To enable a driver, for example xen, enable the corresponding feature
(Cargo.toml)
cargo build --features xen
Example
mem-dump
A small binary is available to demonstrate what the libmicrovmi can do: mem-dump
It will dump the raw memory of the specified domain in a domain_name.dump
file.
Example with the xen driver:
$ cargo run --features xen --example mem-dump winxp
A memory dump should have been written in winxp.dump.
API example
// select drive type (Dummy, Xen, KVM, ...)
let drv_type = Dummy;
// init library
let mut drv: = init;
// pause VM
drv.pause
.expect;
// get max physical address
let max_addr = drv.get_max_physical_addr
.expect;
// read physical memory
let mut buffer: = ;
let result = drv.read_physical;
// resume VM
drv.resume
.expect;
References
- LibVMI C library: Simplified Virtual Machine Introspection
Maintainers
Contributing
PRs accepted.
Small note: If editing the Readme, please conform to the standard-readme specification.