mirror of
https://github.com/LSPosed/LSPlt.git
synced 2025-05-06 21:48:48 +08:00
In case mprotect fails
This commit is contained in:
parent
229adbe159
commit
c9e91f007e
@ -164,11 +164,12 @@ public:
|
|||||||
info.hooks.clear();
|
info.hooks.clear();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mprotect(reinterpret_cast<void *>(info.start), len, PROT_WRITE);
|
if (!mprotect(reinterpret_cast<void *>(info.start), len, PROT_WRITE)) {
|
||||||
for (auto &[addr, backup] : info.hooks) {
|
for (auto &[addr, backup] : info.hooks) {
|
||||||
*reinterpret_cast<uintptr_t *>(addr) = backup;
|
*reinterpret_cast<uintptr_t *>(addr) = backup;
|
||||||
}
|
}
|
||||||
mprotect(reinterpret_cast<void *>(info.start), len, info.perm);
|
mprotect(reinterpret_cast<void *>(info.start), len, info.perm);
|
||||||
|
}
|
||||||
info.hooks.clear();
|
info.hooks.clear();
|
||||||
info.backup = 0;
|
info.backup = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user