From 3a2c94faef3198541b94d0219ef896bfab91aeaa Mon Sep 17 00:00:00 2001 From: momo5502 Date: Mon, 20 Mar 2023 18:32:37 +0100 Subject: [PATCH] Make sure to save all GP registers --- src/common/utils/hook.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/common/utils/hook.cpp b/src/common/utils/hook.cpp index 2ba72fb9..f79874b4 100644 --- a/src/common/utils/hook.cpp +++ b/src/common/utils/hook.cpp @@ -190,12 +190,26 @@ namespace utils::hook this->push(rsi); this->push(rdi); - this->sub(rsp, 0x40); + this->push(r8); + this->push(r9); + this->push(r10); + this->push(r11); + this->push(r12); + this->push(r13); + this->push(r14); + this->push(r15); } void assembler::popad64() { - this->add(rsp, 0x40); + this->pop(r15); + this->pop(r14); + this->pop(r13); + this->pop(r12); + this->pop(r11); + this->pop(r10); + this->pop(r9); + this->pop(r8); this->pop(rdi); this->pop(rsi);