CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/external/source/byakugan/jutsu.h
Views: 11766
1
#define DEFAULT_BUFLEN 2096
2
#define DEFAULT_PORT "1911"
3
4
// Request Types
5
#define EXECUTE 0x0
6
#define GO 0x1
7
#define BREAK 0x2
8
#define RESTART 0x3
9
#define ADDBUF 0x4
10
11
// Corruption Types
12
#define CLEAN 0x0
13
#define TOUPPER 0x1
14
#define TOLOWER 0x2
15
#define TOUNICODE 0x3
16
#define NONSTD 0x4
17
#define TRUNCATED 0x5
18
19
struct debugState {
20
ULONG currentState;
21
};
22
23
struct requestQueue {
24
ULONG length;
25
struct request *head;
26
};
27
28
struct request {
29
USHORT type;
30
USHORT length;
31
BYTE *data;
32
33
struct request *next;
34
};
35
36
struct requestHeader {
37
USHORT type;
38
USHORT length;
39
};
40
41
struct trackedBuf {
42
char *bufName;
43
char *bufPatt;
44
DWORD bufSize;
45
USHORT found;
46
47
struct bufInstance *instances;
48
struct trackedBuf *next;
49
struct trackedBuf *prev;
50
};
51
52
struct bufInstance {
53
ULONG64 address;
54
USHORT corruption;
55
ULONG truncLength;
56
57
struct bufInstance *next;
58
};
59
60
struct trackedVal {
61
char *valName;
62
BYTE valSize;
63
ULONG candidates;
64
65
struct valInstance *instances;
66
struct trackedVal *next;
67
};
68
69
struct valInstance {
70
ULONG64 address;
71
72
struct valInstance *next;
73
};
74
75
struct corruption {
76
DWORD offset;
77
BYTE value;
78
BOOL seenAgain;
79
BOOL seenBefore;
80
};
81
82
83
void helpJutsu(void);
84
void bindJutsu(char *);
85
void searchOpcodes(char *);
86
void searchVtptr(DWORD, char *);
87
DWORD WINAPI listenJutsu(LPVOID lpvParam);
88
void parseJutsu(char *, ULONG);
89
void identBufJutsu(char *, char *, char *, DWORD, DWORD);
90
void rmBufJutsu(char *);
91
void listTrackedBufJutsu(void);
92
void showRequestsJutsu(void);
93
void hunterJutsu(void);
94
void returnAddressHuntJutsu(void);
95
void trackValJutsu(char *name, DWORD size, DWORD value);
96
void listTrackedVals(void);
97
void listTrackedValByName(char *name);
98
ULONG64 allocateMemoryBlock(unsigned long);
99
ULONG64 searchMemory(unsigned char * byteBuffer, unsigned long length, ULONG64 *addressHit);
100
DWORD findAllVals(unsigned char *byteBuffer, BYTE size, struct valInstance **instance);
101
void memDiffJutsu(char *inputType, DWORD size, char *input, ULONG64 address);
102
103
// Handlers
104
void executeJutsu(struct request *);
105
void goJutsu(struct request *);
106
void breakJutsu(struct request *);
107
void restartJutsu(struct request *);
108
void addbufJutsu(struct request *);
109
110