1
0
mirror of https://github.com/xmrig/xmrig.git synced 2026-01-23 14:52:52 -05:00

Make JIT memory read-only after patching is done

This commit is contained in:
SChernykh
2019-01-19 11:22:54 +01:00
parent 897ff83dcd
commit 31a571dc70
4 changed files with 15 additions and 0 deletions

View File

@@ -191,6 +191,13 @@ void *Mem::allocateExecutableMemory(size_t size)
}
void Mem::protectExecutableMemory(void *p, size_t size)
{
DWORD oldProtect;
VirtualProtect(p, size, PAGE_EXECUTE_READ, &oldProtect);
}
void Mem::flushInstructionCache(void *p, size_t size)
{
::FlushInstructionCache(GetCurrentProcess(), p, size);