IDA Domain
Database Class Reference

Provides access and control over the loaded IDA database. More...

#include <database.hpp>

+ Collaboration diagram for Database:

Public Member Functions

 Database ()
 Constructs a new interface to the IDA database. More...
 
bool open (const std::string &db_path, const IdaCommandBuilder &db_args=IdaCommandBuilder())
 Opens a database from the specified file path. More...
 
bool is_open () const
 Checks if the database is loaded. More...
 
void close (bool save)
 Closes the currently open database. More...
 
ea_t get_entry_point () const
 Retrieves the entry point address of the binary. More...
 
bool set_current_ea (const ea_t ea) const
 Sets the current effective address (equivalent to the "screen EA" in IDA GUI). More...
 
ea_t get_current_ea () const
 Get the current effective address (equivalent to the "screen EA" in IDA GUI). More...
 
ea_t get_minimum_ea () const
 Get the minimum effective address from this database. More...
 
ea_t get_maximum_ea () const
 Get the maximum effective address from this database. More...
 
std::map< std::string, std::string > get_metadata () const
 Retrieves a map of key-value metadata about the current database. More...
 

Public Attributes

const Segments segments
 Handler that provides access to memory segment-related operations. More...
 
const Functions functions
 Handler that provides access to function-related operations. More...
 
const BasicBlocks basic_blocks
 Handler that provides access to basic block-related operations. More...
 
const Instructions instructions
 Handler that provides access to instruction-related operations. More...
 
const Comments comments
 Handler that provides access to user comment-related operations. More...
 
const Strings strings
 Handler that provides access to string-related operations. More...
 
const Names names
 Handler that provides access to name-related operations. More...
 
const Types types
 Handler that provides access to type-related operations. More...
 
const Bytes bytes
 Handler that provides access to byte-level memory operations. More...
 
const SignaturesFiles signature_files
 Handler that provides access to signature file operations. More...
 
const Xrefs xrefs
 Handler that provides access to cross-reference (xref) operations. More...
 

Detailed Description

Provides access and control over the loaded IDA database.

Constructor & Destructor Documentation

◆ Database()

Database::Database ( )

Constructs a new interface to the IDA database.

Note
When running inside IDA, this refers to the currently open database. Use open() to load a new database when using IDA as a library.

Member Function Documentation

◆ close()

void Database::close ( bool  save)

Closes the currently open database.

Parameters
saveIf true, saves changes before closing; otherwise, discards them.

◆ get_current_ea()

ea_t Database::get_current_ea ( ) const

Get the current effective address (equivalent to the "screen EA" in IDA GUI).

Returns
The current effective address.

◆ get_entry_point()

ea_t Database::get_entry_point ( ) const

Retrieves the entry point address of the binary.

Returns
The effective address (ea_t) of the entry point.

◆ get_maximum_ea()

ea_t Database::get_maximum_ea ( ) const

Get the maximum effective address from this database.

Returns
The maximum effective address.

◆ get_metadata()

std::map<std::string, std::string> Database::get_metadata ( ) const

Retrieves a map of key-value metadata about the current database.

Metadata includes information such as architecture, bitness, format, or load time.

Returns
Map of string key-value pairs representing database metadata.

◆ get_minimum_ea()

ea_t Database::get_minimum_ea ( ) const

Get the minimum effective address from this database.

Returns
The minimum effective address.

◆ is_open()

bool Database::is_open ( ) const

Checks if the database is loaded.

Returns
True if a database is open, false otherwise.

◆ open()

bool Database::open ( const std::string &  db_path,
const IdaCommandBuilder db_args = IdaCommandBuilder() 
)

Opens a database from the specified file path.

Parameters
db_pathPath to the input file.
db_argsCommand builder responsible for passing arguments to IDA kernel.
Note
This function is available only when running IDA as a library. When running inside the IDA GUI, simply construct a Database() instance to refer to the currently open database. Use is_open() to check if a database is loaded.
Returns
True if the database was successfully opened, false otherwise.

◆ set_current_ea()

bool Database::set_current_ea ( const ea_t  ea) const

Sets the current effective address (equivalent to the "screen EA" in IDA GUI).

Returns
True if the address was successfully set, false otherwise.

Member Data Documentation

◆ basic_blocks

const BasicBlocks Database::basic_blocks

Handler that provides access to basic block-related operations.

◆ bytes

const Bytes Database::bytes

Handler that provides access to byte-level memory operations.

◆ comments

const Comments Database::comments

Handler that provides access to user comment-related operations.

◆ functions

const Functions Database::functions

Handler that provides access to function-related operations.

◆ instructions

const Instructions Database::instructions

Handler that provides access to instruction-related operations.

◆ names

const Names Database::names

Handler that provides access to name-related operations.

◆ segments

const Segments Database::segments

Handler that provides access to memory segment-related operations.

◆ signature_files

const SignaturesFiles Database::signature_files

Handler that provides access to signature file operations.

◆ strings

const Strings Database::strings

Handler that provides access to string-related operations.

◆ types

const Types Database::types

Handler that provides access to type-related operations.

◆ xrefs

const Xrefs Database::xrefs

Handler that provides access to cross-reference (xref) operations.


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