-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTitle.cpp
50 lines (43 loc) · 1.01 KB
/
Title.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "Hooking.h"
#include <string>
#include "main.h"
//sbapi
class TitleHook : public ClassHooker
{
public:
TitleHook() : ClassHooker("Title")
{
setupHookMemberFunc("update", (void*)0x00419500);
}
};
static TitleHook hooker;
struct TitleStruct
{
//this contains member variables of the blablabnla
};
//plugin
//figuring out how to do the plugin side
struct PluginTitle : public TitleStruct
{
void update(ClassHooker *ch)
{
ch->unhookMemberFunc("update");
void* funcAddr;
CALL_FUNC(update, funcAddr);
ch->hookMemberFunc("update", m_selfFuncAddrs["update"]);
return;
}
HOOKDEST_DECL(PluginTitle)
};
HOOKDEST_DEF(PluginTitle)
HOOKTABLE_START(PluginTitle)
SETUPHOOKEDFUNC(Title, update)
HOOKTABLE_END(PluginTitle)
/*template<typename T> struct PluginTitle_hookinit {
PluginTitle_hookinit()
{
T::m_selfFuncAddrs[ "update" ] = &(void*&)T::update;
g_hookedClasses[ "Title" ]->hookMemberFunc( "update" , &(void*&)T::update);
}
};
static PluginTitle_hookinit<PluginTitle> PluginTitle_init;*/