class documentation

class String(object):

View In Hierarchy

Represents a string that is read and/or write during the trace.

Warnings

This object is not meant to be constructed directly. Use RevenServer.trace.strings (Trace.strings) instead.

Examples

>>> # From a reven_server
>>> strings = reven_server.trace.strings("hello")
>>> # strings matching the pattern "*hello*" in the whole trace are returned as a generator.
>>> for string in strings:
...     print(string.data)
Method __init__ Undocumented
Method __repr__ Undocumented
Method __str__ Returns the nicely printable string representation of this instance.
Method format_as_html This method gets an html formatting string representation for this class instance.
Method memory_accesses Return a generator of memhist.MemoryAccess corresponding to the string accesses
Property address Property: The linear address where the string begins.
Property address_range Property: The range of memory occupied by the string.
Property data Property: The content of the string.
Property encoding Property: The encoding of the string, whether UTF8 or UTF16.
Property first_access Property: The first transition the string has been accessed.
Property id Property: The unique id of the string in the trace.
Property last_access Property: The last transition the string has been accessed.
Property size Property: The size in bytes of the string in memory
Method _repr_html_ Representation used by Jupyter Notebook when an instance of this class is displayed in a cell.
Instance Variable _address Undocumented
Instance Variable _rvn_string Undocumented
Instance Variable _trace Undocumented
def __init__(self, _trace, _rvn_string):

Undocumented

def __repr__(self):

Undocumented

Returns
strUndocumented
def __str__(self):

Returns the nicely printable string representation of this instance.

Returns
strUndocumented
def format_as_html(self):

This method gets an html formatting string representation for this class instance.

Information

Returns
String
def memory_accesses(self, from_transition=None, to_transition=None, operation=None, timeout=10):

Return a generator of memhist.MemoryAccess corresponding to the string accesses

The accesses are returned chronologically (from the first_access to the last_access of the string)

Limitations

When the service takes too much time to retrieve memory accesses (> 5s), it times out and throws a RuntimeError. If a timeout occurs no accesses are returned at all.

Information

Parameters
from_transitionTransition at which to start the search of accesses. The from_transition is included in the search results If None, start at the beginning of the trace. If specified, must be lower than to_transition
to_transitionTransition at which to stop the search accesses. The to_transition is excluded from the search results If None, stop to the end of the trace. If specified, must be greater than from_transition
operationtype (memhist.MemoryAccessOperation) of accesses the user want to retrieve By default set to None, will retrieve all types of access (read/write) If MemoryAccessOperation.Read, retrieve only read accesses If MemoryAccessOperation.Write, retrieve only write accesses
timeoutTechnical parameter determining the maximum number of seconds to wait the accesses. By default, wait 10 seconds before the timeout (timeout=10). If the service timeouts, no access is returned at all. If 0, wait indefinitely until all accesses have been retrieved.
Returns
A generator of memory accesses (memhist.MemoryAccess).
Raises
RuntimeErrorif the strings resource has not been generated.
ValueErrorif from_transition > to_transition.
RuntimeErrorif the service timeouts (by default, if the service takes more than 10s).
@property
address =

Property: The linear address where the string begins.

Information

Returns
A reven2.address.LinearAddress.
@property
address_range: _MemoryRange[_address.LinearAddress] =

Property: The range of memory occupied by the string.

@property
data =

Property: The content of the string.

Information

Returns
A string.
@property
encoding =

Property: The encoding of the string, whether UTF8 or UTF16.

Information

Returns
A reven2.types.Encoding instance.
@property
first_access =

Property: The first transition the string has been accessed.

Information

Returns
A reven2.trace.Transition.
@property
id =

Property: The unique id of the string in the trace.

The id can be used to disambiguate the strings from other strings having e.g. the same contents, or at the same location, but created at a different time.

Information

Returns
An integer.
@property
last_access =

Property: The last transition the string has been accessed.

Information

Returns
A reven2.trace.Transition.
@property
size =

Property: The size in bytes of the string in memory

Information

Returns
An integer.
def _repr_html_(self):

Representation used by Jupyter Notebook when an instance of this class is displayed in a cell.

_address =

Undocumented

_rvn_string =

Undocumented

_trace =

Undocumented