Latest available version: IDA and decompilers v8.4.240320sp1 see all releases
Hex-Rays logo State-of-the-art binary code analysis tools
email icon
idcfuncs_t Struct Reference

Describes an array of IDC functions. More...

#include <expr.hpp>

Public Attributes

size_t qnty
 Number of functions.
 
ext_idcfunc_tfuncs
 Function table.
 
IDC Engine

IDC engine requires the following functions (all of them may be nullptr)

error_t(idaapi * startup )(void)
 Start IDC engine. Called before executing any IDC code.
 
error_t(idaapi * shutdown )(void)
 Stop IDC engine. More...
 
void(idaapi * init_idc )(void)
 Initialize IDC engine. More...
 
void(idaapi * term_idc )(void)
 Terminate IDC engine. Called once at the very end of work.
 
bool(idaapi * is_database_open )(void)
 Is the database open? (used for EXTFUN_BASE functions). More...
 
size_t(idaapi * ea2str )(char *buf, size_t bufsize, ea_t ea)
 Convert an address to a string. More...
 
bool(idaapi * undeclared_variable_ok )(const char *name)
 Should a variable name be accepted without declaration?. More...
 
Indexes

Indexes into the 'f' array.

non-positive values mean that the function does not exist

int get_unkvar
 Retrieve value of an undeclared variable. More...
 
int set_unkvar
 Store a value to an undeclared variable. More...
 
int exec_resolved_func
 Execute resolved function. More...
 
int calc_sizeof
 Calculate sizeof(type). More...
 
int get_field_ea
 Get address of the specified field using the type information from the idb. More...
 

Detailed Description

Describes an array of IDC functions.

Member Data Documentation

◆ shutdown

error_t(idaapi * idcfuncs_t::shutdown) (void)

Stop IDC engine.

Called when all IDC engines finish. In other words, nested IDC engines do not call startup/shutdown.

◆ init_idc

void(idaapi * idcfuncs_t::init_idc) (void)

Initialize IDC engine.

Called once at the very beginning of work. This callback may create additional IDC classes, methods, etc.

◆ is_database_open

bool(idaapi * idcfuncs_t::is_database_open) (void)

Is the database open? (used for EXTFUN_BASE functions).

if this pointer is nullptr, EXTFUN_BASE is not checked.

◆ ea2str

size_t(idaapi * idcfuncs_t::ea2str) (char *buf, size_t bufsize, ea_t ea)

Convert an address to a string.

if this pointer is nullptr, 'a' will be used.

◆ undeclared_variable_ok

bool(idaapi * idcfuncs_t::undeclared_variable_ok) (const char *name)

Should a variable name be accepted without declaration?.

When the parser encounters an unrecognized variable, this callback is called. If it returns false, the parser generates the 'undefined variable' error else the parser generates code to call to a set or get function, depending on the current context. If this pointer is nullptr, undeclared variables won't be supported. However, if 'resolver' object is provided to the parser, it will be used to resolve such names to constants at the compilation time. This callback is used by IDA to handle processor register names.

◆ get_unkvar

int idcfuncs_t::get_unkvar

Retrieve value of an undeclared variable.

Expected prototype: get(VT_STR varname)

◆ set_unkvar

int idcfuncs_t::set_unkvar

Store a value to an undeclared variable.

Expected prototype: set(VT_WILD new_value, VT_STR varname)

◆ exec_resolved_func

int idcfuncs_t::exec_resolved_func

Execute resolved function.

If 'resolver' was used to resolve an unknown name to a constant in a function call context, such a call will be redirected here. Expected prototype: exec_resolved_func(VT_LONG func, VT_WILD typeinfo, ...) This callback is used in IDA for Appcall.

◆ calc_sizeof

int idcfuncs_t::calc_sizeof

Calculate sizeof(type).

This function is used by the interpreter to calculate sizeof() expressions. Please note that the 'type' argument is an IDC object of typeinfo class. Expected prototype: calc_sizeof(VT_OBJ typeinfo) This callback requires support of the type system (available only in IDA kernel) It should not be used by standalone IDC interpreters.

◆ get_field_ea

int idcfuncs_t::get_field_ea

Get address of the specified field using the type information from the idb.

This function is used to resolve expressions like 'mystr.field' where mystr does not represent an IDC object but just a plain number. The number is interpreted as an address in the current idb. This function retrieves type information at this address and tried to find the specified 'field'. It returns the address of the 'field' in the idb. This callback should not be used by standalone IDC interpreters.


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