-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuwhook_c.cpp
More file actions
30 lines (17 loc) · 963 Bytes
/
uwhook_c.cpp
File metadata and controls
30 lines (17 loc) · 963 Bytes
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
#define UWHOOK_C_API
#include "uwhook_c.h"
#include "uwhook.hpp"
extern "C" {
UWHook *uw_hook_create(void *fnc, void *hook, bool useTrampoline) { return new UWHook(fnc, hook, useTrampoline); }
void uw_hook_destroy(UWHook *hook) { delete hook; }
bool uw_hook_release(UWHook *hook) { return hook->release(); }
bool uw_hook_restore(UWHook *hook) { return hook->restore(); }
void *uw_hook_get_function(UWHook *hook) { return hook->getFunction<void>(); }
void *uw_hook_get_addr(UWHook *hook) { return hook->getAddr(); }
bool uw_hook_is_active(UWHook *hook) { return hook->isActive(); }
void uw_hook_noop() { UWHook::noop(); }
void *uw_hook_get_trampoline_caller() { return UWHook::getTrampolineCaller(); }
UWHookRelease *uw_hook_release_create(UWHook *hook) { return new UWHookRelease(*hook); }
void uw_hook_release_destroy(UWHookRelease *release) { delete release; }
bool uw_hook_release_is_valid(UWHookRelease *release) { return release->isValid(); }
}