binlex
args.h
1 #ifndef ARGS_H
2 #define ARGS_H
3 #include <set>
4 #include <string>
5 
6 #ifdef _WIN32
7 #define BINLEX_EXPORT __declspec(dllexport)
8 #else
9 #define BINLEX_EXPORT
10 #endif
11 
12 #define ARGS_MODE_COUNT 9
13 
14 #define ARGS_IO_TYPE_UNKNOWN 0
15 #define ARGS_IO_TYPE_FILE 1
16 #define ARGS_IO_TYPE_DIR 2
17 
18 #ifdef _WIN32
19 typedef unsigned int uint;
20 typedef uint useconds_t;
21 #endif
22 
27 namespace binlex{
28  class Args {
29  public:
30  char version[7] = "v1.1.1";
31  const char *modes[ARGS_MODE_COUNT] = {"elf:x86", "elf:x86_64", "pe:x86", "pe:x86_64", "raw:x86", "raw:x86_64", "raw:cil", "pe:cil", "auto"};
32  struct{
33  char *input;
34  int io_type;
35  char *output;
36  uint timeout;
37  uint threads;
38  bool help;
39  bool list_modes;
40  bool instructions;
41  std::string mode;
42  std::string corpus;
43  bool pretty;
44  bool debug;
45  std::set<std::string> tags;
46  } options;
47  BINLEX_EXPORT Args();
48  BINLEX_EXPORT void SetDefault();
49  BINLEX_EXPORT bool check_mode(const char *mode);
50  BINLEX_EXPORT int is_file(const char *path);
51  BINLEX_EXPORT int is_dir(const char *path);
52  BINLEX_EXPORT void set_io_type(char *input);
53  BINLEX_EXPORT void print_help();
54  BINLEX_EXPORT void parse(int argc, char **argv);
55  BINLEX_EXPORT std::string get_tags_as_str();
56  BINLEX_EXPORT ~Args();
57  };
58 }
59 
60 #endif
binlex::Args::tags
std::set< std::string > tags
Set for storing the tags.
Definition: args.h:45
binlex::Args
Definition: args.h:28
binlex
the binlex namespace