class TaintResultView(_Generic[_ResultType]):
The abstract class from which any result view is derived.
It contains implementation of all functionalities used by TaintAccessView
, TaintStateView
and TaintWarningView
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | all |
Yields all results in the view |
Method | available |
Yields the results that are currently available in the view. |
Method | filter |
Filter the result view such that the results are between from_context and to_context. |
Method | take |
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 | _compare |
Undocumented |
Method | _context |
Undocumented |
Method | _data |
Undocumented |
Method | _data |
Undocumented |
Method | _result |
Undocumented |
Instance Variable | _remaining |
Undocumented |
Instance Variable | _rvn |
Undocumented |
Instance Variable | _status |
Undocumented |
Instance Variable | _taint |
Undocumented |
Instance Variable | _trace |
Undocumented |
Undocumented
Parameters | |
trace:_Trace | Undocumented |
taint_TaintData | Undocumented |
fetchint | Undocumented |
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.accesses(changes_only=True) >>> for change in changes.all(): ... print(change) Taint change at #20 movaps xmmword ptr [rbp], xmm1 Tainted memories: [phy:0x1bdb4040; 8] : [tag0,]
Information
Returns | |
_Iterator[ | A generator of taint results. |
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.accesses(changes_only=True) >>> 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.accesses(changes_only=True) >>> for change in changes.available(): ... print(change.transition.id) 21 27 52 87 101
Information
Returns | |
_Iterator[ | A generator of available taint results. |
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.accesses(changes_only=True).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)
Information
Parameters | |
from_Context | reven2.trace.Context the beginning context |
to_Optional[ | reven2.trace.Context the ending context |
Returns | |
TaintResultView[ | self. |
Filter the result view such as to get at most take_n results
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.accesses(changes_only=True).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
Parameters | |
takeint | integer number of requested results |
Returns | |
TaintResultView[ | self. |
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.accesses(changes_only=True) >>> changes.status TaintResultStatus.Waiting >>> for change in changes.all(): ... pass >>> changes.status TaintResultStatus.Exhausted