-
-
Save qskateboard/67981d5e004ae16b27f215e5f7c06e55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Wrapper functions used in an example code | |
template<typename T> | |
void QueueScatterReadEx(VMMDLL_SCATTER_HANDLE handle, uint64_t addr, void* buffer) const | |
{ | |
QueueScatterReadEx(handle, addr, buffer, sizeof(T)); | |
} | |
VMMDLL_SCATTER_HANDLE CreateScatterHandle() const override { | |
assertNoInit(); | |
const VMMDLL_SCATTER_HANDLE ScatterHandle = VMMDLL_Scatter_Initialize(DMA_HANDLE, processInfo.pid, VMMDLL_FLAG_NOCACHE | VMMDLL_FLAG_NOPAGING | VMMDLL_FLAG_ZEROPAD_ON_FAIL | VMMDLL_FLAG_NOPAGING_IO); | |
#if DO_LOG | |
if (!ScatterHandle) | |
log("failed to create scatter handle\n"); | |
#endif | |
return ScatterHandle; | |
} | |
void CloseScatterHandle(VMMDLL_SCATTER_HANDLE& handle) const override { | |
assertNoInit(); | |
VMMDLL_Scatter_CloseHandle(handle); | |
handle = nullptr; | |
} | |
// ========================================= | |
// Real functions | |
void QueueScatterReadEx(VMMDLL_SCATTER_HANDLE handle, uint64_t addr, void* buffer, size_t size) const override | |
{ | |
assertNoInit(); | |
DWORD memoryPrepared = NULL; | |
if (!VMMDLL_Scatter_PrepareEx(handle, addr, size, static_cast<PBYTE>(buffer), &memoryPrepared)) { | |
#if DO_LOG | |
log("failed to prepare scatter read at 0x % p\n", addr); | |
#endif | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment