IDAPython 8.4
|
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 |
Proxy of C++ cases_and_targets_t class. More... | |
class | casevec_t |
Proxy of C++ qvector< qvector< sval_t > > class. More... | |
class | xrefblk_t |
Proxy of C++ xrefblk_t class. More... | |
Functions | |
"bool" | create_switch_xrefs (*args) |
create_switch_xrefs(ea, si) -> bool This function creates xrefs from the indirect jump. | |
"cases_and_targets_t *" | calc_switch_cases (*args) |
calc_switch_cases(ea, si) -> cases_and_targets_t Get information about a switch's cases. | |
"bool" | create_switch_table (*args) |
create_switch_table(ea, si) -> bool Create switch table from the switch information | |
"char" | xrefchar (*args) |
xrefchar(xrtype) -> char Get character describing the xref type. | |
"bool" | add_cref (*args) |
add_cref(frm, to, type) -> bool Create a code cross-reference. | |
"bool" | del_cref (*args) |
del_cref(frm, to, expand) -> bool Delete a code cross-reference. | |
"bool" | add_dref (*args) |
add_dref(frm, to, type) -> bool Create a data cross-reference. | |
"void" | del_dref (*args) |
del_dref(frm, to) Delete a data cross-reference. | |
"ea_t" | get_first_dref_from (*args) |
get_first_dref_from(frm) -> ea_t Get first data referenced from the specified address. | |
"ea_t" | get_next_dref_from (*args) |
get_next_dref_from(frm, current) -> ea_t Get next data referenced from the specified address. | |
"ea_t" | get_first_dref_to (*args) |
get_first_dref_to(to) -> ea_t Get address of instruction/data referencing to the specified data. | |
"ea_t" | get_next_dref_to (*args) |
get_next_dref_to(to, current) -> ea_t Get address of instruction/data referencing to the specified data | |
"ea_t" | get_first_cref_from (*args) |
get_first_cref_from(frm) -> ea_t Get first instruction referenced from the specified instruction. | |
"ea_t" | get_next_cref_from (*args) |
get_next_cref_from(frm, current) -> ea_t Get next instruction referenced from the specified instruction. | |
"ea_t" | get_first_cref_to (*args) |
get_first_cref_to(to) -> ea_t Get first instruction referencing to the specified instruction. | |
"ea_t" | get_next_cref_to (*args) |
get_next_cref_to(to, current) -> ea_t Get next instruction referencing to the specified instruction. | |
"ea_t" | get_first_fcref_from (*args) |
get_first_fcref_from(frm) -> ea_t | |
"ea_t" | get_next_fcref_from (*args) |
get_next_fcref_from(frm, current) -> ea_t | |
"ea_t" | get_first_fcref_to (*args) |
get_first_fcref_to(to) -> ea_t | |
"ea_t" | get_next_fcref_to (*args) |
get_next_fcref_to(to, current) -> ea_t | |
"bool" | has_external_refs (*args) |
has_external_refs(pfn, ea) -> bool Does 'ea' have references from outside of 'pfn'? | |
"void" | delete_switch_table (*args) |
delete_switch_table(jump_ea, si) | |
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_ALL = _ida_xref.XREF_ALL | |
XREF_FAR = _ida_xref.XREF_FAR | |
XREF_DATA = _ida_xref.XREF_DATA | |
"bool" add_cref | ( | * | args | ) |
from | (C++: ea_t) linear address of referencing instruction |
to | (C++: ea_t) linear address of referenced instruction |
type | (C++: cref_t) cross-reference type |
"bool" add_dref | ( | * | args | ) |
from | (C++: ea_t) linear address of referencing instruction or data |
to | (C++: ea_t) linear address of referenced data |
type | (C++: dref_t) cross-reference type |
"cases_and_targets_t *" calc_switch_cases | ( | * | args | ) |
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])
ea | address of the 'indirect jump' instruction |
si | switch information |
"bool" create_switch_table | ( | * | args | ) |
ea | address of the 'indirect jump' instruction |
si | switch information |
"bool" create_switch_xrefs | ( | * | args | ) |
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.
ea | address of the 'indirect jump' instruction |
si | switch information |
"bool" del_cref | ( | * | args | ) |
from | (C++: ea_t) linear address of referencing instruction |
to | (C++: ea_t) linear address of referenced instruction |
expand | (C++: bool) policy to delete the referenced instruction
|
true | if the referenced instruction will be deleted |
"void" del_dref | ( | * | args | ) |
from | (C++: ea_t) linear address of referencing instruction or data |
to | (C++: ea_t) linear address of referenced data |
"void" delete_switch_table | ( | * | args | ) |
jump_ea | ea_t |
si | switch_info_t const & |
"ea_t" get_first_cref_from | ( | * | args | ) |
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!).
from | (C++: ea_t) linear address of referencing instruction |
"ea_t" get_first_cref_to | ( | * | args | ) |
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!).
to | (C++: ea_t) linear address of referenced instruction |
"ea_t" get_first_dref_from | ( | * | args | ) |
from | (C++: ea_t) linear address of referencing instruction or data |
"ea_t" get_first_dref_to | ( | * | args | ) |
to | (C++: ea_t) linear address of referencing instruction or data |
"ea_t" get_first_fcref_from | ( | * | args | ) |
from | ea_t |
"ea_t" get_first_fcref_to | ( | * | args | ) |
to | ea_t |
"ea_t" get_next_cref_from | ( | * | args | ) |
from | (C++: ea_t) linear address of referencing instruction |
current | (C++: ea_t) linear address of current referenced instruction This value is returned by get_first_cref_from() or previous call to get_next_cref_from() functions. |
"ea_t" get_next_cref_to | ( | * | args | ) |
to | (C++: ea_t) linear address of referenced instruction |
current | (C++: ea_t) linear address of current referenced instruction This value is returned by get_first_cref_to() or previous call to get_next_cref_to() functions. |
"ea_t" get_next_dref_from | ( | * | args | ) |
from | (C++: ea_t) linear address of referencing instruction or data |
current | (C++: ea_t) linear address of current referenced data. This value is returned by get_first_dref_from() or previous call to get_next_dref_from() functions. |
"ea_t" get_next_dref_to | ( | * | args | ) |
to | (C++: ea_t) linear address of referencing instruction or data |
current | (C++: ea_t) current linear address. This value is returned by get_first_dref_to() or previous call to get_next_dref_to() functions. |
"ea_t" get_next_fcref_from | ( | * | args | ) |
from | ea_t |
current | ea_t |
"ea_t" get_next_fcref_to | ( | * | args | ) |
to | ea_t |
current | ea_t |
"bool" has_external_refs | ( | * | args | ) |
pfn | (C++: func_t *) |
ea | (C++: ea_t) |
"char" xrefchar | ( | * | args | ) |
xrtype | (C++: char) 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_DATA = _ida_xref.XREF_DATA |
XREF_FAR = _ida_xref.XREF_FAR |
XREF_MASK = _ida_xref.XREF_MASK |
XREF_PASTEND = _ida_xref.XREF_PASTEND |
XREF_TAIL = _ida_xref.XREF_TAIL |
XREF_USER = _ida_xref.XREF_USER |