IDA SDK
Public Attributes | List of all members
xrefblk_t Struct Reference

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_ALL); ok; ok=xb.next_from() )
{
// xb.to - contains the referenced address
}

or:

for ( bool ok=xb.first_to(ea, XREF_ALL); ok; ok=xb.next_to() )
{
// xb.from - contains the referencing address
}

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.

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()
 
uchar iscode
 1-is code reference; 0-is data reference
 
uchar type
 type of the last returned reference (cref_t & dref_t)
 
uchar user
 1-is user defined xref, 0-defined by ida
 

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)
 Get first xref from the given address (store in to)
 
bool next_from (void)
 Get next xref from address provided to first_from()
 
bool first_to (ea_t _to, int flags)
 Get xref to given address (store in from)
 
bool next_to (void)
 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'.
 

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