IDA Domain
IdaCommandBuilder Class Reference

Class to build and manage IDA command line options. Provides a fluent interface to set options and generate command lines for IDA Pro/IDA Free based on the available command line switches. More...

#include <ida_command_builder.hpp>

Public Member Functions

 IdaCommandBuilder ()
 Initialize IDA command line options. More...
 
IdaCommandBuilderuse_text_mode ()
 Use idat (text interface) instead of ida. More...
 
IdaCommandBuilderauto_analysis (bool enabled=true)
 Enable or disable auto analysis. More...
 
IdaCommandBuilderautonomous (bool enabled=true)
 Enable or disable autonomous mode (no dialog boxes). More...
 
IdaCommandBuilderset_loading_address (unsigned int address)
 Set loading address in paragraphs (hexadecimal). More...
 
IdaCommandBuildernew_database (bool enabled=true)
 Disassemble a new file (delete old database). More...
 
IdaCommandBuilderset_compiler (const std::string &name, const std::string &abi="")
 Set compiler in format name:abi. More...
 
IdaCommandBuilderadd_first_pass_directive (const std::string &directive)
 Add a configuration directive processed at first pass. More...
 
IdaCommandBuilderadd_second_pass_directive (const std::string &directive)
 Add a configuration directive processed at second pass. More...
 
IdaCommandBuilderdisable_fpp_instructions (bool disabled=true)
 Disable FPP instructions (IBM PC only). More...
 
IdaCommandBuilderset_entry_point (unsigned int address)
 Set program entry point (hex). More...
 
IdaCommandBuilderset_jit_debugger (bool enabled=true)
 Set IDA as just-in-time debugger. More...
 
IdaCommandBuilderset_log_file (const std::string &filename)
 Set the name of the log file. More...
 
IdaCommandBuilderdisable_mouse (bool disabled=true)
 Disable mouse (text mode only). More...
 
IdaCommandBuilderset_plugin_options (const std::string &options)
 Set options to pass to plugins. More...
 
IdaCommandBuilderset_output_database (const std::string &path)
 Specify the output database (implies -c). More...
 
IdaCommandBuilderset_processor (const std::string &processor_type)
 Set processor type. More...
 
IdaCommandBuildercompress_database ()
 Compress database (create zipped idb). More...
 
IdaCommandBuilderpack_database ()
 Pack database (create unzipped idb). More...
 
IdaCommandBuilderno_pack_database ()
 Do not pack database (not recommended). More...
 
IdaCommandBuilderrun_debugger (const std::string &options="")
 Immediately run the built-in debugger with optional parameters. More...
 
IdaCommandBuilderload_resources (bool enabled=true)
 Load MS Windows exe file resources. More...
 
IdaCommandBuilderrun_script (const std::string &script_file, const std::vector< std::string > &args={})
 Execute a script file when the database is opened. More...
 
IdaCommandBuilderset_file_type (const std::string &file_type, const std::string &member="")
 Interpret the input file as the specified file type. More...
 
IdaCommandBuilderempty_database (bool enabled=true)
 Create an empty database. More...
 
IdaCommandBuilderset_windows_directory (const std::string &directory)
 Specify MS Windows directory. More...
 
IdaCommandBuilderno_segmentation (bool enabled=true)
 Do not create segmentation (used with Dump database command). More...
 
IdaCommandBuilderset_debug_flags (unsigned int flags)
 Set debug flags using a raw integer value. More...
 
IdaCommandBuilderset_debug_flags (const std::vector< std::string > &flag_names)
 Set debug flags using a list of flag names. More...
 
std::string build_args () const
 Build the command line arguments based on the set options. More...
 
bool get_auto_analysis () const
 Get auto-analysis option status. More...
 

Detailed Description

Class to build and manage IDA command line options. Provides a fluent interface to set options and generate command lines for IDA Pro/IDA Free based on the available command line switches.

Constructor & Destructor Documentation

◆ IdaCommandBuilder()

IdaCommandBuilder::IdaCommandBuilder ( )

Initialize IDA command line options.

Member Function Documentation

◆ add_first_pass_directive()

IdaCommandBuilder & IdaCommandBuilder::add_first_pass_directive ( const std::string &  directive)

Add a configuration directive processed at first pass.

Parameters
directiveDirective string (e.g., "VPAGESIZE=8192")
Returns
Reference to this object for method chaining

◆ add_second_pass_directive()

IdaCommandBuilder & IdaCommandBuilder::add_second_pass_directive ( const std::string &  directive)

Add a configuration directive processed at second pass.

Parameters
directiveDirective string
Returns
Reference to this object for method chaining

◆ auto_analysis()

IdaCommandBuilder & IdaCommandBuilder::auto_analysis ( bool  enabled = true)

Enable or disable auto analysis.

Parameters
enabledTrue to enable, false to disable
Returns
Reference to this object for method chaining

◆ autonomous()

IdaCommandBuilder & IdaCommandBuilder::autonomous ( bool  enabled = true)

Enable or disable autonomous mode (no dialog boxes).

Parameters
enabledTrue to enable, false to disable
Returns
Reference to this object for method chaining

◆ build_args()

std::string IdaCommandBuilder::build_args ( ) const

Build the command line arguments based on the set options.

Returns
The command line arguments as a string

◆ compress_database()

IdaCommandBuilder & IdaCommandBuilder::compress_database ( )

Compress database (create zipped idb).

Returns
Reference to this object for method chaining

◆ disable_fpp_instructions()

IdaCommandBuilder & IdaCommandBuilder::disable_fpp_instructions ( bool  disabled = true)

Disable FPP instructions (IBM PC only).

Parameters
disabledTrue to disable, false to enable
Returns
Reference to this object for method chaining

◆ disable_mouse()

IdaCommandBuilder & IdaCommandBuilder::disable_mouse ( bool  disabled = true)

Disable mouse (text mode only).

Parameters
disabledTrue to disable, false to enable
Returns
Reference to this object for method chaining

◆ empty_database()

IdaCommandBuilder & IdaCommandBuilder::empty_database ( bool  enabled = true)

Create an empty database.

Parameters
enabledTrue to enable, false to disable
Returns
Reference to this object for method chaining

◆ get_auto_analysis()

bool IdaCommandBuilder::get_auto_analysis ( ) const
inline

Get auto-analysis option status.

Returns
True if auto-analysis is enabled

◆ load_resources()

IdaCommandBuilder & IdaCommandBuilder::load_resources ( bool  enabled = true)

Load MS Windows exe file resources.

Parameters
enabledTrue to enable, false to disable
Returns
Reference to this object for method chaining

◆ new_database()

IdaCommandBuilder & IdaCommandBuilder::new_database ( bool  enabled = true)

Disassemble a new file (delete old database).

Parameters
enabledTrue to enable, false to disable
Returns
Reference to this object for method chaining

◆ no_pack_database()

IdaCommandBuilder & IdaCommandBuilder::no_pack_database ( )

Do not pack database (not recommended).

Returns
Reference to this object for method chaining

◆ no_segmentation()

IdaCommandBuilder & IdaCommandBuilder::no_segmentation ( bool  enabled = true)

Do not create segmentation (used with Dump database command).

Parameters
enabledTrue to enable, false to disable
Returns
Reference to this object for method chaining

◆ pack_database()

IdaCommandBuilder & IdaCommandBuilder::pack_database ( )

Pack database (create unzipped idb).

Returns
Reference to this object for method chaining

◆ run_debugger()

IdaCommandBuilder & IdaCommandBuilder::run_debugger ( const std::string &  options = "")

Immediately run the built-in debugger with optional parameters.

Parameters
optionsOptional debugger parameters
Returns
Reference to this object for method chaining

◆ run_script()

IdaCommandBuilder & IdaCommandBuilder::run_script ( const std::string &  script_file,
const std::vector< std::string > &  args = {} 
)

Execute a script file when the database is opened.

Parameters
script_filePath to the script file
argsOptional list of arguments for the script
Returns
Reference to this object for method chaining

◆ set_compiler()

IdaCommandBuilder & IdaCommandBuilder::set_compiler ( const std::string &  name,
const std::string &  abi = "" 
)

Set compiler in format name:abi.

Parameters
nameCompiler name
abiOptional ABI specification
Returns
Reference to this object for method chaining

◆ set_debug_flags() [1/2]

IdaCommandBuilder & IdaCommandBuilder::set_debug_flags ( const std::vector< std::string > &  flag_names)

Set debug flags using a list of flag names.

Parameters
flag_namesList of flag names
Returns
Reference to this object for method chaining

◆ set_debug_flags() [2/2]

IdaCommandBuilder & IdaCommandBuilder::set_debug_flags ( unsigned int  flags)

Set debug flags using a raw integer value.

Parameters
flagsInteger with debug flags
Returns
Reference to this object for method chaining

◆ set_entry_point()

IdaCommandBuilder & IdaCommandBuilder::set_entry_point ( unsigned int  address)

Set program entry point (hex).

Parameters
addressEntry point address
Returns
Reference to this object for method chaining

◆ set_file_type()

IdaCommandBuilder & IdaCommandBuilder::set_file_type ( const std::string &  file_type,
const std::string &  member = "" 
)

Interpret the input file as the specified file type.

Parameters
file_typeFile type prefix as seen in 'load file' dialog
memberOptional archive member (e.g., "classes.dex" for ZIP)
Returns
Reference to this object for method chaining

◆ set_jit_debugger()

IdaCommandBuilder & IdaCommandBuilder::set_jit_debugger ( bool  enabled = true)

Set IDA as just-in-time debugger.

Parameters
enabledTrue to enable, false to disable
Returns
Reference to this object for method chaining

◆ set_loading_address()

IdaCommandBuilder & IdaCommandBuilder::set_loading_address ( unsigned int  address)

Set loading address in paragraphs (hexadecimal).

Parameters
addressLoading address in paragraphs (16 bytes each)
Returns
Reference to this object for method chaining

◆ set_log_file()

IdaCommandBuilder & IdaCommandBuilder::set_log_file ( const std::string &  filename)

Set the name of the log file.

Parameters
filenameLog file name
Returns
Reference to this object for method chaining

◆ set_output_database()

IdaCommandBuilder & IdaCommandBuilder::set_output_database ( const std::string &  path)

Specify the output database (implies -c).

Parameters
pathPath to the output database
Returns
Reference to this object for method chaining

◆ set_plugin_options()

IdaCommandBuilder & IdaCommandBuilder::set_plugin_options ( const std::string &  options)

Set options to pass to plugins.

Parameters
optionsOptions string
Returns
Reference to this object for method chaining

◆ set_processor()

IdaCommandBuilder & IdaCommandBuilder::set_processor ( const std::string &  processor_type)

Set processor type.

Parameters
processor_typeProcessor type string
Returns
Reference to this object for method chaining

◆ set_windows_directory()

IdaCommandBuilder & IdaCommandBuilder::set_windows_directory ( const std::string &  directory)

Specify MS Windows directory.

Parameters
directoryWindows directory path
Returns
Reference to this object for method chaining

◆ use_text_mode()

IdaCommandBuilder & IdaCommandBuilder::use_text_mode ( )

Use idat (text interface) instead of ida.

Returns
Reference to this object for method chaining

The documentation for this class was generated from the following files: