mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-12-24 09:24:15 +08:00
Fixed dual hook on last function call
This commit is contained in:
parent
890f19c20a
commit
dda1e3210c
@ -34,7 +34,7 @@ void Base_Hook::UnhookAll()
|
||||
}
|
||||
}
|
||||
|
||||
void Base_Hook::HookFuncs(std::pair<void**, void*> hook)
|
||||
void Base_Hook::HookFunc(std::pair<void**, void*> hook)
|
||||
{
|
||||
if( DetourAttach(hook.first, hook.second) == 0 )
|
||||
_hooked_funcs.emplace_back(hook);
|
||||
|
@ -29,13 +29,18 @@ public:
|
||||
void EndHook();
|
||||
void UnhookAll();
|
||||
|
||||
void HookFuncs(std::pair<void**, void*> hook);
|
||||
void HookFunc(std::pair<void**, void*> hook);
|
||||
|
||||
template<typename T>
|
||||
void HookFuncs(std::pair<T*, T> funcs)
|
||||
{
|
||||
HookFunc(funcs);
|
||||
}
|
||||
|
||||
template<typename T, typename ...Args>
|
||||
void HookFuncs(std::pair<T*, T> funcs, Args... args)
|
||||
{
|
||||
_hooked_funcs.emplace_back(std::move(funcs));
|
||||
HookFuncs(funcs);
|
||||
HookFunc(funcs);
|
||||
HookFuncs(args...);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user