-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathinjcode.h
57 lines (52 loc) · 1.22 KB
/
injcode.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
#include <string>
#include <memory>
#include <vector>
#include <map>
#include <termios.h>
#include <unistd.h>
class InjMod: public ErrHandling {
protected:
Inject &injector;
InjMod(const InjMod&);
InjMod&operator=(const InjMod&);
public:
InjMod(Inject&injector):injector(injector) {}
virtual void run() = 0;
virtual ~InjMod() {};
};
class TestModule: public InjMod {
public:
TestModule(Inject&);
void run() {};
};
class CloseModule: public InjMod {
public:
CloseModule(Inject&);
void run() {};
};
class Dup2Module: public InjMod {
public:
Dup2Module(Inject&);
void run() {};
};
class Retty: public InjMod {
struct termios orig_tio;
int send_fds(int sd, int proxyfd);
void child(int proxyfd);
std::string readFd(int fd);
void setRawTerminal(int fd);
void setupPty();
static void sigwinch(int);
public:
Retty(Inject&);
~Retty();
void run();
};
typedef struct {
int targetpid;
int verbose;
std::string moduleName;
std::auto_ptr<InjMod> module;
const char *argv0;
std::map<std::string, std::string> parameters;
} options_t;