mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-30 22:35:40 +08:00
db2a803cf7
NO_OVERLAY define becomes EMU_OVERLAY which enables the overlay instead of disabling it. disable_overlay.txt moved to steam_settings.
50 lines
984 B
C++
50 lines
984 B
C++
#ifndef __INCLUDED_BASE_HOOK_H__
|
|
#define __INCLUDED_BASE_HOOK_H__
|
|
|
|
#ifdef EMU_OVERLAY
|
|
|
|
#include <vector>
|
|
#include <utility>
|
|
|
|
#include "../dll/base.h"
|
|
|
|
class Base_Hook
|
|
{
|
|
protected:
|
|
std::vector<std::pair<void**, void*>> _hooked_funcs;
|
|
|
|
void* _library;
|
|
|
|
Base_Hook(const Base_Hook&) = delete;
|
|
Base_Hook(Base_Hook&&) = delete;
|
|
Base_Hook& operator =(const Base_Hook&) = delete;
|
|
Base_Hook& operator =(Base_Hook&&) = delete;
|
|
|
|
public:
|
|
Base_Hook();
|
|
virtual ~Base_Hook();
|
|
|
|
void BeginHook();
|
|
void EndHook();
|
|
void UnhookAll();
|
|
|
|
virtual const char* get_lib_name() const;
|
|
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)
|
|
{
|
|
HookFunc(funcs);
|
|
HookFuncs(args...);
|
|
}
|
|
};
|
|
|
|
#endif//EMU_OVERLAY
|
|
|
|
#endif//__INCLUDED_BASE_HOOK_H__
|