diff options
| author | Zach DeCook <zachdecook@gmail.com> | 2024-01-01 17:05:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-01 23:05:26 +0100 |
| commit | 1607e967041fd3311411de0def8cdc0610274f98 (patch) | |
| tree | e419633df7cbd9b867d49f385208339e55fc210a /src/plugins/HookSystem.cpp | |
| parent | 1a4f23eb2fee77b23b2cc6ff1fbfc87f60f10314 (diff) | |
HookSystem: rename PAGESIZE_VAR from PAGESIZE to avoid conflict (#4321)
Diffstat (limited to 'src/plugins/HookSystem.cpp')
| -rw-r--r-- | src/plugins/HookSystem.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/HookSystem.cpp b/src/plugins/HookSystem.cpp index e52fd749..a7625ffe 100644 --- a/src/plugins/HookSystem.cpp +++ b/src/plugins/HookSystem.cpp @@ -190,9 +190,9 @@ bool CFunctionHook::hook() { (uint64_t)((uint8_t*)m_pSource + sizeof(ABSOLUTE_JMP_ADDRESS)); // make jump to hk - const auto PAGESIZE = sysconf(_SC_PAGE_SIZE); - const uint8_t* PROTSTART = (uint8_t*)m_pSource - ((uint64_t)m_pSource % PAGESIZE); - const size_t PROTLEN = std::ceil((float)(ORIGSIZE + ((uint64_t)m_pSource - (uint64_t)PROTSTART)) / (float)PAGESIZE) * PAGESIZE; + const auto PAGESIZE_VAR = sysconf(_SC_PAGE_SIZE); + const uint8_t* PROTSTART = (uint8_t*)m_pSource - ((uint64_t)m_pSource % PAGESIZE_VAR); + const size_t PROTLEN = std::ceil((float)(ORIGSIZE + ((uint64_t)m_pSource - (uint64_t)PROTSTART)) / (float)PAGESIZE_VAR) * PAGESIZE_VAR; mprotect((uint8_t*)PROTSTART, PROTLEN, PROT_READ | PROT_WRITE | PROT_EXEC); memcpy((uint8_t*)m_pSource, ABSOLUTE_JMP_ADDRESS, sizeof(ABSOLUTE_JMP_ADDRESS)); |
