[DHooks] Fix NaN return when superceding pre-detour (#1967)

* Update hook.cpp

* Update hook.cpp
This commit is contained in:
Forgetest 2023-04-01 00:19:04 +08:00 committed by GitHub
parent dd1e5997f3
commit 8e0039aaec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -160,7 +160,7 @@ ReturnAction_t CHook::HookHandler(HookType_t eHookType)
{
ReturnAction_t lastPreReturnAction = m_LastPreReturnAction.back();
m_LastPreReturnAction.pop_back();
if (lastPreReturnAction == ReturnAction_Override)
if (lastPreReturnAction >= ReturnAction_Override)
m_pCallingConvention->RestoreReturnValue(m_pRegisters);
if (lastPreReturnAction < ReturnAction_Supercede)
m_pCallingConvention->RestoreCallArguments(m_pRegisters);
@ -191,7 +191,7 @@ ReturnAction_t CHook::HookHandler(HookType_t eHookType)
if (eHookType == HOOKTYPE_PRE)
{
m_LastPreReturnAction.push_back(returnAction);
if (returnAction == ReturnAction_Override)
if (returnAction >= ReturnAction_Override)
m_pCallingConvention->SaveReturnValue(m_pRegisters);
if (returnAction < ReturnAction_Supercede)
m_pCallingConvention->SaveCallArguments(m_pRegisters);