-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathah4.c
More file actions
45 lines (33 loc) · 727 Bytes
/
ah4.c
File metadata and controls
45 lines (33 loc) · 727 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <dlfcn.h>
#include <pthread.h>
#include "hacks/glow.h"
#include "config.h"
#include "interfaces.h"
#include "memory.h"
#include "netvars.h"
#include "hooks.h"
static pthread_t thread;
static void *routine(void *arg)
{
struct timespec time = {0, 100 * 1000000}; // 100 ms
while (!dlopen(SERVERBROWSER_SO, RTLD_NOLOAD | RTLD_NOW))
nanosleep(&time, &time);
interfaces_init();
memory_init();
netvars_init();
hooks_init();
config_reset();
return 0;
}
int __attribute__((constructor)) onLoad(void)
{
pthread_create(&thread, 0, routine, 0);
return 0;
}
void __attribute__((destructor)) onUnload(void)
{
pthread_join(thread, 0);
hooks_cleanUp();
netvars_cleanUp();
glow_clearCustomGlowObjects();
}