|
|
|
@ -81,4 +81,23 @@ drv::kalloc_t _kalloc = [&](std::size_t size) -> void*
|
|
|
|
|
});
|
|
|
|
|
return alloc_base;
|
|
|
|
|
};
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
###### drv::kmemcpy_t - MSREXEC Example
|
|
|
|
|
|
|
|
|
|
```cpp
|
|
|
|
|
drv::kmemcpy_t _kmemcpy =
|
|
|
|
|
[&](void* dest, const void* src, std::size_t size) -> void*
|
|
|
|
|
{
|
|
|
|
|
void* result = nullptr;
|
|
|
|
|
msrexec.exec([&](void* krnl_base, get_system_routine_t get_kroutine) -> void
|
|
|
|
|
{
|
|
|
|
|
const auto kmemcpy =
|
|
|
|
|
reinterpret_cast<decltype(&memcpy)>(
|
|
|
|
|
get_kroutine(krnl_base, "memcpy"));
|
|
|
|
|
|
|
|
|
|
result = kmemcpy(dest, src, size);
|
|
|
|
|
});
|
|
|
|
|
return result;
|
|
|
|
|
};
|
|
|
|
|
```
|