Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emesare/windows-hypervisor
Ergonomic and safe bindings to WHP
https://github.com/emesare/windows-hypervisor
hypervisor whp windows
Last synced: 20 days ago
JSON representation
Ergonomic and safe bindings to WHP
- Host: GitHub
- URL: https://github.com/emesare/windows-hypervisor
- Owner: emesare
- License: mit
- Created: 2024-03-29T05:57:11.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-04-03T01:24:12.000Z (8 months ago)
- Last Synced: 2024-04-03T06:26:40.598Z (8 months ago)
- Topics: hypervisor, whp, windows
- Language: Rust
- Homepage:
- Size: 43 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# windows-hypervisor
## ⚠️ WORK IN PROGRESS
Ergonomic and safe bindings to [WHP] (Windows Hypervisor Platform)
## Example
```rs
let mut partition = PartitionBuilder::new()?
.property(PartitionProperty::ProcessorCount(1))?
.setup()?;let mut data = [0xf4; 65536];
data[0xfff0..0xfff0 + 6].copy_from_slice(&[
0x31, 0xc0, // xor eax,eax
0x66, 0xb8, 0xef, 0xbe, // mov eax, 0xbeef
]);
partition.map_memory_region(MemoryRegion::from_bytes(
0xF0000,
MapGpaRangeFlags::Read | MapGpaRangeFlags::Execute,
&data,
))?;let mut vcpu = partition.create_virtual_processor(0x0)?;
let run_exit_ctx = vcpu.run()?;
let beef = match vcpu.get_register(Register::Rax)? {
RegisterVal::Reg64(v) => v as u16,
_ => unreachable!(),
};println!("Ax value: 0x{:x}", beef);
```[WHP]: https://learn.microsoft.com/en-us/virtualization/api/hypervisor-platform/hypervisor-platform