class documentation

class TaintResultView(object):

Known subclasses: reven2.preview.taint.TaintAccessView, reven2.preview.taint.TaintChangeView, reven2.preview.taint.TaintStateView, reven2.preview.taint.TaintWarningView

View In Hierarchy

TThe abstract class from which any result view is derived.

It contains implementation of all functionalities used by TaintChangeView, TaintAccessView, TaintStateView and TaintWarningView

Method __init__ Undocumented
Method filter_by_context_range Filter the result view such that the results are between from_context and to_context.
Method take_n Filter the result view such as to get at most take_n results
Property status Property: the current status of this view instance, with regards to whether results are available to fetch.
Method all Yields all results in the view
Method available Yields the results that are currently available in the view.
Method __repr__ Undocumented
Instance Variable _remaining_result Undocumented
Instance Variable _rvn_taint_query Undocumented
Instance Variable _trace Undocumented
Instance Variable _taint_data Undocumented
Instance Variable _status Undocumented
Method _context_from_id Undocumented
Method _compare_context Undocumented
_remaining_result =

Undocumented

_rvn_taint_query =

Undocumented

_trace =

Undocumented

_taint_data =

Undocumented

_status =

Undocumented

def filter_by_context_range(self, from_context, to_context=None):

Filter the result view such that the results are between from_context and to_context.

If to_context is None then results will be only for from_context

Examples

>>> # taint rax in all the trace
>>> taint = tainter.simple_taint("rax")
>>> # create a change view and filter result between context(100) and context(1000)
>>> changes = taint.changes().filter_by_context_range(trace.context_after(100), trace.context_after(1000))
>>> # create a state view and filter result for context(100) only
>>> states = taint.states().filter_by_context_range(trace.context_after(100))
>>> next(states.all())
TaintState(context=Context before #101)

Warning

Do not call this method on view instances where you already called all or available

Information

Parametersfrom_contextreven2.trace.Context the beginning context
to_contextreven2.trace.Context the ending context
Returnsself.
def take_n(self, take_n):

Filter the result view such as to get at most take_n results

Warning

Do not call this method on view instances where you already called all or available

Examples

>>> # taint rax in all the trace
>>> taint = tainter.simple_taint("rax")
>>> # create a change view of all results and take only 3 results from them
>>> changes = taint.changes().take_n(3)
>>> for change in changes:
>>>     print(change.transition)
#7 mov qword ptr [rbp - 0x50], rax
#20 movaps xmmword ptr [rbp], xmm1
#27 lea rax, [rip + 0x3120]

Information

Parameterstake_ninteger number of requested results
Returnsself.
def _context_from_id(self, id):

Undocumented

def _compare_context(self, lhs_context, rhs_context):

Undocumented

@property
status =

Property: the current status of this view instance, with regards to whether results are available to fetch.

Examples

>>> # taint rax in all the trace
>>> taint = tainter.simple_taint("rax")
>>> # create a change view of all results
>>> changes = taint.changes()
>>> changes.status
TaintResultStatus.Waiting
>>> for change in changes.all()
>>>     pass
>>> changes.status
TaintResultStatus.Exhausted

Information

def all(self):

Yields all results in the view

Warning

This method is a blocking method, it blocks until all results are available.

If this method is called multiple times on the same view instance, the first call will return all the results, and later calls will not return any result.

Calling this method after calling the available method on the same view instance will only yield the results that were not produced by the previous call to the available method.

Examples

>>> # taint [ds:0xffffd001ea0d6040; 8] in all the trace
>>> taint = tainter.simple_taint("[0xffffd001ea0d6040; 8]")
>>> changes = taint.changes()
>>> for change in changes.all():
>>>     print(change)
Taint change at #20 movaps xmmword ptr [rbp], xmm1
Tainted memories:
[phy:0x1bdb4040; 8] : [tag0,]

Information

ReturnsA generator of taint results.
def available(self):

Yields the results that are currently available in the view.

This method won't block even if all results were not produced yet by the taint: it will simply yield the results available to the taint at the time of the call, and then return.

Note that each successive call to this method on the same instance will only yield the results that were produced since the last call.

Examples

>>> # taint [ds:0xfffff658987; 8] in all the trace
>>> taint = tainter.simple_taint("[0xfffff658987; 8]")
>>> changes = taint.changes()
>>> for change in changes.available():
>>>     print(change.transition.id)
21
27
52
>>> for change in changes.available():
>>>     print(change.transition.id)
87
101
>>> # Note that you can restart iteration by constructing a news changes view
>>> changes = taint.changes()
>>> for change in changes.available():
>>>     print(change.transition.id)
21
27
52
87
101

Information

ReturnsA generator of available taint results.
API Documentation for reven2, generated by pydoctor 21.2.2 at 2021-04-08 12:32:07.