Skip to content

Add trampoline property to CFunction. #349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changed GetTrampolineAddress to check for Hook.
  • Loading branch information
CookStar committed Sep 23, 2020
commit 3cb810d967d219948777acd06fde0519911fc159
6 changes: 3 additions & 3 deletions src/core/modules/memory/memory_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,10 @@ object CFunction::SkipHooks(tuple args, dict kw)
unsigned long CFunction::GetTrampolineAddress()
{
CHook* pHook = GetHookManager()->FindHook((void *) m_ulAddr);
if (pHook)
return (unsigned long) pHook->m_pTrampoline;
if (!pHook)
BOOST_RAISE_EXCEPTION(PyExc_ValueError, "Function was not hooked.")

return m_ulAddr;
return (unsigned long) pHook->m_pTrampoline;
}

CHook* HookFunctionHelper(void* addr, ICallingConvention* pConv)
Expand Down