-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathNinkoConfig.h
44 lines (41 loc) · 1.01 KB
/
NinkoConfig.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
#pragma once
#include "pin.H"
#include "rapidjson/document.h"
#include <iostream>
#include <fstream>
#include <string>
#include <cstdio>
using namespace std;
typedef struct ninko_s {
string image_name;
bool logging;
bool hook_functions;
bool ignore_internal_calls;
bool disable_log_calls;
bool disable_log_writes;
bool disable_log_reads;
ADDRINT code_start;
ADDRINT code_end;
ADDRINT data_start;
ADDRINT data_end;
ADDRINT stop_log_on_exec;
ADDRINT start_log_on_exec;
rapidjson::Value* code_ignore;
rapidjson::Value* data_ignore;
rapidjson::Value* code_add;
rapidjson::Value* data_add;
} ninko_t;
class NinkoConfig {
public:
int parse(const string fileName);
void fillVars(ninko_t *vars);
// doc variable reading functions
bool fieldExists(const string fieldName);
ADDRINT getAddr(const string fieldName);
string getString(const string fieldName);
rapidjson::Value* getArray(const string fieldName);
bool getBool(const string fieldName);
// public vars
private:
rapidjson::Document m_doc;
};