Fix perm when invalidate cache

This commit is contained in:
LoveSy 2022-11-27 01:03:58 +08:00
parent 5e1c3b1a9e
commit 229adbe159
No known key found for this signature in database

View File

@ -164,9 +164,11 @@ public:
info.hooks.clear();
continue;
}
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;
}