-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathtree.h
More file actions
36 lines (31 loc) · 810 Bytes
/
tree.h
File metadata and controls
36 lines (31 loc) · 810 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
#ifndef _tree_h
#define _tree_h
#define MaxInstructLen 100
#define MaxGadgetLen 1000
#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <regex.h>
#include <capstone/capstone.h>
struct Node{
char string[MaxInstructLen];
bool vaild;
unsigned int address;
struct Node* leftchild;
struct Node* rightsibling;
};
struct Arg{
bool print;
bool verbose;
int offset;
int depth;
unsigned char badbyte[20];
unsigned int badbyte_no;
};
void tree_init(struct Node* root);
int tree_build(struct Node* root, unsigned int address, cs_insn *insn, size_t len);
struct Node *tree_search(struct Node* root, char* regexp_string, char* gadget_string, int depth, struct Arg *arg);
void tree_free(struct Node* root);
#endif