From 4f3d51b5bc22e43eb3b6a830c3c95a483854e46b Mon Sep 17 00:00:00 2001 From: whh8b <whh8b@git.zephyr-software.com> Date: Fri, 14 Apr 2017 03:57:09 +0000 Subject: [PATCH] Switch to call 0 from nop. Former-commit-id: 8b3d6f81838508a7dcdd4bc825f267b897bd537d --- tools/hook_start/hook_start.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/hook_start/hook_start.cpp b/tools/hook_start/hook_start.cpp index b9bbe3d94..d63118b55 100644 --- a/tools/hook_start/hook_start.cpp +++ b/tools/hook_start/hook_start.cpp @@ -52,11 +52,13 @@ Instruction_t *HookStart::add_instrumentation(Instruction_t *site) movRaxBuf[100], movRspBuf[100], movRetBuf[100]; - sprintf(pushRetBuf,"push 0x%lx", postCallbackReturn); + sprintf(pushRetBuf,"push qword 0x%lx", postCallbackReturn); sprintf(movIdBuf,"mov rdi, 0x0"); sprintf(movRaxBuf,"mov rsi, rax"); sprintf(movRspBuf,"mov rdx, rsp"); + cout << "postCallbackReturn: " << std::hex << postCallbackReturn << endl; + zipr_reloc->SetType("zipr_value"); Instruction_t *tmp=site, @@ -97,7 +99,8 @@ Instruction_t *HookStart::add_instrumentation(Instruction_t *site) */ tmp=insertAssemblyAfter(firp,tmp,pushRetBuf); // push <ret addr> - callback=tmp=insertAssemblyAfter(firp,tmp,"nop"); + callback=tmp=insertAssemblyAfter(firp,tmp,"call 0"); + callback->SetTarget(callback); callback->SetCallback(m_callback_name); post_callback=tmp=insertAssemblyAfter(firp,tmp,"popf"); -- GitLab