IDA Domain
Functions Class Reference

Provides access to function-related operations within the database. More...

#include <function.hpp>

Classes

class  Iterator
 Iterator for functions within a specified address range. More...
 

Public Member Functions

 Functions (const Database &database)
 Constructs a functions handler for the given database. More...
 
Iterator get_between (const ea_t start, const ea_t end) const
 Retrieves functions between specified addresses. More...
 
Iterator get_all () const
 Retrieves all functions in the database. More...
 
func_t * get_at (const ea_t ea) const
 Retrieves the function associated with the given address. More...
 
std::string get_name (const func_t *func) const
 Retrieves the name of the given function. More...
 
bool set_name (const func_t *func, const std::string &name) const
 Renames the given function. More...
 
BasicBlocks::Iterator get_basic_blocks (const func_t *func) const
 Retrieves the basic blocks that compose the given function. More...
 
Instructions::Iterator get_instructions (const func_t *func) const
 Retrieves all instructions within the given function. More...
 
std::vector< std::string > get_disassembly (const func_t *func) const
 Retrieves the disassembly lines for the given function. More...
 
std::vector< std::string > get_pseudocode (const func_t *func, bool remove_tags=true) const
 Retrieves the decompiled pseudocode of the given function. More...
 
std::string get_signature (const func_t *func) const
 Retrieves the function's type signature. More...
 
bool matches_signature (const func_t *func, const std::string &signature) const
 Checks if a function matches the given signature. More...
 
bool create (const ea_t ea) const
 Creates a new function at the specified address. More...
 
bool remove (const ea_t ea) const
 Deletes the function at the specified address. More...
 

Detailed Description

Provides access to function-related operations within the database.

Constructor & Destructor Documentation

◆ Functions()

Functions::Functions ( const Database database)
inline

Constructs a functions handler for the given database.

Parameters
databaseReference to the active IDA database.

Member Function Documentation

◆ create()

bool Functions::create ( const ea_t  ea) const

Creates a new function at the specified address.

Parameters
eaThe effective address to start the function.
Returns
True if the function was successfully created, false otherwise.

◆ get_all()

Iterator Functions::get_all ( ) const
inline

Retrieves all functions in the database.

Returns
A functions iterator covering the entire database range.

◆ get_at()

func_t* Functions::get_at ( const ea_t  ea) const

Retrieves the function associated with the given address.

Parameters
eaAn effective address within the function body.
Returns
A pointer to the corresponding function (func_t*), or nullptr on failure.

◆ get_basic_blocks()

BasicBlocks::Iterator Functions::get_basic_blocks ( const func_t *  func) const

Retrieves the basic blocks that compose the given function.

Parameters
funcThe function instance.
Returns
An iterator for the function's basic blocks.

◆ get_between()

Iterator Functions::get_between ( const ea_t  start,
const ea_t  end 
) const
inline

Retrieves functions between specified addresses.

Parameters
startStart address of the range.
endEnd address of the range.
Returns
A functions iterator.

◆ get_disassembly()

std::vector<std::string> Functions::get_disassembly ( const func_t *  func) const

Retrieves the disassembly lines for the given function.

Parameters
funcThe function instance.
Returns
A vector of strings, each representing a line of disassembly.

◆ get_instructions()

Instructions::Iterator Functions::get_instructions ( const func_t *  func) const

Retrieves all instructions within the given function.

Parameters
funcThe function instance.
Returns
An instruction iterator for the function.

◆ get_name()

std::string Functions::get_name ( const func_t *  func) const

Retrieves the name of the given function.

Parameters
funcThe function instance.
Returns
The function's name as a string, or an empty string on failure.

◆ get_pseudocode()

std::vector<std::string> Functions::get_pseudocode ( const func_t *  func,
bool  remove_tags = true 
) const

Retrieves the decompiled pseudocode of the given function.

Parameters
funcThe function instance.
remove_tagsRemove the tags, return a cleaned line.
Returns
A vector of strings, each representing a line of pseudocode.

◆ get_signature()

std::string Functions::get_signature ( const func_t *  func) const

Retrieves the function's type signature.

Parameters
funcThe function instance.
Returns
The signature as a string, or an empty string if unavailable.

◆ matches_signature()

bool Functions::matches_signature ( const func_t *  func,
const std::string &  signature 
) const

Checks if a function matches the given signature.

Parameters
funcThe function instance.
signatureThe signature string to compare.
Returns
True if the function matches, false otherwise.

◆ remove()

bool Functions::remove ( const ea_t  ea) const

Deletes the function at the specified address.

Parameters
eaThe effective address of the function to remove.
Returns
True if the function was successfully removed, false otherwise.

◆ set_name()

bool Functions::set_name ( const func_t *  func,
const std::string &  name 
) const

Renames the given function.

Parameters
funcThe function instance.
nameThe new name to assign to the function.
Returns
True on success, false otherwise.

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