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();
|
||||
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) {
|
||||
*reinterpret_cast<uintptr_t *>(addr) = backup;
|
||||
}
|
||||
mprotect(reinterpret_cast<void *>(info.start), len, info.perm);
|
||||
}
|
||||
info.hooks.clear();
|
||||
info.backup = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user