class TaintedRegisterSlice:
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 |
The view of this instance as a {reven2.register_slice.RegisterSlice}. |
Static Method | _unpack |
Undocumented |
Method | _is |
Undocumented |
Method | _pack |
Undocumented |
Instance Variable | _begin |
Undocumented |
Instance Variable | _end |
Undocumented |
Instance Variable | _reg |
Undocumented |
Compares the instance for equality with an object.
- if the object is not a
TaintedRegisterSlice
, the object is never considered equal.
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:Register | the register of the slice |
begin:integer | the first byte in the slice |
end:integer | the first byte not in the slice |
Raises | |
TypeError | if `reg` is not a Register instance |
IndexError | if 'begin' or 'end' are out of the register byte range |
Compares the instance for equality with an object.
- if the object is not a
TaintedRegisterSlice
, the object is never considered equal.
Parameters | |
r:object | Undocumented |
Returns | |
bool | Undocumented |
Returns the nicely printable string representation of this instance.
Returns | |
str | Undocumented |
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. |
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. |
register =
Property: The register that's being sliced.
Examples
>>> TaintedRegisterSlice(reven2.arch.x64.rax, 1, 2).register Register(x64.rax)
Information
Returns | |
A Register . |
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