class documentation

class TaintedRegisterSlice:

View In Hierarchy

Models a slice of an architecture register, e.g. rax[0..4]

if 'begin' is None the slice starts at the first byte of the register If 'end' is None the slice ends at the last byte of the register If 'begin' and 'end' are None the slice represents all the bytes of the register

Examples

>>> # Register slice represents all C{rax} register
>>> reg_slice1 = TaintedRegisterSlice(reven2.arch.x64.rax)
>>> # Register slice represents bytes 2,3,4 and 5 of rbx
>>> reg_slice2 = TaintedRegisterSlice(reven2.arch.x64.rbx, 2, 6)
Method __eq__ Compares the instance for equality with an object.
Method __hash__ Returns the hash for this value.
Method __init__ Initialize a TaintedRegisterSlice from a register, a begin byte and an end byte
Method __ne__ Compares the instance for equality with an object.
Method __repr__ Undocumented
Method __str__ Returns the nicely printable string representation of this instance.
Property begin Property: The index of the first byte in the slice.
Property end Property: The index of the first byte not in the slice.
Property register Property: The register that's being sliced.
Property register_slice The view of this instance as a {reven2.register_slice.RegisterSlice}.
Static Method _unpack Undocumented
Method _is_full Undocumented
Method _pack Undocumented
Instance Variable _begin Undocumented
Instance Variable _end Undocumented
Instance Variable _reg Undocumented
def __eq__(self, r):

Compares the instance for equality with an object.

def __hash__(self):

Returns the hash for this value.

Returns
intUndocumented
def __init__(self, reg, begin=None, end=None):

Initialize a TaintedRegisterSlice from a register, a begin byte and an end byte

If 'begin' is set to None the slice begins at byte 0 If 'end' is set to None the slice ends at byte reg.size_bytes

Examples

>>> reg_slice1 = TaintedRegisterSlice(reven2.arch.sse2.xmm)
>>> reg_slice1 = TaintedRegisterSlice(reven2.arch.sse2.xmm, 2)

Information

Parameters
reg:Registerthe register of the slice
begin:integerthe first byte in the slice
end:integerthe first byte not in the slice
Raises
TypeErrorif `reg` is not a Register instance
IndexErrorif 'begin' or 'end' are out of the register byte range
def __ne__(self, r):

Compares the instance for equality with an object.

Parameters
r:objectUndocumented
Returns
boolUndocumented
def __repr__(self):

Undocumented

def __str__(self):

Returns the nicely printable string representation of this instance.

Returns
strUndocumented
@property
begin =

Property: The index of the first byte in the slice.

Examples

>>> TaintedRegisterSlice(reven2.arch.x64.rax, 1, 2).begin
1

Information

Returns
An integer.
@property
end =

Property: The index of the first byte not in the slice.

Examples

>>> TaintedRegisterSlice(reven2.arch.x64.rax, 1, 2).end
2

Information

Returns
An integer.
@property
register =

Property: The register that's being sliced.

Examples

>>> TaintedRegisterSlice(reven2.arch.x64.rax, 1, 2).register
Register(x64.rax)

Information

Returns
A Register.
@property
register_slice: _RegisterSlice =

The view of this instance as a {reven2.register_slice.RegisterSlice}.

Example

>>> TaintedRegisterSlice(reven2.arch.x64.rax, 1, 3)
TaintedRegisterSlice(reg=Register(x64.rax), begin=1, end=3)
>>> TaintedRegisterSlice(reven2.arch.x64.rax, 1, 3).register_slice
RegisterSlice(register=Register(x64.rax), begin=8, size=16)

Note

Be mindful of the differences between RegisterSlice and TaintedRegisterSlice:

  • RegisterSlice is in bits, not in bytes
  • rax[0:1] has 1 excluded for RegisterSlice, and included for TaintedRegisterSlice
@staticmethod
def _unpack(rvn_reg_slice):

Undocumented

def _is_full(self):

Undocumented

def _pack(self):

Undocumented

_begin =

Undocumented

_end =

Undocumented

_reg =

Undocumented