Module ida_xref
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.
Global Variables
XREF_ALL
XREF_BASE
XREF_DATA
XREF_FAR
XREF_MASK
XREF_PASTEND
XREF_TAIL
XREF_USER
dr_I
dr_O
dr_R
dr_S
dr_T
dr_U
dr_W
fl_CF
fl_CN
fl_F
fl_JF
fl_JN
fl_U
fl_USobsolete
Functions
add_cref(frm: ea_t, to: ea_t, type: cref_t) ‑> bool
add_cref(frm, to, type) -> bool Create a code cross-reference.
add_dref(frm: ea_t, to: ea_t, type: dref_t) ‑> bool
add_dref(frm, to, type) -> bool Create a data cross-reference.
calc_switch_cases(ea: ea_t, si: switch_info_t) ‑> cases_and_targets_t *
calc_switch_cases(ea, si) -> cases_and_targets_t Get information about a switch's cases.
The returned information can be used as follows:
create_switch_table(ea: ea_t, si: switch_info_t) ‑> bool
create_switch_table(ea, si) -> bool Create switch table from the switch information
create_switch_xrefs(ea: ea_t, si: switch_info_t) ‑> bool
create_switch_xrefs(ea, si) -> bool 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.
del_cref(frm: ea_t, to: ea_t, expand: bool) ‑> bool
del_cref(frm, to, expand) -> bool Delete a code cross-reference.
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
del_dref(frm: ea_t, to: ea_t) ‑> void
del_dref(frm, to) Delete a data cross-reference.
delete_switch_table(jump_ea: ea_t, si: switch_info_t) ‑> void
delete_switch_table(jump_ea, si)
get_first_cref_from(frm: ea_t) ‑> ea_t
get_first_cref_from(frm) -> ea_t 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!).
get_first_cref_to(to: ea_t) ‑> ea_t
get_first_cref_to(to) -> ea_t 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!).
get_first_dref_from(frm: ea_t) ‑> ea_t
get_first_dref_from(frm) -> ea_t Get first data referenced from the specified address.
get_first_dref_to(to: ea_t) ‑> ea_t
get_first_dref_to(to) -> ea_t Get address of instruction/data referencing to the specified data.
get_first_fcref_from(frm: ea_t) ‑> ea_t
get_first_fcref_from(frm) -> ea_t
get_first_fcref_to(to: ea_t) ‑> ea_t
get_first_fcref_to(to) -> ea_t
get_next_cref_from(frm: ea_t, current: ea_t) ‑> ea_t
get_next_cref_from(frm, current) -> ea_t Get next instruction referenced from the specified instruction.
get_next_cref_to(to: ea_t, current: ea_t) ‑> ea_t
get_next_cref_to(to, current) -> ea_t Get next instruction referencing to the specified instruction.
get_next_dref_from(frm: ea_t, current: ea_t) ‑> ea_t
get_next_dref_from(frm, current) -> ea_t Get next data referenced from the specified address.
get_next_dref_to(to: ea_t, current: ea_t) ‑> ea_t
get_next_dref_to(to, current) -> ea_t Get address of instruction/data referencing to the specified data
get_next_fcref_from(frm: ea_t, current: ea_t) ‑> ea_t
get_next_fcref_from(frm, current) -> ea_t
get_next_fcref_to(to: ea_t, current: ea_t) ‑> ea_t
get_next_fcref_to(to, current) -> ea_t
has_external_refs(pfn: func_t *, ea: ea_t) ‑> bool
has_external_refs(pfn, ea) -> bool Does 'ea' have references from outside of 'pfn'?
has_jump_or_flow_xref(ea: ea_t) ‑> bool
has_jump_or_flow_xref(ea) -> bool Are there jump or flow references to EA?
xrefchar(xrtype: char) ‑> char
xrefchar(xrtype) -> char Get character describing the xref type.
Classes
cases_and_targets_t()
: Proxy of C++ cases_and_targets_t class.
Instance variables
cases: casevec_t
cases
targets: eavec_t
targets
casevec_t(*args)
: Proxy of C++ qvector< qvector< sval_t > > class.
Methods
add_unique(self, x: qvector< long long > const &) ‑> bool add_unique(self, x) -> bool
x: qvector< long long > const &
append(self, *args) ‑> qvector< long long > & push_back(self, x)
x: qvector< long long > const &
push_back(self) -> qvector< long long > &
at(self, i: size_t) ‑> qvector< long long > const & getitem(self, i) -> qvector< long long > const &
i: size_t
back(self)
begin(self, *args) ‑> qvector< qvector< long long > >::const_iterator begin(self) -> qvector< qvector< long long > >::iterator begin(self) -> qvector< qvector< long long > >::const_iterator
capacity(self) ‑> size_t capacity(self) -> size_t
clear(self) ‑> void clear(self)
empty(self) ‑> bool empty(self) -> bool
end(self, *args) ‑> qvector< qvector< long long > >::const_iterator end(self) -> qvector< qvector< long long > >::iterator end(self) -> qvector< qvector< long long > >::const_iterator
erase(self, *args) ‑> qvector< qvector< long long > >::iterator erase(self, it) -> qvector< qvector< long long > >::iterator
it: qvector< qvector< long long > >::iterator
erase(self, first, last) -> qvector< qvector< long long > >::iterator
first: qvector< qvector< long long > >::iterator last: qvector< qvector< long long > >::iterator
extract(self) ‑> qvector< long long > * extract(self) -> qvector< long long > *
find(self, *args) ‑> qvector< qvector< long long > >::const_iterator find(self, x) -> qvector< qvector< long long > >::iterator
x: qvector< long long > const &
find(self, x) -> qvector< qvector< long long > >::const_iterator
x: qvector< long long > const &
front(self)
grow(self, *args) ‑> void grow(self, x=qvector< long long >())
x: qvector< long long > const &
has(self, x: qvector< long long > const &) ‑> bool has(self, x) -> bool
x: qvector< long long > const &
inject(self, s: qvector< long long > *, len: size_t) ‑> void inject(self, s, len)
s: qvector< long long > * len: size_t
insert(self, it: qvector< qvector< long long > >::iterator, x: qvector< long long > const &) ‑> qvector< qvector< long long > >::iterator insert(self, it, x) -> qvector< qvector< long long > >::iterator
it: qvector< qvector< long long > >::iterator x: qvector< long long > const &
pop_back(self) ‑> void pop_back(self)
push_back(self, *args) ‑> qvector< long long > & push_back(self, x)
x: qvector< long long > const &
push_back(self) -> qvector< long long > &
qclear(self) ‑> void qclear(self)
reserve(self, cnt: size_t) ‑> void reserve(self, cnt)
cnt: size_t
resize(self, *args) ‑> void resize(self, _newsize, x)
_newsize: size_t x: qvector< long long > const &
resize(self, _newsize)
_newsize: size_t
size(self) ‑> size_t size(self) -> size_t
swap(self, r: casevec_t) ‑> void swap(self, r)
r: qvector< qvector< long long > > &
truncate(self) ‑> void truncate(self)
xrefblk_t()
: Proxy of C++ xrefblk_t class.
Instance variables
frm: ea_t
frm
iscode: uchar
iscode
to: ea_t
to
type: uchar
type
user: uchar
user
Methods
crefs_from(self, ea) Provide an iterator on code references from ea including flow references
crefs_to(self, ea) Provide an iterator on code references to ea including flow references
drefs_from(self, ea) Provide an iterator on data references from ea
drefs_to(self, ea) Provide an iterator on data references to ea
fcrefs_from(self, ea) Provide an iterator on code references from ea
fcrefs_to(self, ea) Provide an iterator on code references to ea
first_from(self, _from: ea_t, flags: int) ‑> bool first_from(self, _from, flags) -> bool Get first xref from the given address (store in to)
_from: (C++: ea_t) flags: (C++: int)
first_to(self, _to: ea_t, flags: int) ‑> bool first_to(self, _to, flags) -> bool Get xref to given address (store in from)
_to: (C++: ea_t) flags: (C++: int)
next_from(self, *args) ‑> bool next_from(self) -> bool Get xref from '_from' that comes after '_to'. next_from(self, _from, _to, flags) -> bool
_from: ea_t _to: ea_t flags: int
next_to(self, *args) ‑> bool next_to(self) -> bool Get xref to '_to' that comes after '_from'. next_to(self, _from, _to, flags) -> bool
_from: ea_t _to: ea_t flags: int
refs_from(self, ea, flag) Provide an iterator on from reference represented by flag
refs_to(self, ea, flag) Provide an iterator on to reference represented by flag
Last updated