Light modelisation of a binary file.

It provides useful information such as the guest filesytem path or the list of available symbols.

Warnings

Must not be directly constructed but retrieved through the following examples. Using an instance of Binary directly constructed could lead to an AssertionError.

Examples

>>> # From a Transition
>>> transition.context_before().ossi.location().binary # from the context before the transition
>>> transition.context_after().ossi.location().binary  # from the context after the transition
>>> # From a Context
>>> context.location().binary
>>> # From a Symbol
>>> symbol.binary
Method __init__ Undocumented
Method path Property: The path to the binary in the guest filesystem.
Method filename Property: The filename of the binary (including the extension).
Method name Property: The filename of the binary without the extension.
Method symbols Get a generator over symbols of the binary.
Method __str__ Undocumented
Method __repr__ Undocumented
Method __eq__ Undocumented
Method __ne__ Undocumented
def __init__(self, _datasource, _id):
Undocumented
@property
def path(self):

Property: The path to the binary in the guest filesystem.

Path Format:

Using / as file separator.

Examples

>>> binary.path
'c:/windows/system32/ntoskrnl.exe'

Information

ReturnsA string.
@property
def filename(self):

Property: The filename of the binary (including the extension).

Examples

>>> binary.path
'c:/windows/system32/ntoskrnl.exe'
>>> binary.filename
'ntoskrnl.exe'

Information

ReturnsA string.
@property
def name(self):

Property: The filename of the binary without the extension.

Examples

>>> binary.path
'c:/windows/system32/ntoskrnl.exe'
>>> binary.name
'ntoskrnl'

Information

ReturnsA string.
def symbols(self, pattern=None, case_sensitive=False):

Get a generator over symbols of the binary.

Symbols can be filtered by their name:

  • filter enabled if the `pattern` argument is not None.
  • a `contains` approch is used.
  • the filter pattern is a regular expression.
  • case sensitive depending on the `case_sensitive` argument

They are fetched from the binary file itself and its related debug file, if any.

Warnings

It depends on the OSSI feature. If unavailable, an exception will be raised.

If the binary file is not accessible from the provided filesystem, no symbols will be returned.

Examples

>>> for symbol in binary.symbols():
>>>     print(symbol)
'toto'
'tata'
>>> for symbol in binary.symbols('toto'):
>>>     print(symbol)
'toto'

Information

Parameterspatterna regular expression used to compare symbols.
case_sensitiveWhether the symbols comparison is case sensitive or not.
ReturnsA generator on the binary's Symbols .
RaisesRuntimeErrorif OSSI feature is unavailable.
def __str__(self):
Undocumented
def __repr__(self):
Undocumented
def __eq__(self, other):
Undocumented
def __ne__(self, other):
Undocumented
API Documentation for reven2, generated by pydoctor at 2019-11-13 18:38:15.