| IDA SDK

Functions
idalib.hpp File Reference

## Detailed Description

Contains the IDA as library functions.

## Functions
idaman int ida_export | init_library (int argc=0, char *argv[]=nullptr)
| Initialize ida as library. More...
idaman int ida_export | open_database (const char *file_path, bool run_auto)
| Open the database specified in file_path argument If the database did not exist, a new database will be created and the input file will be loaded Note: All library functions must be called from the same thread that initialized the library The library is single-threaded, and performing database operations from a different thread than the initialization thread may lead to undefined behavior. More...
idaman void ida_export | close_database (bool save)
| Close the current database. More...
idaman bool ida_export | make_signatures (bool only_pat)
| Generate .sig and .pat files for the current database. More...
idaman void ida_export | enable_console_messages (bool enable)
| Enable console messages. More...
idaman void ida_export | set_screen_ea (ea_t ea)
| Set screen ea, let the user specify the current screen ea subsequent calls to get_screen_ea will return this value Please note that with idalib there is no screen, this is provided just for being able to use the get_screen_ea. More...
idaman bool ida_export | get_library_version (int &major, int &minor, int &build)
| Get ida library version. More...

## Function Documentation

## ◆ init_library()

idaman int ida_export init_library | ( | int | argc = `0`,
|  | char * | argv[] = `nullptr`
| ) |  |

Initialize ida as library.

Parameters

  argc | Optional parameters count for advanced usage
  argv | Optional parameters list for advanced usage

Returns
  0 if successfully initialized, non zero in case of errors

## ◆ open_database()

idaman int ida_export open_database | ( | const char * | file_path,
|  | bool | run_auto
| ) |  |

Open the database specified in file_path argument If the database did not exist, a new database will be created and the input file will be loaded Note: All library functions must be called from the same thread that initialized the library The library is single-threaded, and performing database operations from a different thread than the initialization thread may lead to undefined behavior.

Parameters

  file_path | the file name to be loaded
  run_auto | if set to true, library will run also auto analysis

Returns
  0 if successfully opened, otherwise error code

## ◆ close_database()

idaman void ida_export close_database | ( | bool | save | ) |

Close the current database.

Parameters

  save | boolean value, save or discard changes

## ◆ make_signatures()

idaman bool ida_export make_signatures | ( | bool | only_pat | ) |

Generate .sig and .pat files for the current database.

Parameters

  only_pat | Generate .pat file only

Returns
  true in case of success

## ◆ enable_console_messages()

idaman void ida_export enable_console_messages | ( | bool | enable | ) |

Enable console messages.

Parameters

  enable | flag to activate or deactivate console messages by default, console messages are disabled

## ◆ set_screen_ea()

idaman void ida_export set_screen_ea | ( | ea_t | ea | ) |

Set screen ea, let the user specify the current screen ea subsequent calls to get_screen_ea will return this value Please note that with idalib there is no screen, this is provided just for being able to use the get_screen_ea.

Parameters

  ea | screen ea

## ◆ get_library_version()

idaman bool ida_export get_library_version | ( | int & | major,
|  | int & | minor,
|  | int & | build
| ) |  |

Get ida library version.

Parameters

  major | major version
  minor | minor version
  build | build number

Returns
  true in case of success