forked from Prof-Butts/Hook_XWACockpitLook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hookmain.cpp
40 lines (30 loc) · 802 Bytes
/
hookmain.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
#include "targetver.h"
#include "hook_function.h"
#include "hooks.h"
static const int g_hookFunctionsCount = sizeof(g_hookFunctions) / sizeof(HookFunction);
extern "C" __declspec(dllexport) int GetHookFunctionsCount()
{
return g_hookFunctionsCount;
}
extern "C" __declspec(dllexport) HookFunction GetHookFunction(int index)
{
auto hook = HookFunction{};
if (index >= 0 && index < g_hookFunctionsCount)
{
return g_hookFunctions[index];
}
return hook;
}
static const int g_patchesCount = sizeof(g_patches) / sizeof(HookPatch);
extern "C" __declspec(dllexport) int GetHookPatchesCount()
{
return g_patchesCount;
}
extern "C" __declspec(dllexport) const HookPatch* GetHookPatch(int index)
{
if (index < 0 || index >= g_patchesCount)
{
return nullptr;
}
return &g_patches[index];
}