IDA C++ SDK 9.2
Loading...
Searching...
No Matches
xrefblk_t Struct Reference

Structure to enumerate all xrefs. More...

#include <xref.hpp>

Public Member Functions

Get first/next

The following functions first return code references, then data references.

If you need only code references, you need to check 'iscode' after each call. If you need only data references, use #XREF_DATA bit.

Parameters
flagsXref enumeration flags
Return values
1ok
0no more xrefs
bool first_from (ea_t _from, int flags=XREF_FLOW)
 Get first xref from the given address (store in to)
bool next_from ()
 Get next xref from address provided to first_from()
bool first_to (ea_t _to, int flags=XREF_FLOW)
 Get xref to given address (store in from)
bool next_to ()
 Get next xref to address provided to first_to()
bool next_from (ea_t _from, ea_t _to, int flags)
 Get xref from '_from' that comes after '_to'.
bool next_to (ea_t _from, ea_t _to, int flags)
 Get xref to '_to' that comes after '_from'.

Public Attributes

ea_t from
 the referencing address - filled by first_to(),next_to()
ea_t to
 the referenced address - filled by first_from(), next_from()
bool iscode
 is code reference (cref_t)?
uchar type
 type of the last returned reference (cref_t & dref_t)
bool user
 is user defined xref? otherwise defined by ida
uchar _flags

Detailed Description

Structure to enumerate all xrefs.

This structure provides a way to access cross-references from a given address. For example:

for ( bool ok=xb.first_from(ea, XREF_FLOW); ok; ok=xb.next_from() )
{
// xb.to - contains the referenced address
}
bool ok
Definition kernwin.hpp:7006
Structure to enumerate all xrefs.
Definition xref.hpp:196
bool next_from()
Get next xref from address provided to first_from()
Definition xref.hpp:233
bool first_from(ea_t _from, int flags=XREF_FLOW)
Get first xref from the given address (store in to)
Definition xref.hpp:229

or:

for ( bool ok=xb.first_to(ea, XREF_FLOW); ok; ok=xb.next_to() )
{
// xb.from - contains the referencing address
}
bool first_to(ea_t _to, int flags=XREF_FLOW)
Get xref to given address (store in from)
Definition xref.hpp:237
bool next_to()
Get next xref to address provided to first_to()
Definition xref.hpp:241

First, all code references will be returned, then all data references. If you need only code references, stop calling next() as soon as you get a dref.

If you need only data references, pass #XREF_DATA flag to first(). You may not modify the contents of a xrefblk_t structure! It is read only.

Member Function Documentation

◆ first_from()

bool xrefblk_t::first_from ( ea_t _from,
int flags = XREF_FLOW )
inline

Get first xref from the given address (store in to)

◆ next_from() [1/2]

bool xrefblk_t::next_from ( )
inline

Get next xref from address provided to first_from()

◆ first_to()

bool xrefblk_t::first_to ( ea_t _to,
int flags = XREF_FLOW )
inline

Get xref to given address (store in from)

◆ next_to() [1/2]

bool xrefblk_t::next_to ( )
inline

Get next xref to address provided to first_to()

◆ next_from() [2/2]

bool xrefblk_t::next_from ( ea_t _from,
ea_t _to,
int flags )
inline

Get xref from '_from' that comes after '_to'.

◆ next_to() [2/2]

bool xrefblk_t::next_to ( ea_t _from,
ea_t _to,
int flags )
inline

Get xref to '_to' that comes after '_from'.

Member Data Documentation

◆ from

ea_t xrefblk_t::from

the referencing address - filled by first_to(),next_to()

◆ to

ea_t xrefblk_t::to

the referenced address - filled by first_from(), next_from()

◆ iscode

bool xrefblk_t::iscode

is code reference (cref_t)?

otherwise it is a data reference (dref_t)

◆ type

uchar xrefblk_t::type

type of the last returned reference (cref_t & dref_t)

◆ user

bool xrefblk_t::user

is user defined xref? otherwise defined by ida

◆ _flags

uchar xrefblk_t::_flags

The documentation for this struct was generated from the following file: