collaboration.util module

Class

Description

binaryninja.collaboration.util.LazyT

Lazily loaded objects (but FFI)

LazyT

class LazyT[source]

Bases: object

Lazily loaded objects (but FFI) Pretend this class is templated, because the C++ version is

__init__(ctor: Callable[[], object] | None = None, handle=None)[source]

Create a new LazyT that will be initialized with the result of the given function, when it is first needed.

Parameters:
  • ctor (Callable[[], object] | None) – Function to construct object

  • handle – FFI handle for internal use

get(expected_type=<class 'object'>)[source]

Access the lazily loaded object. Will construct it if this is the first usage.

Parameters:

expected_type – Expected type of result, ctypes will try to cast to it

Returns:

Result object