mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-25 06:12:40 +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) {
|
switch (j->type) {
|
||||||
case JitType_CodeMemory:
|
case JitType_CodeMemory:
|
||||||
rc = svcMapProcessCodeMemory(envGetOwnProcessHandle(), (u64) j->rx_addr, (u64) j->src_addr, j->size);
|
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;
|
break;
|
||||||
|
|
||||||
case JitType_JitMemory:
|
case JitType_JitMemory:
|
||||||
|
Loading…
Reference in New Issue
Block a user