diff --git a/src/os.windows.cpp b/src/os.windows.cpp index a7a4975..10a45ef 100644 --- a/src/os.windows.cpp +++ b/src/os.windows.cpp @@ -270,6 +270,16 @@ void trap_threads(uint8_t* from, uint8_t* to, size_t len, const std::function(&VirtualProtect); + auto *vp_end = vp_start + 0x20; + + if (!(from_page_end < vp_start || vp_end < from_page_start)){ + new_protect = PAGE_EXECUTE_READWRITE; + } + std::scoped_lock lock{TrapManager::mutex}; if (TrapManager::instance == nullptr) { @@ -314,4 +324,4 @@ void fix_ip(ThreadContext thread_ctx, uint8_t* old_ip, uint8_t* new_ip) { } // namespace safetyhook -#endif \ No newline at end of file +#endif