mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-28 05:11:37 +00:00
Add protection to memory on Linux.
This commit is contained in:
parent
dd23b2efc0
commit
af8c01f590
1 changed files with 2 additions and 0 deletions
|
|
@ -13,6 +13,8 @@ Memory::Memory(void* address, size_t size) : size(size)
|
||||||
|
|
||||||
if (base == (char*)MAP_FAILED)
|
if (base == (char*)MAP_FAILED)
|
||||||
base = (char*)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
|
base = (char*)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
|
||||||
|
|
||||||
|
mprotect(base, 4096, PROT_NONE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue