-
Notifications
You must be signed in to change notification settings - Fork 1
/
iojack.h
75 lines (59 loc) · 1.36 KB
/
iojack.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
74
75
#ifndef SSHIJACK_H
#define SSHIJACK_H
#if defined(__i386__) || defined(M_IX86) /* x86 arch */
//#warning x86 architecture detected
#warning *** x86 architecture is not regularly tested. Use at your own risk ***
#define ARG1 ebx
#define ARG2 ecx
#define ARG3 edx
#define ARG4 esi
#define ARG5 edi
#define ARG6 ebp
// This should not break anything
#define RAX eax
#define ORIG_RAX orig_eax
#elif defined(__amd64__) || defined(_M_X64) /* x86_64 arch */
//#warning x86_64 architecture detected
#define ARG1 rdi
#define ARG2 rsi
#define ARG3 rdx
#define ARG4 rcx
#define ARG5 r8
#define ARG6 r9
//Note to self: Kernel-kernel calls use rdi, rsi, rdx, r10, r8, r9
#define RAX rax
#define ORIG_RAX orig_rax
#else
#error "Can't recognize processor architecture!"
#endif
#define pexit(x...)\
do \
{\
printf(x);\
exit(1);\
} while(0)
#define perrorexit(x)\
do \
{\
perror(x);\
exit(1);\
} while(0)
using namespace std;
#define foreach(iterable, iterator) \
for(__typeof__((iterable).begin()) iterator = (iterable).begin(); \
iterator != (iterable).end(); \
iterator++)
//#define DEBUG
#ifdef DEBUG
#define dprintf(x...) printf(x)
#else
#define dprintf(x...)
#endif
class settings_t
{
public:
char sendANSI;
settings_t(): sendANSI(0) {};
};
extern settings_t globalSettings;
#endif