Xref

XRef are a really important feature of IDA which allow to find the links between different objects. In Bip they are represented by the BipXref objects. All objects which inherit from BipRefElt (including those which inherit from BipElt) posess an API for xref.

An xref is an oriented link between two different element of the IDB. The object creating the xref can be access by using the src() property while the destination can be access using dst(), both of those property return object which inherit from BipBaseElt; it is possible to get their ID using src_ea() and dst_ea().

Some flags are available allowing to check the type of xref and most object allowing to access them provide properties allowing to access directly more specific objects.

Here is a list of objects which can access xref through the interface provided by BipRefElt :

The BipFunction also possess an interface with xrefs.

BipXref API

class bip.base.BipXref(xref)

Base class for representing an xref between two elements.

Todo

classmethod allowing to create xref

Todo

classmethod allowing to destroy xref

__init__(xref)

Constructor for an xref object. There is few reason to directly use this constructor, properties of BipBaseElt and of BipFunction should allow to directly get the xref.

Parameters:xref (idautils._xref .) – The xref object used in IDA.
_xref = None

Internal object representing the xref in IDA

_type

Return the type of the xref with the mask applied.

is_userdef

Return True if the xref was added by a user.

src_ea

Source address (or member id for xref on struct) of the XRef: the object which created it. This is equivalent to the from in the standard IDA api.

src

Property which allow to get an object representing the element at the source address.

Returns:An object representing the element at the source address.
Rtypes:An BipBaseElt or one of its subclasses. See GetElt().
dst_ea

Destination address (or member id for xref on struct) of the XRef. This is equivalent to the to in the standard IDA api.

dst

Property which allow to get an object representing the element at the destination address or id.

Returns:An object representing the element at the destination address.
Rtypes:An BipBaseElt or one of its subclasses. See GetElt().
is_codepath

Property indicating if the xref indicate a path for the control flow of the program. This can be because of a jmp, a call or simply a normal path.

is_call

Property indicating if this xref was generated by a call intruction: the source is the call instruction and the destination is the beginning of a function.

is_jmp

Property indicating if this xref was generated by a jmp instruction.

is_ordinaryflow

Property indicating if this xref indicate an ordinary flow (not jump or call) between two instructions.

is_offset

The xref is created by an offset, it can be a lea instruction or a reference on a address in an array.

is_write_access

The xref is created by a write access.

is_read_access

The xref is created by a read access.

is_dst_code

Property which indicate if the destination of the xref is code.

Returns:True or False.
is_src_code

Property which indicate if the source of the xref is code.

Returns:True or False.
__weakref__

list of weak references to the object (if defined)