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