IDA SDK
|
Describes an array of IDC functions.
Public Attributes | |
size_t | qnty |
Number of functions. | |
ext_idcfunc_t * | funcs |
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... | |
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.
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.
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.
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.
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.
int idcfuncs_t::get_unkvar |
Retrieve value of an undeclared variable.
Expected prototype: get(VT_STR varname)
int idcfuncs_t::set_unkvar |
int idcfuncs_t::exec_resolved_func |
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.
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.