binaryninja.typelibrary.TypeLibrary

class TypeLibrary(handle)[source]
__init__(handle)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(handle)

Initialize self.

add_alternate_name(name)

Adds an extra name to this type library used during library lookups and dependency resolution

add_named_object(name, t)

add_named_object directly inserts a named object into the type library’s object store.

add_named_type(name, t)

add_named_type directly inserts a named object into the type library’s object store.

add_platform(plat)

Associate a platform with a type library instance that has not been finalized.

clear_platforms()

Clears the list of platforms associated with a type library instance that has not been finalized

finalize()

Flags a newly created type library instance as finalized and makes it available for Platform and Architecture type library searches

from_guid(arch, guid)

from_guid attempts to grab a type library associated with the provided Architecture and GUID pair

from_name(arch, name)

from_name looks up the first type library found with a matching name.

get_named_object(name)

get_named_object direct extracts a reference to a contained object – when attempting to extract types from a library into a BinaryView, consider using import_library_object instead.

get_named_type(name)

get_named_type direct extracts a reference to a contained type – when attempting to extract types from a library into a BinaryView, consider using import_library_type instead.

load_from_file(path)

Loads a finalized type library instance from file

new(arch, name)

Creates an empty type library object with a random GUID and the provided name.

query_metadata(key)

query_metadata retrieves a metadata associated with the given key stored in the type library

remove_metadata(key)

remove_metadata removes the metadata associated with key from the current type library.

store_metadata(key, md)

store_metadata stores an object for the given key in the current type library.

write_to_file(path)

Saves a finalized type library instance to file

Attributes

alternate_names

A list of extra names that will be considered a match by Platform.get_type_libraries_by_name

arch

The Architecture this type library is associated with

dependency_name

The dependency_name of a library is the name used to record dependencies across type libraries.

guid

Returns the GUID associated with the type library

name

The primary name associated with this type library

named_objects

A dict containing all named objects (functions, exported variables) provided by a type library (read-only)

named_types

A dict containing all named types provided by a type library (read-only)

platform_names

Returns a list of all platform names that this type library will register with during platform type registration.