IDA SDK
Classes | Functions | Macros | Typedefs | Enumerations
expr.hpp File Reference

Detailed Description

Functions that deal with C-like expressions and built-in IDC language.

Functions marked THREAD_SAFE may be called from any thread. No simultaneous calls should be made for the same variable. We protect only global structures, individual variables must be protected manually.

Classes

class  idc_value_t
 Class to hold idc values. More...
 
struct  idc_global_t
 Global idc variable. More...
 
struct  ext_idcfunc_t
 Element of functions table. See idcfuncs_t::funcs. More...
 
struct  idcfuncs_t
 Describes an array of IDC functions. More...
 
struct  highlighter_cbs_t
 
struct  syntax_highlighter_t
 Base class for syntax highligters. More...
 
struct  extlang_t
 External language (to support third party language interpreters) More...
 
struct  extlang_visitor_t
 Process all registered extlangs. More...
 
struct  idc_resolver_t
 Compile text with IDC function(s). More...
 

Functions

idaman THREAD_SAFE error_t ida_export idcv_long (idc_value_t *v)
 Convert IDC variable to a long (32/64bit) number. More...
 
idaman THREAD_SAFE error_t ida_export idcv_int64 (idc_value_t *v)
 Convert IDC variable to a 64bit number. More...
 
idaman THREAD_SAFE error_t ida_export idcv_num (idc_value_t *v)
 Convert IDC variable to a long number. More...
 
idaman THREAD_SAFE error_t ida_export idcv_string (idc_value_t *v)
 Convert IDC variable to a text string.
 
idaman THREAD_SAFE error_t ida_export idcv_float (idc_value_t *v)
 Convert IDC variable to a floating point.
 
idaman THREAD_SAFE error_t ida_export idcv_object (idc_value_t *v, const idc_class_t *icls=NULL)
 Create an IDC object. More...
 
idaman THREAD_SAFE error_t ida_export move_idcv (idc_value_t *dst, idc_value_t *src)
 Move 'src' to 'dst'. More...
 
idaman THREAD_SAFE error_t ida_export copy_idcv (idc_value_t *dst, const idc_value_t &src)
 Copy 'src' to 'dst'. More...
 
idaman THREAD_SAFE error_t ida_export deep_copy_idcv (idc_value_t *dst, const idc_value_t &src)
 Deep copy an IDC object. More...
 
idaman THREAD_SAFE void ida_export free_idcv (idc_value_t *v)
 Free storage used by VT_STR/VT_OBJ IDC variables. More...
 
idaman THREAD_SAFE void ida_export swap_idcvs (idc_value_t *v1, idc_value_t *v2)
 Swap 2 variables.
 
idaman THREAD_SAFE error_t ida_export get_idcv_class_name (qstring *out, const idc_value_t *obj)
 Retrieves the IDC object class name. More...
 
idaman THREAD_SAFE error_t ida_export get_idcv_attr (idc_value_t *res, const idc_value_t *obj, const char *attr, bool may_use_getattr=false)
 Get an object attribute. More...
 
idaman THREAD_SAFE error_t ida_export set_idcv_attr (idc_value_t *obj, const char *attr, const idc_value_t &value, bool may_use_setattr=false)
 Set an object attribute. More...
 
idaman THREAD_SAFE error_t ida_export del_idcv_attr (idc_value_t *obj, const char *attr)
 Delete an object attribute. More...
 
idaman bool ida_export print_idcv (qstring *out, const idc_value_t &v, const char *name=NULL, int indent=0)
 Get text representation of idc_value_t.
 
idaman THREAD_SAFE error_t ida_export get_idcv_slice (idc_value_t *res, const idc_value_t *v, uval_t i1, uval_t i2, int flags=0)
 Get slice. More...
 
idaman THREAD_SAFE error_t ida_export set_idcv_slice (idc_value_t *v, uval_t i1, uval_t i2, const idc_value_t &in, int flags=0)
 Set slice. More...
 
idaman THREAD_SAFE idc_class_t *ida_export add_idc_class (const char *name, const idc_class_t *super=NULL)
 Create a new IDC class. More...
 
idaman THREAD_SAFE idc_class_t *ida_export find_idc_class (const char *name)
 Find an existing IDC class by its name. More...
 
idaman THREAD_SAFE bool ida_export set_idc_method (idc_class_t *icls, const char *fullfuncname)
 Set an IDC class method. More...
 
idaman THREAD_SAFE const char *ida_export set_idc_dtor (idc_class_t *icls, const char *fullfuncname)
 Set a destructor for an idc class. More...
 
idaman THREAD_SAFE idc_value_t *ida_export deref_idcv (idc_value_t *v, int vref_flags)
 Dereference a VT_REF variable. More...
 
idaman THREAD_SAFE bool ida_export create_idcv_ref (idc_value_t *ref, const idc_value_t *v)
 Create a variable reference. More...
 
idaman THREAD_SAFE idc_value_t *ida_export add_idc_gvar (const char *name)
 Add global IDC variable. More...
 
idaman THREAD_SAFE idc_value_t *ida_export find_idc_gvar (const char *name)
 Find an existing global IDC variable by its name. More...
 
idaman THREAD_SAFE bool ida_export add_idc_func (const ext_idcfunc_t &func)
 Add an IDC function. More...
 
idaman THREAD_SAFE bool ida_export del_idc_func (const char *name)
 Delete an IDC function.
 
idaman THREAD_SAFE bool ida_export find_idc_func (qstring *out, const char *prefix, int n=0)
 
idaman void *ida_export get_current_extlang (void)
 Get current active external language.
 
const extlang_object_t get_extlang (void)
 
idaman ssize_t ida_export install_extlang (extlang_t *el)
 Install an external language interpreter. More...
 
idaman bool ida_export remove_extlang (extlang_t *el)
 Uninstall an external language interpreter. More...
 
idaman bool ida_export select_extlang (extlang_t *el)
 Selects the external language interpreter. More...
 
idaman ssize_t ida_export for_all_extlangs (extlang_visitor_t &ev, bool select=false)
 
idaman void *ida_export find_extlang (const void *str, find_extlang_kind_t kind)
 
extlang_object_t find_extlang_by_ext (const char *ext)
 Get the extlang that can handle the given file extension.
 
extlang_object_t find_extlang_by_name (const char *name)
 Find an extlang by name.
 
extlang_object_t find_extlang_by_index (size_t idx)
 Find an extlang by index.
 
idaman THREAD_SAFE bool ida_export set_header_path (const char *path, bool add)
 Set or append a header path. More...
 
idaman THREAD_SAFE char *ida_export get_idc_filename (char *buf, size_t bufsize, const char *file)
 Get full name of IDC file name. More...
 
idaman THREAD_SAFE bool ida_export exec_system_script (const char *file, bool complain_if_no_file=true)
 Compile and execute "main" function from system file. More...
 
idaman bool ida_export eval_expr_long (sval_t *res, ea_t where, const char *line, qstring *errbuf=NULL)
 Compile and calculate an expression. More...
 
bool idaapi eval_expr_long (uval_t *res, ea_t where, const char *line, qstring *errbuf=NULL)
 See eval_expr_long()
 
idaman bool ida_export eval_expr (idc_value_t *rv, ea_t where, const char *line, qstring *errbuf=NULL)
 Compile and calculate an expression. More...
 
idaman bool ida_export eval_idc_expr (idc_value_t *rv, ea_t where, const char *buf, qstring *errbuf=NULL)
 Same as eval_expr(), but will always use the IDC interpreter regardless of the currently installed extlang. More...
 
idaman THREAD_SAFE bool ida_export compile_idc_file (const char *file, qstring *errbuf=NULL, int cpl_flags=CPL_DEL_MACROS|CPL_USE_LABELS)
 
idaman THREAD_SAFE bool ida_export compile_idc_text (const char *line, qstring *errbuf=NULL, idc_resolver_t *resolver=NULL, bool only_safe_funcs=false)
 
idaman bool ida_export compile_idc_snippet (const char *func, const char *text, qstring *errbuf=NULL, idc_resolver_t *resolver=NULL, bool only_safe_funcs=false)
 Compile text with IDC statements. More...
 
idaman bool ida_export call_idc_func (idc_value_t *result, const char *fname, const idc_value_t args[], size_t argsnum, qstring *errbuf=NULL, idc_resolver_t *resolver=NULL)
 Execute an IDC function. More...
 
THREAD_SAFE bool exec_idc_script (idc_value_t *result, const char *path, const char *func, const idc_value_t args[], size_t argsnum, qstring *errbuf=NULL)
 Compile and execute IDC function(s) from file. More...
 
idaman bool ida_export eval_idc_snippet (idc_value_t *result, const char *line, qstring *errbuf=NULL, idc_resolver_t *resolver=NULL)
 Compile and execute IDC statements or expressions. More...
 
idaman void ida_export setup_lowcnd_regfuncs (idc_func_t *getreg, idc_func_t *setreg)
 Setup lowcnd callbacks to read/write registers. More...
 
bool get_idptype_and_data (int *vtype, const void **vdata, const idc_value_t &v)
 Extract type & data from the idc_value_t instance that was passed to parse_config_value(). More...
 
Enumerate object attributes
idaman THREAD_SAFE const char *ida_export first_idcv_attr (const idc_value_t *obj)
 
idaman THREAD_SAFE const char *ida_export last_idcv_attr (const idc_value_t *obj)
 
idaman THREAD_SAFE const char *ida_export next_idcv_attr (const idc_value_t *obj, const char *attr)
 
idaman THREAD_SAFE const char *ida_export prev_idcv_attr (const idc_value_t *obj, const char *attr)
 
Set user-defined functions to work with object attributes.

If the function name is NULL, the definitions are removed.

Returns
name of the old attribute function. NULL means error, "" means no previous attr func
idaman THREAD_SAFE const char *ida_export set_idc_getattr (idc_class_t *icls, const char *fullfuncname)
 
idaman THREAD_SAFE const char *ida_export set_idc_setattr (idc_class_t *icls, const char *fullfuncname)
 

Macros

#define IDC_LANG_EXT   "idc"
 IDC script extension.
 
#define VARSLICE_SINGLE   0x0001
 return single index (i2 is ignored)
 
#define VREF_LOOP   0x0000
 dereference until we get a non VT_REF
 
#define VREF_ONCE   0x0001
 dereference only once, do not loop
 
#define VREF_COPY   0x0002
 copy the result to the input var (v)
 
#define VT_LONG   2
 Integer (see idc_value_t::num)
 
#define VT_FLOAT   3
 Floating point (see idc_value_t::e)
 
#define VT_WILD   4
 Function with arbitrary number of arguments. More...
 
#define VT_OBJ   5
 Object (see idc_value_t::obj)
 
#define VT_FUNC   6
 Function (see idc_value_t::funcidx)
 
#define VT_STR   7
 String (see qstr() and similar functions)
 
#define VT_PVOID   8
 void *
 
#define VT_INT64   9
 i64
 
#define VT_REF   10
 Reference.
 
#define eExecThrow   90
 See return value of idc_func_t.
 
#define EXTFUN_BASE   0x0001
 requires open database.
 
#define EXTFUN_NORET   0x0002
 does not return. More...
 
#define EXTFUN_SAFE   0x0004
 thread safe function. More...
 
#define HF_FIRST   HF_KEYWORD1
 
#define EXTLANG_IDC   0x01
 
#define EXTLANG_NS_AWARE   0x02
 Namespace-aware (see above.)
 
#define CPL_DEL_MACROS   0x0001
 delete macros at the end of compilation
 
#define CPL_USE_LABELS   0x0002
 allow program labels in the script
 
#define CPL_ONLY_SAFE   0x0004
 allow calls of only thread-safe functions
 

Typedefs

typedef qvector< idc_global_tidc_vars_t
 vector of global idc variables
 
typedef error_t idaapi idc_func_t(idc_value_t *argv, idc_value_t *r)
 Prototype of an external IDC function (implemented in C). More...
 
typedef qvector< extlang_t * > extlangs_t
 vector of external language descriptions
 
typedef qrefcnt_t< extlang_textlang_object_t
 

Enumerations

enum  syntax_highlight_style {
  HF_DEFAULT = 0, HF_KEYWORD1 = 1, HF_KEYWORD2 = 2, HF_KEYWORD3 = 3,
  HF_STRING = 4, HF_COMMENT = 5, HF_PREPROC = 6, HF_NUMBER = 7,
  HF_MAX
}
 Possible syntax element highlighting style names.
 
enum  find_extlang_kind_t { FIND_EXTLANG_BY_EXT, FIND_EXTLANG_BY_NAME, FIND_EXTLANG_BY_IDX }
 

Typedef Documentation

typedef error_t idaapi idc_func_t(idc_value_t *argv, idc_value_t *r)

Prototype of an external IDC function (implemented in C).

Parameters
argvvector of input arguments. IDA will convert all arguments to types specified by ext_idcfunc_t::args, except for VT_WILD
rreturn value of the function or exception
Returns
0 if ok, all other values indicate error. the error code must be set with set_qerrno():
  • eExecThrow - a new exception has been generated, see 'r'
  • other values - runtime error has occurred

Function Documentation

Convert IDC variable to a long (32/64bit) number.

Returns
v = 0 if impossible to convert to long

Convert IDC variable to a 64bit number.

Returns
v = 0 if impossible to convert to int64

Convert IDC variable to a long number.

Returns
  • v = 0 if IDC variable = "false" string
  • v = 1 if IDC variable = "true" string
  • v = number if IDC variable is number or string containing a number
  • eTypeConflict if IDC variable = empty string
idaman THREAD_SAFE error_t ida_export idcv_object ( idc_value_t v,
const idc_class_t *  icls = NULL 
)

Create an IDC object.

The original value of 'v' is discarded (freed).

Parameters
vvariable to hold the object. any previous value will be cleaned
iclsptr to the desired class. NULL means "object" class this ptr must be returned by add_idc_class() or find_idc_class()
Returns
always eOk
idaman THREAD_SAFE error_t ida_export move_idcv ( idc_value_t dst,
idc_value_t src 
)

Move 'src' to 'dst'.

This function is more effective than copy_idcv since it never copies big amounts of data.

idaman THREAD_SAFE error_t ida_export copy_idcv ( idc_value_t dst,
const idc_value_t src 
)

Copy 'src' to 'dst'.

For idc objects only a reference is copied.

idaman THREAD_SAFE error_t ida_export deep_copy_idcv ( idc_value_t dst,
const idc_value_t src 
)

Deep copy an IDC object.

This function performs deep copy of idc objects. If 'src' is not an object, copy_idcv() will be called

idaman THREAD_SAFE void ida_export free_idcv ( idc_value_t v)

Free storage used by VT_STR/VT_OBJ IDC variables.

After this call the variable has a numeric value 0

idaman THREAD_SAFE error_t ida_export get_idcv_class_name ( qstring out,
const idc_value_t obj 
)

Retrieves the IDC object class name.

Parameters
outqstring ptr for the class name. Can be NULL.
objclass instance variable
Returns
error code, eOk on success
idaman THREAD_SAFE error_t ida_export get_idcv_attr ( idc_value_t res,
const idc_value_t obj,
const char *  attr,
bool  may_use_getattr = false 
)

Get an object attribute.

Parameters
resbuffer for the attribute value
objvariable that holds an object reference. if obj is NULL it searches global variables, then user functions
attrattribute name
may_use_getattrmay call getattr functions to calculate the attribute if it does not exist
Returns
error code, eOk on success
idaman THREAD_SAFE error_t ida_export set_idcv_attr ( idc_value_t obj,
const char *  attr,
const idc_value_t value,
bool  may_use_setattr = false 
)

Set an object attribute.

Parameters
objvariable that holds an object reference. if obj is NULL then it tries to modify a global variable with the attribute name
attrattribute name
valuenew attribute value
may_use_setattrmay call setattr functions for the class
Returns
error code, eOk on success
idaman THREAD_SAFE error_t ida_export del_idcv_attr ( idc_value_t obj,
const char *  attr 
)

Delete an object attribute.

Parameters
objvariable that holds an object reference
attrattribute name
Returns
error code, eOk on success
idaman THREAD_SAFE error_t ida_export get_idcv_slice ( idc_value_t res,
const idc_value_t v,
uval_t  i1,
uval_t  i2,
int  flags = 0 
)

Get slice.

Parameters
resoutput variable that will contain the slice
vinput variable (string or object)
i1slice start index
i2slice end index (excluded)
flagsIDC variable slice flags or 0
Returns
eOk if success
idaman THREAD_SAFE error_t ida_export set_idcv_slice ( idc_value_t v,
uval_t  i1,
uval_t  i2,
const idc_value_t in,
int  flags = 0 
)

Set slice.

Parameters
vvariable to modify (string or object)
i1slice start index
i2slice end index (excluded)
innew value for the slice
flagsIDC variable slice flags or 0
Returns
eOk on success
idaman THREAD_SAFE idc_class_t* ida_export add_idc_class ( const char *  name,
const idc_class_t *  super = NULL 
)

Create a new IDC class.

Parameters
namename of the new class
superthe base class for the new class. if the new class is not based on any other class, pass NULL
Returns
pointer to the created class. If such a class already exists, a pointer to it will be returned. Pointers to other existing classes may be invalidated by this call.
idaman THREAD_SAFE idc_class_t* ida_export find_idc_class ( const char *  name)

Find an existing IDC class by its name.

Parameters
namename of the class
Returns
pointer to the class or NULL. The returned pointer is valid until a new call to add_idc_class()
idaman THREAD_SAFE bool ida_export set_idc_method ( idc_class_t *  icls,
const char *  fullfuncname 
)

Set an IDC class method.

Parameters
iclspointer to the class
fullfuncnamename of the function to call. use full method name: classname.funcname
Return values
truesuccess
falsethe function could not be found
idaman THREAD_SAFE const char* ida_export set_idc_dtor ( idc_class_t *  icls,
const char *  fullfuncname 
)

Set a destructor for an idc class.

The destructor is called before deleting any object of the specified class. Exceptions that escape the destructor are silently ignored, runtime errors too.

idaman THREAD_SAFE idc_value_t* ida_export deref_idcv ( idc_value_t v,
int  vref_flags 
)

Dereference a VT_REF variable.

Parameters
vvariable to dereference
vref_flagsDereference IDC variable flags
Returns
pointer to the dereference result or NULL. If returns NULL, qerrno is set to eExecBadRef "Illegal variable reference"
idaman THREAD_SAFE bool ida_export create_idcv_ref ( idc_value_t ref,
const idc_value_t v 
)

Create a variable reference.

Currently only references to global variables can be created.

Parameters
refptr to the result
vvariable to reference
Returns
success
idaman THREAD_SAFE idc_value_t* ida_export add_idc_gvar ( const char *  name)

Add global IDC variable.

Parameters
namename of the global variable
Returns
pointer to the created variable or existing variable. NB: the returned pointer is valid until a new global var is added.
idaman THREAD_SAFE idc_value_t* ida_export find_idc_gvar ( const char *  name)

Find an existing global IDC variable by its name.

Parameters
namename of the global variable
Returns
pointer to the variable or NULL. NB: the returned pointer is valid until a new global var is added. FIXME: it is difficult to use this function in a thread safe manner
idaman THREAD_SAFE bool ida_export add_idc_func ( const ext_idcfunc_t func)

Add an IDC function.

This function does not modify the predefined kernel functions. Example:

1 static error_t idaapi myfunc5(idc_value_t *argv, idc_value_t *res)
2 {
3  msg("myfunc is called with arg0=%a and arg1=%s\n", argv[0].num, argv[1].str);
4  res->num = 5; // let's return 5
5  return eOk;
6 }
7 static const char myfunc5_args[] = { VT_LONG, VT_STR, 0 };
8 static const ext_idcfunc_t myfunc_desc = { "MyFunc5", myfunc5, myfunc5_args, NULL, 0, EXTFUN_BASE };
9 
10 // after this:
11 add_idc_func(myfunc_desc);
12 
13 // there is a new IDC function which can be called like this:
14 MyFunc5(0x123, "test");
Parameters
funcfunction description block.
Note
If the function already exists, it will be replaced by the new function
Returns
success
idaman ssize_t ida_export install_extlang ( extlang_t el)

Install an external language interpreter.

Any previously registered interpreter will be automatically unregistered. The installed extlang can be used in select_extlang().

Parameters
eldescription of the new language. must point to static storage.
Returns
extlang id; -1 means failure and will happen if the extlang has already been installed
idaman bool ida_export remove_extlang ( extlang_t el)

Uninstall an external language interpreter.

Returns
success
idaman bool ida_export select_extlang ( extlang_t el)

Selects the external language interpreter.

The specified extlang must be registered before selecting it. It will be used to evaluate expressions entered in dialog boxes. It will also replace the eval_expr() and eval_expr_long() functions.

Returns
success
idaman THREAD_SAFE bool ida_export set_header_path ( const char *  path,
bool  add 
)

Set or append a header path.

IDA looks for the include files in the appended header paths, then in the ida executable directory.

Parameters
pathlist of directories to add (separated by ';') may be NULL, in this case nothing is added
addtrue: append. false: remove old paths.
Return values
truesuccess
falseno memory
idaman THREAD_SAFE char* ida_export get_idc_filename ( char *  buf,
size_t  bufsize,
const char *  file 
)

Get full name of IDC file name.

Search for file in list of include directories, IDCPATH directory and the current directory.

Parameters
bufbuffer for the answer
bufsizesize of buffer
filefile name without full path
Returns
NULL is file not found. otherwise returns pointer to buf
idaman THREAD_SAFE bool ida_export exec_system_script ( const char *  file,
bool  complain_if_no_file = true 
)

Compile and execute "main" function from system file.

Parameters
filefile name with IDC function(s). The file will be searched in the idc subdir of ida
complain_if_no_file
  • 1: display warning if the file is not found
  • 0: don't complain if file doesn't exist
Return values
1ok, file is compiled and executed
0failure, compilation or execution error, warning is displayed
idaman bool ida_export eval_expr_long ( sval_t res,
ea_t  where,
const char *  line,
qstring errbuf = NULL 
)

Compile and calculate an expression.

Parameters
respointer to result. The result will be converted to 32/64bit number. Use eval_expr() if you need the result of another type.
wherethe current linear address in the addressing space of the program being disassembled. it will be used to resolve names of local variables, etc. if not applicable, then should be BADADDR
linea text line with IDC expression
[out]errbufbuffer for the error message
Return values
trueok
falseerror, see errbuf
idaman bool ida_export eval_expr ( idc_value_t rv,
ea_t  where,
const char *  line,
qstring errbuf = NULL 
)

Compile and calculate an expression.

Parameters
rvpointer to the result
wherethe current linear address in the addressing space of the program being disassembled. If will be used to resolve names of local variables etc. if not applicable, then should be BADADDR.
linethe expression to evaluate
[out]errbufbuffer for the error message
Return values
trueok
falseerror, see errbuf
idaman bool ida_export eval_idc_expr ( idc_value_t rv,
ea_t  where,
const char *  buf,
qstring errbuf = NULL 
)

Same as eval_expr(), but will always use the IDC interpreter regardless of the currently installed extlang.

idaman bool ida_export compile_idc_snippet ( const char *  func,
const char *  text,
qstring errbuf = NULL,
idc_resolver_t resolver = NULL,
bool  only_safe_funcs = false 
)

Compile text with IDC statements.

Parameters
funcname of the function to create out of the snippet
texttext to compile
[out]errbufbuffer for the error message
resolvercallback object to get values of undefined variables This object will be called if IDC function contains references to undefined variables. May be NULL.
only_safe_funcsif true, any calls to functions without EXTFUN_SAFE flag will lead to a compilation error.
Return values
trueok
falseerror, see errbuf
idaman bool ida_export call_idc_func ( idc_value_t result,
const char *  fname,
const idc_value_t  args[],
size_t  argsnum,
qstring errbuf = NULL,
idc_resolver_t resolver = NULL 
)

Execute an IDC function.

Parameters
[out]resultpointer to idc_value_t to hold the return value of the function. If execution fails, this variable will contain the exception information. Can be NULL if return value is not required.
fnamefunction name. User-defined functions, built-in functions, and plugin-defined functions are accepted.
argsarray of parameters
argsnumnumber of parameters to pass to 'fname'. This number should be equal to number of parameters the function expects.
[out]errbufbuffer for the error message
resolvercallback object to get values of undefined variables This object will be called if IDC function contains references to undefined variables. May be NULL.
Return values
trueok
falseerror, see errbuf
THREAD_SAFE bool exec_idc_script ( idc_value_t result,
const char *  path,
const char *  func,
const idc_value_t  args[],
size_t  argsnum,
qstring errbuf = NULL 
)
inline

Compile and execute IDC function(s) from file.

Parameters
resultptr to idc_value_t to hold result of the function. If execution fails, this variable will contain the exception information. You may pass NULL if you are not interested in the returned value.
pathtext file containing text of IDC functions
funcfunction name to execute
argsarray of parameters
argsnumnumber of parameters to pass to 'fname' This number should be equal to number of parameters the function expects.
[out]errbufbuffer for the error message
Return values
trueok
falseerror, see errbuf
idaman bool ida_export eval_idc_snippet ( idc_value_t result,
const char *  line,
qstring errbuf = NULL,
idc_resolver_t resolver = NULL 
)

Compile and execute IDC statements or expressions.

Parameters
resultptr to idc_value_t to hold result of the function. If execution fails, this variable will contain the exception information. You may pass NULL if you are not interested in the returned value.
linebody of IDC the function
[out]errbufbuffer for the error message
resolvercallback object to get values of undefined variables This object will be called if IDC function contains references to undefined variables. May be NULL.
Returns
success
Note
see also eval_idc_expr()
idaman void ida_export setup_lowcnd_regfuncs ( idc_func_t getreg,
idc_func_t setreg 
)

Setup lowcnd callbacks to read/write registers.

These callbacks will be used by the idc engine to read/write registers while calculating low level breakpoint conditions for local debuggers.

bool get_idptype_and_data ( int *  vtype,
const void **  vdata,
const idc_value_t v 
)
inline

Extract type & data from the idc_value_t instance that was passed to parse_config_value().

Parameters
vtypepointer to storage that will hold the type (IDPOPT_T)
vdatapointer to storage that contains the value (see IDPOPT_T for what type of data is pointed to.)
vthe value holder
Returns
true in case of success, false if 'v' is of unexpected type