IDA C++ SDK 9.2
|
Describes an array of IDC functions. More...
#include <expr.hpp>
Public Attributes | |
size_t | qnty |
Number of functions. | |
ext_idcfunc_t * | funcs |
Function table. | |
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. | |
int | set_unkvar |
Store a value to an undeclared variable. | |
int | exec_resolved_func |
Execute resolved function. | |
int | calc_sizeof |
Calculate sizeof(type). | |
int | get_field_ea |
Get address of the specified field using the type information from the idb. |
IDC Engine | |
IDC engine requires the following functions (all of them may be nullptr) | |
size_t | bufsize |
size_t ea_t | ea |
error_t (idaapi *startup)(void) | |
Start IDC engine. Called before executing any IDC code. | |
error_t (idaapi *shutdown)(void) | |
Stop IDC engine. | |
void (idaapi *init_idc)(void) | |
Initialize IDC engine. | |
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? | |
size_t (idaapi *ea2str)(char *buf | |
Convert an address to a string. | |
bool (idaapi *undeclared_variable_ok)(const char *name) | |
Should a variable name be accepted without declaration? |
Describes an array of IDC functions.
idcfuncs_t::error_t | ( | idaapi * | startup | ) |
Start IDC engine. Called before executing any IDC code.
idcfuncs_t::error_t | ( | idaapi * | shutdown | ) |
Stop IDC engine.
Called when all IDC engines finish. In other words, nested IDC engines do not call startup/shutdown.
idcfuncs_t::void | ( | idaapi * | init_idc | ) |
Initialize IDC engine.
Called once at the very beginning of work. This callback may create additional IDC classes, methods, etc.
idcfuncs_t::void | ( | idaapi * | term_idc | ) |
Terminate IDC engine. Called once at the very end of work.
idcfuncs_t::bool | ( | idaapi * | is_database_open | ) |
Is the database open?
(used for #EXTFUN_BASE functions). if this pointer is nullptr, #EXTFUN_BASE is not checked.
idcfuncs_t::size_t | ( | idaapi * | ea2str | ) |
Convert an address to a string.
if this pointer is nullptr, 'a' will be used.
idcfuncs_t::bool | ( | idaapi * | undeclared_variable_ok | ) | const |
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.
size_t idcfuncs_t::qnty |
Number of functions.
ext_idcfunc_t* idcfuncs_t::funcs |
Function table.
size_t idcfuncs_t::bufsize |
int idcfuncs_t::get_unkvar |
Retrieve value of an undeclared variable.
Expected prototype: get(#VT_STR varname)
int idcfuncs_t::set_unkvar |
Store a value to an undeclared variable.
Expected prototype: set(#VT_WILD new_value, #VT_STR varname)
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.
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.