forked from uds-se/FormatFuzzer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformatfuzzer.h
More file actions
56 lines (40 loc) · 1.38 KB
/
formatfuzzer.h
File metadata and controls
56 lines (40 loc) · 1.38 KB
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
#define MAX_RAND_SIZE 131072
#define MAX_FILE_SIZE 65536
#include <vector>
struct InsertionPoint {
unsigned pos;
const char* type;
const char* name;
InsertionPoint(unsigned pos, const char* type, const char* name) : pos(pos), type(type), name(name) {}
};
struct Chunk {
int file_index;
unsigned start;
unsigned end;
const char* type;
const char* name;
Chunk(int file_index, unsigned start, unsigned end, const char* type, const char* name) : file_index(file_index), start(start), end(end), type(type), name(name) {}
};
struct NonOptional {
const char* type;
int start;
int size;
NonOptional(const char* type, int start, int size) : type(type), start(start), size(size) {}
};
extern std::unordered_map<std::string, std::string> variable_types;
extern std::vector<std::vector<InsertionPoint>> insertion_points;
extern std::vector<std::vector<Chunk>> deletable_chunks;
extern std::vector<Chunk> optional_chunks;
extern std::vector<int> optional_index;
extern std::unordered_map<std::string, std::vector<Chunk>> non_optional_chunks;
extern std::vector<std::vector<NonOptional>> non_optional_index;
extern std::vector<std::string> rand_names;
void set_parser();
void set_generator();
bool setup_input(const char* filename);
void generate_file();
unsigned get_file_size();
double get_validity();
void delete_globals();
char* get_bin_name(char* arg);
void save_output(const char* filename);