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);