class documentation
class LogicalAddress(_AbstractAddress):
Representation of a logical address based on a segment register.
Examples
>>> addr = address.LogicalAddress(0xfffff800c99455b0) >>> hex(addr.offset) '0xfffff800c99455b0' >>> print(addr) ds:0xfffff800c99455b0
| Method | __hash__ |
Returns the hash for this value. |
| Method | __init__ |
Initializes a LogicalAddress from an offset and a segment register. |
| Method | __repr__ |
Undocumented |
| Method | __str__ |
Returns the nicely printable string representation of this instance. |
| Method | translate |
Translates this virtual address to a physical address, if it is mapped at the specified context. |
| Property | segment |
Property: The segment register of the logical address. |
| Method | _address |
Undocumented |
| Method | _is |
Whether two address objects are comparable or not. |
| Method | _pack |
Pack a LogicalAddress to its high level representation. |
| Method | _pack |
Undocumented |
| Instance Variable | _segment |
Undocumented |
Inherited from _AbstractAddress:
| Method | __add__ |
Undocumented |
| Method | __and__ |
Undocumented |
| Method | __eq__ |
Compares the instance for equality with an object. |
| Method | __ge__ |
Undocumented |
| Method | __gt__ |
Undocumented |
| Method | __iadd__ |
Undocumented |
| Method | __iand__ |
Undocumented |
| Method | __ior__ |
Undocumented |
| Method | __isub__ |
Undocumented |
| Method | __le__ |
Undocumented |
| Method | __lt__ |
Undocumented |
| Method | __ne__ |
Compares the instance for equality with an object. |
| Method | __or__ |
Undocumented |
| Method | __sub__ |
Undocumented |
| Method | format |
This method gets an html formatting string representation for this class instance. |
| Method | offset |
Undocumented |
| Property | offset |
Property: The offset of the address. |
| Class Method | _unique |
Undocumented |
| Static Method | _unpack |
Unpack a low level representation of an address to its high level representation. |
| Static Method | _unpack |
Undocumented |
| Method | _repr |
Representation used by Jupyter Notebook when an instance of the address classes is displayed in a cell. |
| Class Variable | _unique |
Undocumented |
| Instance Variable | _formatter |
Undocumented |
| Instance Variable | _offset |
Undocumented |
def __hash__(self):
overrides
reven2.address._AbstractAddress.__hash__Returns the hash for this value.
| Returns | |
int | Undocumented |
def __init__(self, offset, segment_register=None, formatter=None):
overrides
reven2.address._AbstractAddress.__init__Initializes a LogicalAddress from an offset and a segment register.
If the segment register is set to None, arch.x64.ds is used as segment register to initialize the logical address.
Examples
>>> print(address.LogicalAddress(0x10)) ds:0x10 >>> print(address.LogicalAddress(256)) ds:0x100 >>> print(address.LogicalAddress(0xfffff800c99455b0)) ds:0xfffff800c99455b0 >>> print(address.LogicalAddress(0xfffff800c99455b0, arch.x64.cs)) cs:0xfffff800c99455b0
Information
| Parameters | |
| offset:integer | The offset of the logical address. |
segmentarch.register.Register | The segment register of the logical address. |
formatter:Formatter | The formatter for this address |
| Raises | |
TypeError | if `offset` is not an integer or `segment_register` is not a arch.register.Register. |
ValueError | if `offset` can not be converted to an integer or `segment_register` is not a segment register. |
def __str__(self):
Returns the nicely printable string representation of this instance.
| Returns | |
str | Undocumented |
def translate(self, context):
Translates this virtual address to a physical address, if it is mapped at the specified context.
Information
| Parameters | |
context:_Context | The reven2.trace.Context at which the translation should be attempted |
| Returns | |
_Optional[ | A PhysicalAddress if the current virtual address is mapped at the specified context, otherwise None |
Property: The segment register of the logical address.
Examples
>>> address.LogicalAddress(0xfffff800c99455b0).segment_register Register(x64.ds) >>> address.LogicalAddress(0xfffff800c99455b0, arch.x64.cs).segment_register Register(x64.cs)
Information
| Returns | |
A arch.register.Register. |
def _is_comparable(self, other):
Whether two address objects are comparable or not.
| Parameters | |
other:_Any | Undocumented |
| Returns | |
bool | Undocumented |
def _pack(self):
overrides
reven2.address._AbstractAddress._packPack a LogicalAddress to its high level representation.
Information
| Returns | |
_reven_api.VirtualAddress | A reven_api.VirtualAddress. |