class TaintState(object):
A taint state lists all data that is currently tainted at a given reven2.trace.Context
.
A taint state is composed of:
- the
reven2.trace.Context
associated to the state - a map from
TaintedRegisterSlice
orTaintedMemories
toMarkerIterator
indicating what is currently tainted
Warnings
This object is not meant to be constructed directly. It is created by TaintStateView
Examples
>>> states = taint.states() >>> for state in states.all(): ... # state is an instance of TaintState ... print(state) Taint state at Context before #10 Tainted registers: rax : [tag0,] Tainted memories: [phy:0x46b5ff0; 8] : [tag0,] [phy:0x1bdb4040; 1] : [tag1,]
Taint state at Context before #11 Tainted registers: rax : [tag0,] Tainted memories: [phy:0x46b5ff0; 8] : [tag0,] [phy:0x1bdb4040; 1] : [tag1,]
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | add |
Add some tainted data to this taint state. |
Method | format |
This method gets an html formatting string representation for this class instance. |
Method | is |
Returns the intersection of this state with the requested data if it is tainted with some markers. |
Method | remove |
Remove some tainted data from this taint state. |
Method | tainted |
Iterates over each TaintedMemories in this state and yields a pair of TaintedMemories and MarkerIterator |
Method | tainted |
Iterates over each TaintedRegisterSlice in this state and yields a pair of TaintedRegisterSlice and MarkerIterator |
Property | context |
Property: the context associated to the state |
Property | empty |
No summary |
Method | _add |
Undocumented |
Method | _disjoint |
Undocumented |
Method | _is |
Undocumented |
Method | _marker |
Undocumented |
Method | _one |
Undocumented |
Method | _remove |
Undocumented |
Method | _repr |
Undocumented |
Method | _tainted |
Undocumented |
Method | _tainted |
Undocumented |
Instance Variable | __physical |
Undocumented |
Instance Variable | __register |
Undocumented |
Instance Variable | _context |
Undocumented |
Instance Variable | _taint |
Undocumented |
Instance Variable | _taint |
Undocumented |
Instance Variable | _trace |
Undocumented |
Property | _physical |
Undocumented |
Property | _register |
Undocumented |
Undocumented
Parameters | |
trace | Undocumented |
taint_TaintData | Undocumented |
taint | Undocumented |
Add some tainted data to this taint state.
Warning
Adding data to a taint state does not modify the state of the currently running taint. For the changes to take effect, restart a taint from this taint state using Tainter.taint_from_state
.
Information
Parameters | |
data:_Union[ | The data to add to this state. Can be an individual piece of data or an iterable of data. |
marker:_Optional[ | The marker to add to the passed data. If None, defaults to "Tag0". |
This method gets an html formatting string representation for this class instance.
Information
Returns | |
String |
Returns the intersection of this state with the requested data if it is tainted with some markers.
Examples
Checking if all of a register is tainted.
>>> state.is_tainted(reven2.arch.x64.rax).full False
Checking if some of a register is tainted.
>>> not state.is_tainted(reven2.arch.x64.rax).empty True
Checking if all the requested data is tainted.
>>> state.is_tainted((reven2.arch.x64.rax, reven2.arch.x64.rbx)).full False
Checking if some of the requested data is tainted.
>>> not state.is_tainted((reven2.arch.x64.rax, reven2.arch.x64.rbx)).empty True
Overloads
def is_tainted( self, data: _Union[TaintedMemories, _Iterable[TaintedMemories]], marker: _Optional[Marker] = None ) -> _StateIntersection[_MemoryRange]
def is_tainted( self, data: _Union[_address.AddressType, _Iterable[_address.AddressType]], marker: _Optional[Marker] = None ) -> _StateIntersection[_MemoryRange[_address.AddressType]]
def is_tainted( self, data: _Union[_MemoryRange[_address.AddressType], _Iterable[_MemoryRange[_address.AddressType]]], marker: _Optional[Marker] = None, ) -> _StateIntersection[_MemoryRange[_address.AddressType]]
def is_tainted( self, data: _Union[TaintedRegisterData, _Iterable[TaintedRegisterData]], marker: _Optional[Marker] = None ) -> _StateIntersection[_RegisterSlice]
def is_tainted( self, data: _Union[TaintedData, _Iterable[TaintedData]], marker: _Optional[Marker] = None ) -> _StateIntersection[_Union[_MemoryRange, _RegisterSlice]]
Information
Parameters | |
data:_Union[ | the data whose "taintedness" we want to check. Can be a single TaintedData or an Iterable or these. |
marker:_Optional[ | the marker with which the data should be tainted. If None, considers the data tainted if it has any marker. |
Returns | |
_StateIntersection[ | Undocumented |
Remove some tainted data from this taint state.
Warning
Removing data from a taint state does not modify the state of the currently running taint. For the changes to take effect, restart a taint from this taint state using Tainter.taint_from_state
.
Overloads
def remove( self, data: _Union[TaintedMemories, _Iterable[TaintedMemories]], marker: _Optional[Marker] = None ) -> _StateIntersection[_MemoryRange]
def remove( self, data: _Union[_address.AddressType, _Iterable[_address.AddressType]], marker: _Optional[Marker] = None ) -> _StateIntersection[_MemoryRange[_address.AddressType]]
def remove( self, data: _Union[_MemoryRange[_address.AddressType], _Iterable[_MemoryRange[_address.AddressType]]], marker: _Optional[Marker] = None, ) -> _StateIntersection[_MemoryRange[_address.AddressType]]
def remove( self, data: _Union[TaintedRegisterData, _Iterable[TaintedRegisterData]], marker: _Optional[Marker] = None ) -> _StateIntersection[_RegisterSlice]
def remove( self, data: _Union[TaintedData, _Iterable[TaintedData]], marker: _Optional[Marker] = None ) -> _StateIntersection[_Union[_MemoryRange, _RegisterSlice]]
Information
Parameters | |
data:_Union[ | The data to remove from this state. Can be an individual piece of data or an iterable of data. |
marker:_Optional[ | The marker to remove from the passed data. If None, remove the data regardless of its tag. |
Returns | |
_StateIntersection[ | Undocumented |
Iterates over each TaintedMemories
in this state and yields a pair of TaintedMemories
and MarkerIterator
Examples
>>> states = taint.states() >>> for state in states.all(): ... # state is an instance of TaintState ... for mem, markers in state.tainted_memories(): ... print(mem) ... for handle, name in markers: ... print(name) [phy:0x46b5ff0; 8] tag0 [phy:0x1bdb4040; 1] tag1 [phy:0x46b5ff0; 8] tag0 [phy:0x1bdb4040; 1] tag1
Information
Returns | |
_Iterator[ | A generator of (TaintedMemories , MarkerIterator ). |
Iterates over each TaintedRegisterSlice
in this state and yields a pair of TaintedRegisterSlice
and MarkerIterator
Examples
>>> states = taint.states() >>> for state in states.all(): ... # state is an instance of TaintState ... for reg, markers in state.tainted_registers(): ... print(reg) ... for handle, name in markers: ... print(name) rax tag0 rax tag0
Information
Returns | |
_Iterator[ | A generator of (TaintedRegisterSlice , MarkerIterator ). |
Property: the context associated to the state
Examples
>>> states = taint.states() >>> for state in states.all(): ... # state is an instance of TaintState ... print(state.context) Context before #10 Context before #11
Information
Returns | |
A reven2.trace.Context . |
Undocumented
Parameters | |
data:_Union[ | Undocumented |
marker:MarkerHandle | Undocumented |
Undocumented
Parameters | |
data:_Union[ | Undocumented |
Returns | |
_Iterator[ | Undocumented |
Undocumented
Parameters | |
data:_Union[ | Undocumented |
marker:_Optional[ | Undocumented |
Returns | |
_Iterator[ | Undocumented |
Undocumented
Parameters | |
marker:_Optional[ | Undocumented |
Returns | |
_Optional[ | Undocumented |
Undocumented
Parameters | |
data:TaintedData | Undocumented |
Returns | |
_Union[ | Undocumented |
Undocumented
Parameters | |
data:_Union[ | Undocumented |
marker:_Optional[ | Undocumented |
Returns | |
_Iterator[ | Undocumented |
Undocumented
Parameters | |
data:_Union[ | Undocumented |
Returns | |
_Iterator[ | Undocumented |
_Optional[ _MemoryRangeMap[ _address.PhysicalAddress, _Set[ MarkerHandle]]]
=
Undocumented