mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-24 22:02:39 +02:00
Actually reprotect code segment to RX
This commit is contained in:
parent
d4db5b7647
commit
200240f328
@ -103,6 +103,14 @@ Result jitTransitionToExecutable(Jit* j)
|
||||
switch (j->type) {
|
||||
case JitType_CodeMemory:
|
||||
rc = svcMapProcessCodeMemory(envGetOwnProcessHandle(), (u64) j->rx_addr, (u64) j->src_addr, j->size);
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
rc = svcSetProcessMemoryPermission(envGetOwnProcessHandle(), (u64) j->rx_addr, j->size, PERM_RX);
|
||||
|
||||
if (R_FAILED(rc)) {
|
||||
jitTransitionToWritable(j);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case JitType_JitMemory:
|
||||
|
Loading…
Reference in New Issue
Block a user