From 0880f26b7b6e6c19f8c86d9950d993ac5d64e597 Mon Sep 17 00:00:00 2001 From: altalk23 <45172705+altalk23@users.noreply.github.com> Date: Sun, 21 Apr 2024 15:08:34 +0300 Subject: [PATCH] fix2 --- src/generator/ArmV7Generator.cpp | 4 ++-- src/generator/ArmV8Generator.cpp | 4 ++-- test/Hook.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/generator/ArmV7Generator.cpp b/src/generator/ArmV7Generator.cpp index b31a703..58884e7 100644 --- a/src/generator/ArmV7Generator.cpp +++ b/src/generator/ArmV7Generator.cpp @@ -35,11 +35,11 @@ Result ArmV7HandlerGenerator::relocateOri auto relocatedBuffer = m_trampoline; TULIP_HOOK_UNWRAP_INTO(auto protection, Target::get().getProtection(m_trampoline)); - TULIP_HOOK_UNWRAP(Target::get().protectMemory(m_trampoline, target, Target::get().getWritableProtection())); + TULIP_HOOK_UNWRAP(Target::get().protectMemory(m_trampoline, 0x100, Target::get().getWritableProtection())); GenRelocateCodeAndBranch(originBuffer, relocatedBuffer, origin, relocated); - TULIP_HOOK_UNWRAP(Target::get().protectMemory(m_trampoline, target, protection)); + TULIP_HOOK_UNWRAP(Target::get().protectMemory(m_trampoline, 0x100, protection)); if (relocated->size == 0) { return Err("Failed to relocate original function"); diff --git a/src/generator/ArmV8Generator.cpp b/src/generator/ArmV8Generator.cpp index 2a8bf21..9e96f17 100644 --- a/src/generator/ArmV8Generator.cpp +++ b/src/generator/ArmV8Generator.cpp @@ -31,11 +31,11 @@ Result ArmV8HandlerGenerator::relocateOri auto relocatedBuffer = m_trampoline; TULIP_HOOK_UNWRAP_INTO(auto protection, Target::get().getProtection(m_trampoline)); - TULIP_HOOK_UNWRAP(Target::get().protectMemory(m_trampoline, target, Target::get().getWritableProtection())); + TULIP_HOOK_UNWRAP(Target::get().protectMemory(m_trampoline, 0x100, Target::get().getWritableProtection())); GenRelocateCodeAndBranch(originBuffer, relocatedBuffer, origin, relocated); - TULIP_HOOK_UNWRAP(Target::get().protectMemory(m_trampoline, target, protection)); + TULIP_HOOK_UNWRAP(Target::get().protectMemory(m_trampoline, 0x100, protection)); if (relocated->size == 0) { return Err("Failed to relocate original function"); diff --git a/test/Hook.cpp b/test/Hook.cpp index d8a5b8e..f32b12b 100644 --- a/test/Hook.cpp +++ b/test/Hook.cpp @@ -90,7 +90,7 @@ TEST(HookTest, NoHandler) { TEST(HookTest, NoHooks) { HandlerHandle handlerHandle; makeHandler<1>(handlerHandle); - EXPECT_EQ(3, 3); + EXPECT_EQ(callFunction<1>(), 1); } TEST(HookTest, MakeWrapper) {