Entry point object for data related to a transition.

A transition is anything that changes the state of the virtual machine, from `context_before` to `context_after`. Most of the time, that would be an instruction executed by the CPU. Sometimes, it will be an exception (CPU fault or IRQ) instead. In that case, an instruction might still be related to the exception, if for instance it is the source of the fault. In that case, the instruction has not been fully executed by the CPU.

Warnings

This object is not meant to be constructed directly. Use Trace.transition instead.

Examples

Spawning: >>> # From a trace >>> tr = reven_server.trace.transition(id) >>> >>> # From a context >>> tr = context.transition_before(transition_id) >>> >>> # From a transition >>> tr = reven_server.trace.transition(id) >>> next_tr = tr + 1 >>> prev_tr = tr - 1 >>> other_tr = tr + 10000

Usage: >>> print(tr) >>> if tr.type == TransitionType.Instruction: >>> print(tr.instruction)

Method __init__ Undocumented
Method id Property: Unique ID of this transition.
Method type Property: The transition's type.
Method instruction Property: The associated Instruction if one exists.
Method exception Property: The associated Exception if one exists.
Method context_before Get the Context object before this transition was executed
Method context_after Get the Context object after this transition was executed
Method memory_accesses Get a generator over the reven2.memhist.MemoryAccesses at this transition.
Method __str__ Undocumented
Method __repr__ Undocumented
Method __eq__ Undocumented
Method __ne__ Undocumented
Method __lt__ Undocumented
Method __le__ Undocumented
Method __gt__ Undocumented
Method __ge__ Undocumented
Method __add__ Undocumented
Method __sub__ Undocumented
Method _trace Undocumented
Method _data Undocumented
def __init__(self, trace, _data_source, _ossi_data_source, transition_id):
Undocumented
@property
def _trace(self):
Undocumented
@property
def id(self):

Property: Unique ID of this transition.

Can be used to spawn the object from the corresponding `Trace` object.

Information

ReturnsAn integer.
@property
def type(self):

Property: The transition's type.

The type of a transition can be one of the following:

  • TransitionType.Instruction means this transition is a fully instruction executed.
  • TransitionType.Exception means this transition is an exception raised by the CPU or a peripheral.

Information

ReturnsA TransitionType instance.
@property
def instruction(self):

Property: The associated Instruction if one exists.

If this transition is not of type TransitionType.Instruction, None will be returned.

Information

ReturnsAn Instruction, or None.
@property
def exception(self):

Property: The associated Exception if one exists.

If this transition is not of type TransitionType.Exception, None will be returned.

Information

ReturnsAn Exception, or None.
def context_before(self):

Get the Context object before this transition was executed

>>> Context before -> This transition

Information

ReturnsA Context.
def context_after(self):

Get the Context object after this transition was executed

>>> This transition -> Context after

Information

ReturnsA Context.
def memory_accesses(self, operation=None):

Get a generator over the reven2.memhist.MemoryAccesses at this transition.

Examples

>>> # Getting all accesses as a list at transition 42 (can be long if there are a lots of accesses):
>>> list(trace.transition(42).memory_accesses())
[MemoryAccess(transition=Transition(id=42), physical_address=PhysicalAddress(offset=0x7fc03eb8), size=8,
    operation=MemoryAccessesOperation.Write, virtual_address=LinearAddress(offset=0xffff88007fc03eb8))]
>>> # Getting the first memory access at transition 14
>>> next(trace.transition(14).memory_accesses())
MemoryAccess(transition=Transition(id=14), physical_address=PhysicalAddress(offset=0x1f270a2), size=1,
    operation=MemoryAccessesOperation.Read, virtual_address=LinearAddress(offset=0xffffffff81f270a2))
>>> # Getting all addresses that are read at transition 0.
>>> addresses = set()
>>> for access in trace.transition(0).memory_accesses(operation=reven2.memhist.MemoryAccessesOperation.Read):
>>>     physical_offset = access.physical_address.offset
>>>     for address in range(physical_offset, physical_offset + access.size)
>>>         addresses.add(address)
>>> for address in addresses:
>>>     print reven2.address.PhysicalAddress(address)
phy:0x36f05080
phy:0x36f05081
phy:0x36f05082
phy:0x36f05083
phy:0x36f05084
phy:0x36f05085
phy:0x36f05086
phy:0x36f05087

Information

ParametersoperationOnly return accesses whose operation equals the specified reven2.memhist.MemoryAccessOperation. If None, return all accesses.
Returnsa generator of reven2.memhist.MemoryAccess.
RaisesRuntimeErrorif the memory history resource has not been generated
@property
def _data(self):
Undocumented
def __str__(self):
Undocumented
def __repr__(self):
Undocumented
def __eq__(self, other):
Undocumented
def __ne__(self, other):
Undocumented
def __lt__(self, other):
Undocumented
def __le__(self, other):
Undocumented
def __gt__(self, other):
Undocumented
def __ge__(self, other):
Undocumented
def __add__(self, other):
Undocumented
def __sub__(self, other):
Undocumented
API Documentation for reven2, generated by pydoctor at 2019-11-13 18:38:15.