summaryrefslogtreecommitdiff
path: root/src/plugins/HookSystem.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-02-27 19:47:42 +0000
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-02-27 19:47:42 +0000
commit18229043fa85bdf96a9d829c1e61d0f524a1966a (patch)
treef243fbd30fa122a42817dcc6a152f320d8f29728 /src/plugins/HookSystem.cpp
parent03d7651916304e35a7f47027e7f1b58f618ed05d (diff)
Remove useless rax preserve across callq
Diffstat (limited to 'src/plugins/HookSystem.cpp')
-rw-r--r--src/plugins/HookSystem.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/HookSystem.cpp b/src/plugins/HookSystem.cpp
index ce53d653..afae69a4 100644
--- a/src/plugins/HookSystem.cpp
+++ b/src/plugins/HookSystem.cpp
@@ -82,15 +82,13 @@ bool CFunctionHook::hook() {
// nop
static constexpr uint8_t NOP = 0x90;
/*
- pushq %rax
movabs $0,%rax
callq *%rax
- popq %rax
offset for addr: 3
*/
- static constexpr uint8_t CALL_WITH_RAX[] = {0x50, 0x48, 0xB8, 0xEF, 0xBE, 0xAD, 0xDE, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x10, 0x58};
- static constexpr size_t CALL_WITH_RAX_ADDRESS_OFFSET = 3;
+ static constexpr uint8_t CALL_WITH_RAX[] = {0x48, 0xB8, 0xEF, 0xBE, 0xAD, 0xDE, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x10};
+ static constexpr size_t CALL_WITH_RAX_ADDRESS_OFFSET = 2;
// get minimum size to overwrite
const auto HOOKSIZE = probeMinimumJumpSize(m_pSource, sizeof(ABSOLUTE_JMP_ADDRESS) + sizeof(PUSH_RAX) + sizeof(POP_RAX));