Skip to content

Commit 3cb810d

Browse files
committed
Changed GetTrampolineAddress to check for Hook.
1 parent 11cec94 commit 3cb810d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/modules/memory/memory_function.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,10 @@ object CFunction::SkipHooks(tuple args, dict kw)
337337
unsigned long CFunction::GetTrampolineAddress()
338338
{
339339
CHook* pHook = GetHookManager()->FindHook((void *) m_ulAddr);
340-
if (pHook)
341-
return (unsigned long) pHook->m_pTrampoline;
340+
if (!pHook)
341+
BOOST_RAISE_EXCEPTION(PyExc_ValueError, "Function was not hooked.")
342342

343-
return m_ulAddr;
343+
return (unsigned long) pHook->m_pTrampoline;
344344
}
345345

346346
CHook* HookFunctionHelper(void* addr, ICallingConvention* pConv)

0 commit comments

Comments
 (0)