IDA Domain
All Classes Files Functions Variables Enumerations Enumerator Macros
ida_command_builder.hpp
Go to the documentation of this file.
1 #ifndef IdaCommandBuilder_H
2 #define IdaCommandBuilder_H
3 
5 #include <string>
6 #include <vector>
7 #include <map>
8 #include <cstdint>
9 
10 #ifndef SWIG
12 {
13 #endif
18  {
19  public:
22 
25  IdaCommandBuilder &use_text_mode();
26 
30  IdaCommandBuilder &auto_analysis(bool enabled = true);
31 
35  IdaCommandBuilder &autonomous(bool enabled = true);
36 
40  IdaCommandBuilder &set_loading_address(unsigned int address);
41 
45  IdaCommandBuilder &new_database(bool enabled = true);
46 
51  IdaCommandBuilder &set_compiler(const std::string &name, const std::string &abi = "");
52 
56  IdaCommandBuilder &add_first_pass_directive(const std::string &directive);
57 
61  IdaCommandBuilder &add_second_pass_directive(const std::string &directive);
62 
66  IdaCommandBuilder &disable_fpp_instructions(bool disabled = true);
67 
71  IdaCommandBuilder &set_entry_point(unsigned int address);
72 
76  IdaCommandBuilder &set_jit_debugger(bool enabled = true);
77 
81  IdaCommandBuilder &set_log_file(const std::string &filename);
82 
86  IdaCommandBuilder &disable_mouse(bool disabled = true);
87 
91  IdaCommandBuilder &set_plugin_options(const std::string &options);
92 
96  IdaCommandBuilder &set_output_database(const std::string &path);
97 
101  IdaCommandBuilder &set_processor(const std::string &processor_type);
102 
105  IdaCommandBuilder &compress_database();
106 
109  IdaCommandBuilder &pack_database();
110 
113  IdaCommandBuilder &no_pack_database();
114 
118  IdaCommandBuilder &run_debugger(const std::string &options = "");
119 
123  IdaCommandBuilder &load_resources(bool enabled = true);
124 
129  IdaCommandBuilder &run_script(const std::string &script_file, const std::vector<std::string> &args = {});
130 
135  IdaCommandBuilder &set_file_type(const std::string &file_type, const std::string &member = "");
136 
140  IdaCommandBuilder &empty_database(bool enabled = true);
141 
145  IdaCommandBuilder &set_windows_directory(const std::string &directory);
146 
150  IdaCommandBuilder &no_segmentation(bool enabled = true);
151 
155  IdaCommandBuilder &set_debug_flags(unsigned int flags);
156 
160  IdaCommandBuilder &set_debug_flags(const std::vector<std::string> &flag_names);
161 
164  std::string build_args() const;
165 
168  bool get_auto_analysis() const
169  {
170  return m_auto_analysis;
171  }
172 
173  private:
174  bool m_auto_analysis;
175  bool m_autonomous_mode;
176  bool m_has_loading_address;
177  unsigned int m_loading_address;
178  bool m_create_new_db;
179  bool m_has_compiler;
180  std::string m_compiler;
181  std::vector<std::string> m_first_pass_directives;
182  std::vector<std::string> m_second_pass_directives;
183  bool m_disable_fpp;
184  bool m_has_entry_point;
185  unsigned int m_entry_point;
186  bool m_has_jit_debugger;
187  int m_jit_debugger;
188  bool m_has_log_file;
189  std::string m_log_file;
190  bool m_disable_mouse;
191  bool m_has_plugin_options;
192  std::string m_plugin_options;
193  bool m_has_output_database;
194  std::string m_output_database;
195  bool m_has_processor_type;
196  std::string m_processor_type;
197  enum class db_compression
198  {
199  none,
200  compress,
201  pack,
202  no_pack
203  };
204  bool m_has_database_compression;
205  db_compression m_database_compression;
206  bool m_has_run_debugger;
207  std::string m_run_debugger;
208  bool m_load_resources;
209  bool m_has_script_file;
210  std::string m_script_file;
211  std::vector<std::string> m_script_args;
212  bool m_has_file_type;
213  std::string m_file_type;
214  bool m_has_file_member;
215  std::string m_file_member;
216  bool m_create_empty_db;
217  bool m_has_windows_dir;
218  std::string m_windows_dir;
219  bool m_no_segmentation;
220  unsigned int m_debug_flags;
221  bool m_use_text_mode;
222 
223  // Helper methods
224  unsigned int parse_debug_flag_names(const std::vector<std::string> &flag_names) const;
225  static std::string quote_if_needed(const std::string &str);
226  };
227 
228 #ifndef SWIG
229 }
230 #endif
231 
232 #endif // IdaCommandBuilder_H
Class to build and manage IDA command line options. Provides a fluent interface to set options and ge...
Definition: ida_command_builder.hpp:18
bool get_auto_analysis() const
Get auto-analysis option status.
Definition: ida_command_builder.hpp:168
#define IDA_API
Definition: common_defines.hpp:11
#define ABI_VERSION_NS
Definition: version.hpp:17