From 3ed416bd76f0e087aff04bced945a4306bc10ee5 Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Sun, 1 Nov 2020 23:24:49 +0000 Subject: [PATCH] Update README.md --- README.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c456436..4928ab5 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,35 @@ but is removed after every syscall into NtShutdownSystem to prevent possible det # Usage -Currently the project is configured to use gdrv, but if you want to swap the driver out you must defined four functions. \ No newline at end of file +Currently the project is configured to use gdrv, but if you want to swap the driver out you must defined four functions. + +### vdm::load_drv + +Replace this function with the code required to load your driver... Return an std::pair containing the driver handle and an std::string containing the registry key name +for the driver. The key name is returned from [loadup](https://githacks.org/xerox/loadup). + +```cpp +__forceinline auto load_drv() -> std::pair +{ + const auto [result, key] = + driver::load( + vdm::raw_driver, + sizeof(vdm::raw_driver) + ); + + if (!result) + return { {}, {} }; + + vdm::drv_handle = CreateFile( + "\\\\.\\GIO", + GENERIC_READ | GENERIC_WRITE, + NULL, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL + ); + + return { vdm::drv_handle, key }; +} +``` \ No newline at end of file