mirror of
https://git.wownero.com/wownero/RandomWOW.git
synced 2025-01-03 05:38:54 +00:00
pageProtect when missing pthread_jit_write_protect_np
This commit is contained in:
parent
31b9b0f8fc
commit
4d8ef87936
@ -142,6 +142,8 @@ void setPagesRW(void* ptr, std::size_t bytes) {
|
|||||||
&& MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
|
&& MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
|
||||||
if (__builtin_available(macOS 11.0, *)) {
|
if (__builtin_available(macOS 11.0, *)) {
|
||||||
pthread_jit_write_protect_np(false);
|
pthread_jit_write_protect_np(false);
|
||||||
|
} else {
|
||||||
|
pageProtect(ptr, bytes, PAGE_READWRITE);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
pageProtect(ptr, bytes, PAGE_READWRITE);
|
pageProtect(ptr, bytes, PAGE_READWRITE);
|
||||||
@ -153,6 +155,8 @@ void setPagesRX(void* ptr, std::size_t bytes) {
|
|||||||
&& MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
|
&& MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
|
||||||
if (__builtin_available(macOS 11.0, *)) {
|
if (__builtin_available(macOS 11.0, *)) {
|
||||||
pthread_jit_write_protect_np(true);
|
pthread_jit_write_protect_np(true);
|
||||||
|
} else {
|
||||||
|
pageProtect(ptr, bytes, PAGE_EXECUTE_READ);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
pageProtect(ptr, bytes, PAGE_EXECUTE_READ);
|
pageProtect(ptr, bytes, PAGE_EXECUTE_READ);
|
||||||
|
Loading…
Reference in New Issue
Block a user