IDAPython 9.0
|
Functions that deal with cross-references. There are 2 types of xrefs: CODE and DATA references. All xrefs are kept in the bTree except ordinary execution flow to the next instruction. Ordinary execution flow to the next instruction is kept in flags (see bytes.hpp) The source address of a cross-reference must be an item head (is_head) or a structure member id. Cross-references are automatically sorted.
Classes | |
class | cases_and_targets_t |
class | casevec_t |
class | xrefblk_t |
Variables | |
fl_U = _ida_xref.fl_U | |
fl_CF = _ida_xref.fl_CF | |
fl_CN = _ida_xref.fl_CN | |
fl_JF = _ida_xref.fl_JF | |
fl_JN = _ida_xref.fl_JN | |
fl_USobsolete = _ida_xref.fl_USobsolete | |
fl_F = _ida_xref.fl_F | |
dr_U = _ida_xref.dr_U | |
dr_O = _ida_xref.dr_O | |
dr_W = _ida_xref.dr_W | |
dr_R = _ida_xref.dr_R | |
dr_T = _ida_xref.dr_T | |
dr_I = _ida_xref.dr_I | |
dr_S = _ida_xref.dr_S | |
XREF_USER = _ida_xref.XREF_USER | |
XREF_TAIL = _ida_xref.XREF_TAIL | |
XREF_BASE = _ida_xref.XREF_BASE | |
XREF_MASK = _ida_xref.XREF_MASK | |
XREF_PASTEND = _ida_xref.XREF_PASTEND | |
XREF_FLOW = _ida_xref.XREF_FLOW | |
XREF_NOFLOW = _ida_xref.XREF_NOFLOW | |
XREF_DATA = _ida_xref.XREF_DATA | |
XREF_CODE = _ida_xref.XREF_CODE | |
XREF_EA = _ida_xref.XREF_EA | |
XREF_TID = _ida_xref.XREF_TID | |
XREF_ALL = _ida_xref.XREF_ALL | |
XREF_FAR = _ida_xref.XREF_FAR | |
bool add_cref | ( | ida_idaapi.ea_t | frm, |
ida_idaapi.ea_t | to, | ||
'cref_t' | type ) |
Create a code cross-reference. @param to: linear address of referenced instruction @param type: cross-reference type @returns success
bool add_dref | ( | ida_idaapi.ea_t | frm, |
ida_idaapi.ea_t | to, | ||
'dref_t' | type ) |
Create a data cross-reference. @param to: linear address of referenced data @param type: cross-reference type @returns success (may fail if user-defined xref exists from->to)
calc_switch_cases | ( | ea, | |
si ) |
Get information about a switch's cases. The returned information can be used as follows: for idx in range(len(results.cases)): cur_case = results.cases[idx] for cidx in range(len(cur_case)): print("case: %d" % cur_case[cidx]) print(" goto 0x%x" % results.targets[idx]) @param ea: address of the 'indirect jump' instruction @param si: switch information @return: a structure with 2 members: 'cases', and 'targets'.
create_switch_table | ( | ea, | |
si ) |
Create switch table from the switch information @param ea: address of the 'indirect jump' instruction @param si: switch information @return: Boolean
create_switch_xrefs | ( | ea, | |
si ) |
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. @param ea: address of the 'indirect jump' instruction @param si: switch information @return: Boolean
bool del_cref | ( | ida_idaapi.ea_t | frm, |
ida_idaapi.ea_t | to, | ||
bool | expand ) |
Delete a code cross-reference. @param to: linear address of referenced instruction @param expand: policy to delete the referenced instruction * 1: plan to delete the referenced instruction if it has no more references. * 0: don't delete the referenced instruction even if no more cross-references point to it @retval true: if the referenced instruction will be deleted
None del_dref | ( | ida_idaapi.ea_t | frm, |
ida_idaapi.ea_t | to ) |
Delete a data cross-reference. @param to: linear address of referenced data
None delete_switch_table | ( | ida_idaapi.ea_t | jump_ea, |
'switch_info_t' | si ) |
ida_idaapi.ea_t get_first_cref_from | ( | ida_idaapi.ea_t | frm | ) |
Get first instruction referenced from the specified instruction. If the specified instruction passes execution to the next instruction then the next instruction is returned. Otherwise the lowest referenced address is returned (remember that xrefs are kept sorted!). @returns first referenced address. If the specified instruction doesn't reference to other instructions then returns BADADDR.
ida_idaapi.ea_t get_first_cref_to | ( | ida_idaapi.ea_t | to | ) |
Get first instruction referencing to the specified instruction. If the specified instruction may be executed immediately after its previous instruction then the previous instruction is returned. Otherwise the lowest referencing address is returned. (remember that xrefs are kept sorted!). @param to: linear address of referenced instruction @returns linear address of the first referencing instruction or BADADDR.
ida_idaapi.ea_t get_first_dref_from | ( | ida_idaapi.ea_t | frm | ) |
Get first data referenced from the specified address. @returns linear address of first (lowest) data referenced from the specified address. Return BADADDR if the specified instruction/data doesn't reference to anything.
ida_idaapi.ea_t get_first_dref_to | ( | ida_idaapi.ea_t | to | ) |
Get address of instruction/data referencing to the specified data. @param to: linear address of referencing instruction or data @returns BADADDR if nobody refers to the specified data.
ida_idaapi.ea_t get_first_fcref_from | ( | ida_idaapi.ea_t | frm | ) |
ida_idaapi.ea_t get_first_fcref_to | ( | ida_idaapi.ea_t | to | ) |
ida_idaapi.ea_t get_next_cref_from | ( | ida_idaapi.ea_t | frm, |
ida_idaapi.ea_t | current ) |
Get next instruction referenced from the specified instruction. @param current: linear address of current referenced instruction This value is returned by get_first_cref_from() or previous call to get_next_cref_from() functions. @returns next referenced address or BADADDR.
ida_idaapi.ea_t get_next_cref_to | ( | ida_idaapi.ea_t | to, |
ida_idaapi.ea_t | current ) |
Get next instruction referencing to the specified instruction. @param to: linear address of referenced instruction @param current: linear address of current referenced instruction This value is returned by get_first_cref_to() or previous call to get_next_cref_to() functions. @returns linear address of the next referencing instruction or BADADDR.
ida_idaapi.ea_t get_next_dref_from | ( | ida_idaapi.ea_t | frm, |
ida_idaapi.ea_t | current ) |
Get next data referenced from the specified address. @param current: linear address of current referenced data. This value is returned by get_first_dref_from() or previous call to get_next_dref_from() functions. @returns linear address of next data or BADADDR.
ida_idaapi.ea_t get_next_dref_to | ( | ida_idaapi.ea_t | to, |
ida_idaapi.ea_t | current ) |
Get address of instruction/data referencing to the specified data @param to: linear address of referencing instruction or data @param current: current linear address. This value is returned by get_first_dref_to() or previous call to get_next_dref_to() functions. @returns BADADDR if nobody refers to the specified data.
ida_idaapi.ea_t get_next_fcref_from | ( | ida_idaapi.ea_t | frm, |
ida_idaapi.ea_t | current ) |
ida_idaapi.ea_t get_next_fcref_to | ( | ida_idaapi.ea_t | to, |
ida_idaapi.ea_t | current ) |
bool has_external_refs | ( | 'func_t *' | pfn, |
ida_idaapi.ea_t | ea ) |
Does 'ea' have references from outside of 'pfn'?
bool has_jump_or_flow_xref | ( | ida_idaapi.ea_t | ea | ) |
Are there jump or flow references to EA?
'char' xrefchar | ( | 'char' | xrtype | ) |
Get character describing the xref type. @param xrtype: combination of Cross-Reference type flags and a cref_t of dref_t value
dr_I = _ida_xref.dr_I |
dr_O = _ida_xref.dr_O |
dr_R = _ida_xref.dr_R |
dr_S = _ida_xref.dr_S |
dr_T = _ida_xref.dr_T |
dr_U = _ida_xref.dr_U |
dr_W = _ida_xref.dr_W |
fl_CF = _ida_xref.fl_CF |
fl_CN = _ida_xref.fl_CN |
fl_F = _ida_xref.fl_F |
fl_JF = _ida_xref.fl_JF |
fl_JN = _ida_xref.fl_JN |
fl_U = _ida_xref.fl_U |
fl_USobsolete = _ida_xref.fl_USobsolete |
XREF_ALL = _ida_xref.XREF_ALL |
XREF_BASE = _ida_xref.XREF_BASE |
XREF_CODE = _ida_xref.XREF_CODE |
XREF_DATA = _ida_xref.XREF_DATA |
XREF_EA = _ida_xref.XREF_EA |
XREF_FAR = _ida_xref.XREF_FAR |
XREF_FLOW = _ida_xref.XREF_FLOW |
XREF_MASK = _ida_xref.XREF_MASK |
XREF_NOFLOW = _ida_xref.XREF_NOFLOW |
XREF_PASTEND = _ida_xref.XREF_PASTEND |
XREF_TAIL = _ida_xref.XREF_TAIL |
XREF_TID = _ida_xref.XREF_TID |
XREF_USER = _ida_xref.XREF_USER |