From 5fa90c44c1ee3401fa397f7d39b0623ac631c7c1 Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Thu, 18 Feb 2021 00:06:44 +0000 Subject: [PATCH] Update README.md --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0467420..4917ae9 100644 --- a/README.md +++ b/README.md @@ -197,4 +197,21 @@ the PTE mapping that page will not be used to map the `map_type::src` page.

Figure 2. demo VDM example and read/write virtual memory...

-The demo code demonstrates bluepill integration with VDM and a read/write physical memory, and virtual memory of other address spaces. \ No newline at end of file +The demo code demonstrates bluepill integration with VDM and a read/write physical memory, and virtual memory of other address spaces. + +```cpp +// use the hypervisor to read and write physical memory... +vdm::read_phys_t _read_phys = + [&](void* addr, void* buffer, std::size_t size) -> bool +{ + return bluepill::read_phys( + reinterpret_cast(addr), buffer, size); +}; + +vdm::write_phys_t _write_phys = + [&](void* addr, void* buffer, std::size_t size) -> bool +{ + return bluepill::write_phys( + reinterpret_cast(addr), buffer, size); +}; +```