From bbb6846ffa5e67659a13026c089a90e2bbbea2bc Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Sun, 1 Nov 2020 23:35:52 +0000 Subject: [PATCH] Update README.md --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index 69fc423..7253d50 100644 --- a/README.md +++ b/README.md @@ -41,4 +41,40 @@ __forceinline auto load_drv() -> std::pair return { vdm::drv_handle, key }; } +``` + +### vdm::unload_drv + +This code probably wont change, its just a wrapper function for `driver::unload`, but it also closes the driver handle before trying to unload the driver... + +```cpp +__forceinline bool unload_drv(HANDLE drv_handle, std::string drv_key) +{ + return CloseHandle(drv_handle) && driver::unload(drv_key); +} +``` + +### vdm::read_phys + +Most drivers expose mapping of physical memory. This means you will need to map the physical memory, memcpy it, then unmap it. This allows support +for drivers that actually only offer physical read and write and not physical map/unmap. + +```cpp +__forceinline bool read_phys(void* addr, void* buffer, std::size_t size) +{ + // code to read physical memory. most drivers offer map/unmap physical + // so you will need to map the physical memory, memcpy, then unmap the memory +} +``` + +### vdm::write_phys + +This function is going to probably contain the same code as `vdm::read_phys` except the memcpy dest and src swapped... + +```cpp +__forceinline bool write_phys(void* addr, void* buffer, std::size_t size) +{ + // code to write physical memory... same code as vdm::read_phys + // except memcpy dest and src are swapped. +} ``` \ No newline at end of file