Module ida_xref
[frames] | no frames]

Module ida_xref

IDA Plugin SDK API wrapper: xref

Classes
  cases_and_targets_t
Proxy of C++ cases_and_targets_t class
  xrefblk_t
Proxy of C++ xrefblk_t class
  casevec_t
Proxy of C++ qvector<(qvector<(sval_t)>)> class
Functions
bool
create_switch_xrefs(insn_ea, py_swi)
This function creates xrefs from the indirect jump.
cases_and_targets_t
calc_switch_cases(insn_ea, py_swi)
Get information about a switch's cases.
bool
create_switch_table(insn_ea, py_swi)
Create switch table from the switch information
char
xrefchar(xrtype)
bool
add_cref(frm, to, type)
int
del_cref(frm, to, expand)
bool
add_dref(frm, to, type)
 
del_dref(frm, to)
ea_t
get_first_dref_from(frm)
ea_t
get_next_dref_from(frm, current)
ea_t
get_first_dref_to(to)
ea_t
get_next_dref_to(to, current)
ea_t
get_first_cref_from(frm)
ea_t
get_next_cref_from(frm, current)
ea_t
get_first_cref_to(to)
ea_t
get_next_cref_to(to, current)
ea_t
get_first_fcref_from(frm)
ea_t
get_next_fcref_from(frm, current)
ea_t
get_first_fcref_to(to)
ea_t
get_next_fcref_to(to, current)
bool
has_external_refs(pfn, ea)
Variables
  fl_U = 0
  fl_CF = 16
  fl_CN = 17
  fl_JF = 18
  fl_JN = 19
  fl_USobsolete = 20
  fl_F = 21
  dr_U = 0
  dr_O = 1
  dr_W = 2
  dr_R = 3
  dr_T = 4
  dr_I = 5
  XREF_USER = 32
  XREF_TAIL = 64
  XREF_BASE = 128
  XREF_MASK = 31
  XREF_PASTEND = 256
  XREF_ALL = 0
  XREF_FAR = 1
  XREF_DATA = 2
  __package__ = None
Function Details

create_switch_xrefs(insn_ea, py_swi)

 

This function creates xrefs from the indirect jump.

Usually there is no need to call this function directly because the kernel will call it for switch tables

Note: Custom switch information are not supported yet.

Parameters:
  • insn_ea - address of the 'indirect jump' instruction
  • si - switch information
Returns: bool
Boolean

calc_switch_cases(insn_ea, py_swi)

 
Get information about a switch's cases.

The returned information can be used as follows:

    for idx in xrange(len(results.cases)):
        cur_case = results.cases[idx]
        for cidx in xrange(len(cur_case)):
            print "case: %d" % cur_case[cidx]
        print "  goto 0x%x" % results.targets[idx]

@param insn_ea: address of the 'indirect jump' instruction
@param si: switch information

@return: a structure with 2 members: 'cases', and 'targets'.

Returns: cases_and_targets_t

create_switch_table(insn_ea, py_swi)

 

Create switch table from the switch information

Parameters:
  • insn_ea - address of the 'indirect jump' instruction
  • si - switch information
Returns: bool
Boolean