Make JIT memory read-only after patching is done
This commit is contained in:
parent
897ff83dcd
commit
31a571dc70
4 changed files with 15 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue