types module

Class

Description

binaryninja.types.ArrayBuilder

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

binaryninja.types.ArrayType

classType allows you to interact with the Binary Ninja type system. Note that therepr

binaryninja.types.BaseStructure

binaryninja.types.BoolBuilder

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

binaryninja.types.BoolType

classType allows you to interact with the Binary Ninja type system. Note that therepr

binaryninja.types.BoolWithConfidence

binaryninja.types.CharBuilder

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

binaryninja.types.CharType

classType allows you to interact with the Binary Ninja type system. Note that therepr

binaryninja.types.CoreSymbol

binaryninja.types.EnumerationBuilder

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

binaryninja.types.EnumerationMember

binaryninja.types.EnumerationType

classType allows you to interact with the Binary Ninja type system. Note that therepr

binaryninja.types.FloatBuilder

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

binaryninja.types.FloatType

classType allows you to interact with the Binary Ninja type system. Note that therepr

binaryninja.types.FunctionBuilder

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

binaryninja.types.FunctionParameter

binaryninja.types.FunctionType

classType allows you to interact with the Binary Ninja type system. Note that therepr

binaryninja.types.InheritedStructureMember

binaryninja.types.IntegerBuilder

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

binaryninja.types.IntegerType

classType allows you to interact with the Binary Ninja type system. Note that therepr

binaryninja.types.MutableTypeBuilder

binaryninja.types.NameSpace

binaryninja.types.NamedTypeReferenceBuilder

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

binaryninja.types.NamedTypeReferenceType

classType allows you to interact with the Binary Ninja type system. Note that therepr

binaryninja.types.OffsetWithConfidence

binaryninja.types.PointerBuilder

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

binaryninja.types.PointerType

classType allows you to interact with the Binary Ninja type system. Note that therepr

binaryninja.types.QualifiedName

binaryninja.types.RegisterSet

binaryninja.types.RegisterStackAdjustmentWithConfidence

binaryninja.types.StructureBuilder

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

binaryninja.types.StructureMember

binaryninja.types.StructureType

classType allows you to interact with the Binary Ninja type system. Note that therepr

binaryninja.types.Symbol

Symbols are defined as one of the following types:

binaryninja.types.Type

classType allows you to interact with the Binary Ninja type system. Note that therepr

binaryninja.types.TypeBuilder

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

binaryninja.types.TypeBuilderAttributes

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping…

binaryninja.types.TypeDefinitionLine

binaryninja.types.TypeFieldReference

binaryninja.types.TypeReferenceSource

binaryninja.types.VoidBuilder

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

binaryninja.types.VoidType

classType allows you to interact with the Binary Ninja type system. Note that therepr

binaryninja.types.WideCharBuilder

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

binaryninja.types.WideCharType

classType allows you to interact with the Binary Ninja type system. Note that therepr

binaryninja.types.convert_integer

ArrayBuilder

classArrayBuilder[source]

Bases:TypeBuilder

classmethodcreate(type:TypeBuilder|Type,element_count:int,platform:Platform|None=None,confidence:int=255)ArrayBuilder[source]
Parameters:
Return type:

ArrayBuilder

propertychildren:List[TypeBuilder]
propertycount:int
propertyelement_type:TypeBuilder

ArrayType

classArrayType[source]

Bases:Type

classmethodcreate(element_type:Type,count:int,platform:Platform|None=None,confidence:int=255)ArrayType[source]
Parameters:
Return type:

ArrayType

propertychildren:List[Type]
propertycount

Type count (read-only)

propertyelement_type:Type

BaseStructure

classBaseStructure[source]

Bases:object

BaseStructure(type: Union[ForwardRef(‘NamedTypeReferenceType’), ForwardRef(‘StructureType’)], offset: int, width: int = 0)

__init__(type:NamedTypeReferenceType|StructureType,offset:int,width:int=0)[source]
Parameters:
offset:int
type:NamedTypeReferenceType
width:int

BoolBuilder

classBoolBuilder[source]

Bases:TypeBuilder

classmethodcreate(platform:Platform|None=None,confidence:int=255)BoolBuilder[source]
Parameters:
Return type:

BoolBuilder

BoolType

classBoolType[source]

Bases:Type

classmethodcreate(platform:Platform|None=None,confidence:int=255)BoolType[source]
Parameters:
Return type:

BoolType

BoolWithConfidence

classBoolWithConfidence[source]

Bases:object

BoolWithConfidence(value: bool, confidence: int = 255)

__init__(value:bool,confidence:int=255)None
Parameters:
  • value (bool) –

  • confidence (int) –

Return type:

None

classmethodfrom_core_struct(core_struct:BNBoolWithConfidence)BoolWithConfidence[source]
Parameters:

core_struct (BNBoolWithConfidence) –

Return type:

BoolWithConfidence

staticget_core_struct(value:bool|BoolWithConfidence,confidence:int=255)BNBoolWithConfidence[source]
Parameters:
Return type:

BNBoolWithConfidence

confidence:int=255
value:bool

CharBuilder

classCharBuilder[source]

Bases:IntegerBuilder

classmethodcreate(alternate_name:str='',platform:Platform|None=None,confidence:int=255)CharBuilder[source]
Parameters:
  • alternate_name (str) –

  • platform (Platform |None) –

  • confidence (int) –

Return type:

CharBuilder

CharType

classCharType[source]

Bases:IntegerType

classmethodcreate(altname:str='char',platform:Platform|None=None,confidence:int=255)CharType[source]
Parameters:
Return type:

CharType

CoreSymbol

classCoreSymbol[source]

Bases:object

__init__(handle:LP_BNSymbol)[source]
Parameters:

handle (LP_BNSymbol) –

imported_function_from_import_address_symbol(addr:int)CoreSymbol|None[source]
Parameters:

addr (int) –

Return type:

CoreSymbol |None

propertyaddress:int

Symbol address (read-only)

propertyauto:bool

Whether the symbol was auto-defined

propertybinding:SymbolBinding

Symbol binding (read-only)

propertyfull_name:str

Symbol full name (read-only)

propertyhandle
propertyname:str

Symbol name (read-only)

propertynamespace:NameSpace

Symbol namespace (read-only)

propertyordinal:int

Symbol ordinal (read-only)

propertyraw_bytes:bytes

Bytes of the raw symbol (read-only)

propertyraw_name:str

Symbol raw name (read-only)

propertyshort_name:str

Symbol short name (read-only)

propertytype:SymbolType

Symbol type (read-only)

EnumerationBuilder

classEnumerationBuilder[source]

Bases:TypeBuilder

__init__(handle:LP_BNTypeBuilder,enum_builder_handle:LP_BNEnumerationBuilder,platform:Platform|None=None,confidence:int=255)[source]
Parameters:
  • handle (LP_BNTypeBuilder) –

  • enum_builder_handle (LP_BNEnumerationBuilder) –

  • platform (Platform |None) –

  • confidence (int) –

append(name:str,value:int|None=None)EnumerationBuilder[source]
Parameters:
  • name (str) –

  • value (int |None) –

Return type:

EnumerationBuilder

classmethodcreate(members:List[Tuple[str,int]]|List[str]|List[EnumerationMember]|None=None,width:int|None=None,arch:Architecture|None=None,sign:bool|BoolWithConfidence=False,platform:Platform|None=None,confidence:int=255)EnumerationBuilder[source]
Parameters:
Return type:

EnumerationBuilder

remove(i:int)EnumerationBuilder[source]
Parameters:

i (int) –

Return type:

EnumerationBuilder

replace(i:int,name:str,value:int)EnumerationBuilder[source]
Parameters:
Return type:

EnumerationBuilder

propertymembers:List[EnumerationMember]

Enumeration member list (read-only)

EnumerationMember

classEnumerationMember[source]

Bases:object

EnumerationMember(name: str, value: Optional[int] = None)

__init__(name:str,value:int|None=None)None
Parameters:
  • name (str) –

  • value (int |None) –

Return type:

None

name:str
value:int|None=None

EnumerationType

classEnumerationType[source]

Bases:IntegerType

__init__(handle,platform:Platform|None=None,confidence:int=255)[source]
Parameters:
classmethodcreate(members:List[Tuple[str,int]]|List[str]|List[EnumerationMember],width:int|None=None,arch:Architecture|None=None,sign:bool|BoolWithConfidence=False,platform:Platform|None=None,confidence:int=255)EnumerationType[source]
Parameters:
Return type:

EnumerationType

generate_named_type_reference(guid:str,name:Iterable[str|bytes]|str|QualifiedName)[source]
Parameters:
mutable_copy()EnumerationBuilder[source]
Return type:

EnumerationBuilder

propertymembers

Enumeration member list (read-only)

FloatBuilder

classFloatBuilder[source]

Bases:TypeBuilder

classmethodcreate(width:int,alternate_name:str='',platform:Platform|None=None,confidence:int=255)FloatBuilder[source]
Parameters:
  • width (int) –

  • alternate_name (str) –

  • platform (Platform |None) –

  • confidence (int) –

Return type:

FloatBuilder

FloatType

classFloatType[source]

Bases:Type

classmethodcreate(width:int,altname:str='',platform:Platform|None=None,confidence:int=255)FloatType[source]

float class method for creating floating point Types.

Parameters:
  • width (int) – width of the floating point number in bytes

  • altname (str) – alternate name for type

  • platform (Platform |None) –

  • confidence (int) –

Return type:

FloatType

FunctionBuilder

classFunctionBuilder[source]

Bases:TypeBuilder

append(type:TypeBuilder|Type|FunctionParameter,name:str='')[source]
Parameters:
classmethodcreate(return_type:TypeBuilder|Type|None=None,calling_convention:CallingConvention|None=None,params:List[Type]|List[FunctionParameter]|List[Tuple[str,Type]]|None=None,var_args:bool|BoolWithConfidence|None=None,stack_adjust:int|OffsetWithConfidence|None=None,platform:_platform.Platform|None=None,confidence:int=255,can_return:BoolWithConfidence|None=None,reg_stack_adjust:Dict[architecture.RegisterName,int|OffsetWithConfidence]|None=None,return_regs:RegisterSet|List[architecture.RegisterType]|None=None,name_type:NameType=NameType.NoNameType,pure:BoolWithConfidence|None=None)FunctionBuilder[source]
Parameters:
Return type:

FunctionBuilder

propertycalling_convention:CallingConvention
propertycan_return:BoolWithConfidence
propertychildren:List[TypeBuilder]
propertyimmutable_return_value:Type
propertyparameters:List[FunctionParameter]

Type parameters list (read-only)

propertypure:BoolWithConfidence
propertyreturn_value:TypeBuilder
propertystack_adjust:OffsetWithConfidence
propertystack_adjustment:OffsetWithConfidence
propertyvariable_arguments:BoolWithConfidence

FunctionParameter

classFunctionParameter[source]

Bases:object

FunctionParameter(type: Union[ForwardRef(‘TypeBuilder’), ForwardRef(‘Type’)], name: str = ‘’, location: Optional[ForwardRef(‘variable.VariableNameAndType’)] = None)

__init__(type:TypeBuilder|Type,name:str='',location:VariableNameAndType|None=None)None
Parameters:
Return type:

None

immutable_copy()FunctionParameter[source]
Return type:

FunctionParameter

mutable_copy()FunctionParameter[source]
Return type:

FunctionParameter

location:VariableNameAndType|None=None
name:str=''
type:TypeBuilder|Type

FunctionType

classFunctionType[source]

Bases:Type

classmethodcreate(ret:Type|None=None,params:List[Type]|List[FunctionParameter]|List[Tuple[str,Type]]|None=None,calling_convention:CallingConvention|None=None,variable_arguments:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255),stack_adjust:OffsetWithConfidence=OffsetWithConfidence(value=0,confidence=255),platform:_platform.Platform|None=None,confidence:int=255,can_return:BoolWithConfidence|bool=True,reg_stack_adjust:Dict[architecture.RegisterName,int|OffsetWithConfidence]|None=None,return_regs:RegisterSet|List[architecture.RegisterType]|None=None,name_type:NameType=NameType.NoNameType,pure:BoolWithConfidence|bool=False)FunctionType[source]
Parameters:
Return type:

FunctionType

propertycalling_convention:CallingConvention|None

Calling convention (read-only)

propertycan_return:BoolWithConfidence

Whether type can return

propertychildren:List[Type]
propertyhas_variable_arguments:BoolWithConfidence

Whether type has variable arguments (read-only)

propertyparameters:List[FunctionParameter]

Type parameters list (read-only)

propertyparameters_with_all_locations:List[FunctionParameter]

Type parameters list with default locations filled in with values (read-only)

propertypure:BoolWithConfidence

Whether type is pure

propertyreturn_value:Type

Return value (read-only)

propertystack_adjustment:OffsetWithConfidence

Stack adjustment for function (read-only)

InheritedStructureMember

classInheritedStructureMember[source]

Bases:object

InheritedStructureMember(base: ‘NamedTypeReferenceType’, base_offset: int, member: binaryninja.types.StructureMember, member_index: int)

__init__(base:NamedTypeReferenceType,base_offset:int,member:StructureMember,member_index:int)None
Parameters:
Return type:

None

base:NamedTypeReferenceType
base_offset:int
member:StructureMember
member_index:int

IntegerBuilder

classIntegerBuilder[source]

Bases:TypeBuilder

classmethodcreate(width:int,sign:bool|BoolWithConfidence=True,alternate_name:str='',platform:Platform|None=None,confidence:int=255)IntegerBuilder[source]
Parameters:
Return type:

IntegerBuilder

IntegerType

classIntegerType[source]

Bases:Type

__init__(handle,platform:Platform|None=None,confidence:int=255)[source]
Parameters:
classmethodcreate(width:int,sign:bool|BoolWithConfidence=True,alternate_name:str='',platform:Platform|None=None,confidence:int=255)IntegerType[source]
Parameters:
Return type:

IntegerType

propertysigned:BoolWithConfidence

Whether type is signed (read-only)

MutableTypeBuilder

classMutableTypeBuilder[source]

Bases:Generic[TB]

MutableTypeBuilder(type: ~TB, container: Union[ForwardRef(‘binaryview.BinaryView’), ForwardRef(‘typelibrary.TypeLibrary’)], name: binaryninja.types.QualifiedName, platform: Optional[ForwardRef(‘_platform.Platform’)], confidence: int, user: bool = True)

__init__(type:TB,container:BinaryView|TypeLibrary,name:QualifiedName,platform:Platform|None,confidence:int,user:bool=True)None
Parameters:
Return type:

None

confidence:int
container:BinaryView|TypeLibrary
name:QualifiedName
platform:Platform|None
type:TB
user:bool=True

NameSpace

classNameSpace[source]

Bases:QualifiedName

staticget_core_struct(name:str|List[str]|NameSpace|None)BNNameSpace|None[source]
Parameters:

name (str |List[str]|NameSpace |None) –

Return type:

BNNameSpace |None

NamedTypeReferenceBuilder

classNamedTypeReferenceBuilder[source]

Bases:TypeBuilder

__init__(handle:LP_BNTypeBuilder,ntr_builder_handle:LP_BNNamedTypeReferenceBuilder,platform:Platform|None=None,confidence:int=255)[source]
Parameters:
  • handle (LP_BNTypeBuilder) –

  • ntr_builder_handle (LP_BNNamedTypeReferenceBuilder) –

  • platform (Platform |None) –

  • confidence (int) –

classmethodcreate(type_class:NamedTypeReferenceClass=NamedTypeReferenceClass.UnknownNamedTypeClass,type_id:str|None=None,name:Iterable[str|bytes]|str|QualifiedName='',width:int=0,align:int=1,platform:Platform|None=None,confidence:int=255,const:bool|BoolWithConfidence=False,volatile:bool|BoolWithConfidence=False)NamedTypeReferenceBuilder[source]
Parameters:
Return type:

NamedTypeReferenceBuilder

staticnamed_type(named_type:NamedTypeReferenceBuilder,width:int=0,align:int=1,const:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255),volatile:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255))NamedTypeReferenceBuilder[source]
Parameters:
Return type:

NamedTypeReferenceBuilder

staticnamed_type_from_registered_type(view:BinaryView,name:Iterable[str|bytes]|str|QualifiedName)NamedTypeReferenceBuilder[source]
Parameters:
Return type:

NamedTypeReferenceBuilder

staticnamed_type_from_type(name:Iterable[str|bytes]|str|QualifiedName,type_class:NamedTypeReferenceClass|None=None)NamedTypeReferenceBuilder[source]
Parameters:
Return type:

NamedTypeReferenceBuilder

staticnamed_type_from_type_and_id(type_id:str,name:Iterable[str|bytes]|str|QualifiedName,type:Type|None=None)NamedTypeReferenceBuilder[source]
Parameters:
Return type:

NamedTypeReferenceBuilder

propertyid:str
propertyname:QualifiedName
propertynamed_type_class:NamedTypeReferenceClass
propertytype_id:str

NamedTypeReferenceType

classNamedTypeReferenceType[source]

Bases:Type

__init__(handle,platform:Platform|None=None,confidence:int=255,ntr_handle=None)[source]
Parameters:
classmethodcreate(named_type_class:NamedTypeReferenceClass,guid:str|None,name:Iterable[str|bytes]|str|QualifiedName,alignment:int=0,width:int=0,platform:Platform|None=None,confidence:int=255,const:bool|BoolWithConfidence=False,volatile:bool|BoolWithConfidence=False)NamedTypeReferenceType[source]
Parameters:
Return type:

NamedTypeReferenceType

classmethodcreate_from_handle(ntr_handle,alignment:int=0,width:int=0,platform:Platform|None=None,confidence:int=255,const:bool|BoolWithConfidence=False,volatile:bool|BoolWithConfidence=False)[source]

Create a NamedTypeReferenceType from a BNNamedTypeReference handle

Parameters:
classmethodcreate_from_registered_type(view:BinaryView,name:Iterable[str|bytes]|str|QualifiedName,platform:Platform|None=None,confidence:int=255)NamedTypeReferenceType[source]
Parameters:
Return type:

NamedTypeReferenceType

classmethodcreate_from_type(name:Iterable[str|bytes]|str|QualifiedName,type:Type|None,guid:str|None=None,platform:Platform|None=None,confidence:int=255,const:bool|BoolWithConfidence=False,volatile:bool|BoolWithConfidence=False)NamedTypeReferenceType[source]
Parameters:
Return type:

NamedTypeReferenceType

staticgenerate_auto_demangled_type_ref(type_class:NamedTypeReferenceClass,name:Iterable[str|bytes]|str|QualifiedName)[source]
Parameters:
staticgenerate_auto_type_ref(type_class:NamedTypeReferenceClass,source:str,name:Iterable[str|bytes]|str|QualifiedName)[source]
Parameters:
mutable_copy()[source]
target(bv:BinaryView)Type|None[source]

Returns the type pointed to by the current type

Parameters:

bv (BinaryView) – The BinaryView in which this type is defined.

Returns:

The type this NamedTypeReference is referencing

Return type:

Optional[Type]

propertyname:QualifiedName
propertynamed_type_class:NamedTypeReferenceClass
propertytype_id:str

OffsetWithConfidence

classOffsetWithConfidence[source]

Bases:object

OffsetWithConfidence(value: int, confidence: int = 255)

__init__(value:int,confidence:int=255)None
Parameters:
  • value (int) –

  • confidence (int) –

Return type:

None

classmethodfrom_core_struct(core_struct:BNOffsetWithConfidence)OffsetWithConfidence[source]
Parameters:

core_struct (BNOffsetWithConfidence) –

Return type:

OffsetWithConfidence

staticget_core_struct(value:int|OffsetWithConfidence,confidence:int=255)BNOffsetWithConfidence[source]
Parameters:
Return type:

BNOffsetWithConfidence

confidence:int=255
value:int

PointerBuilder

classPointerBuilder[source]

Bases:TypeBuilder

add_pointer_suffix(suffix:PointerSuffix)[source]

Append a suffix to the pointer, must be one defined inPointerSuffix.:param suffix: New suffix

Parameters:

suffix (PointerSuffix) –

classmethodcreate(type:Type,width:int=4,arch:Architecture|None=None,const:bool|BoolWithConfidence=False,volatile:bool|BoolWithConfidence=False,ref_type:ReferenceType=ReferenceType.PointerReferenceType,platform:Platform|None=None,confidence:int=255)PointerBuilder[source]
Parameters:
Return type:

PointerBuilder

get_pointer_suffix_tokens(base_confidence:int=255)List[InstructionTextToken][source]

Get the pointer suffix, as a list of tokens:param base_confidence: (optional) Confidence value to combine with the pointer’s confidence:return: Token list

Parameters:

base_confidence (int) –

Return type:

List[InstructionTextToken]

set_pointer_base(base_type:PointerBaseType,base_offset:int)[source]

Set the pointer base type and offset:param base_type: Base type, e.g. __based(start) is RelativeToBinaryStartPointerBaseType:param base_offset: Base offset, e.g. __based(start, 0x1000) is 0x1000

Parameters:
propertychildren:List[TypeBuilder]
propertyimmutable_target:Type
propertyoffset:int

Currently not used and has no effect (Leaving this in for compatibility)

propertyorigin:Tuple[QualifiedName,int]|None
propertypointer_base_offset:int

Pointer base offset, e.g. __based(start, 0x1000) is 0x1000

propertypointer_base_type:PointerBaseType

Pointer base type, e.g. __based(start) is RelativeToBinaryStartPointerBaseType

propertypointer_suffix:List[PointerSuffix]

Pointer suffix, e.g. __unaligned is [UnalignedSuffix] (read-only)

propertypointer_suffix_string:str

Pointer suffix, but as a string, e.g. “__unaligned” (read-only)

propertytarget:TypeBuilder

PointerType

classPointerType[source]

Bases:Type

classmethodcreate(arch:Architecture,type:TypeBuilder|Type,const:bool|BoolWithConfidence=False,volatile:bool|BoolWithConfidence=False,ref_type:ReferenceType=ReferenceType.PointerReferenceType,platform:Platform|None=None,confidence:int=255)PointerType[source]
Parameters:
Return type:

PointerType

classmethodcreate_with_width(width:int,type:TypeBuilder|Type,const:bool|BoolWithConfidence=False,volatile:bool|BoolWithConfidence=False,ref_type:ReferenceType|None=None,platform:Platform|None=None,confidence:int=255)PointerType[source]
Parameters:
Return type:

PointerType

staticfrom_bools(const:bool|BoolWithConfidence,volatile:bool|BoolWithConfidence)Tuple[BoolWithConfidence,BoolWithConfidence][source]
Parameters:
Return type:

Tuple[BoolWithConfidence,BoolWithConfidence]

get_pointer_suffix_tokens(base_confidence:int=255)List[InstructionTextToken][source]

Get the pointer suffix, as a list of tokens:param base_confidence: (optional) Confidence value to combine with the pointer’s confidence:return: Token list

Parameters:

base_confidence (int) –

Return type:

List[InstructionTextToken]

origin(bv:BinaryView|None)Tuple[QualifiedName,int]|None[source]
Parameters:

bv (BinaryView |None) –

Return type:

Tuple[QualifiedName,int] |None

propertychildren:List[Type]
propertypointer_base_offset:int

Pointer base offset, e.g. __based(start, 0x1000) is 0x1000 (read-only)

propertypointer_base_type:PointerBaseType

Pointer base type, e.g. __based(start) is RelativeToBinaryStartPointerBaseType (read-only)

propertypointer_suffix:List[PointerSuffix]

Pointer suffix, e.g. __unaligned is [UnalignedSuffix] (read-only)

propertypointer_suffix_string:str

Pointer suffix, but as a string, e.g. “__unaligned” (read-only)

propertyref_type:ReferenceType
propertytarget:Type

Target (read-only)

QualifiedName

classQualifiedName[source]

Bases:object

__init__(name:Iterable[str|bytes]|str|QualifiedName|None=None)[source]
Parameters:

name (Iterable[str |bytes]|str |QualifiedName |None) –

staticescape(name:Iterable[str|bytes]|str|QualifiedName,escaping:TokenEscapingType)str[source]
Parameters:
Return type:

str

staticunescape(name:Iterable[str|bytes]|str|QualifiedName,escaping:TokenEscapingType)str[source]
Parameters:
Return type:

str

propertyname:List[str]

RegisterSet

classRegisterSet[source]

Bases:object

RegisterSet(regs: List[ForwardRef(‘architecture.RegisterName’)], confidence: int = 255)

__init__(regs:List[RegisterName],confidence:int=255)None
Parameters:
  • regs (List[RegisterName]) –

  • confidence (int) –

Return type:

None

with_confidence(confidence)[source]
confidence:int=255
regs:List[RegisterName]

RegisterStackAdjustmentWithConfidence

classRegisterStackAdjustmentWithConfidence[source]

Bases:object

RegisterStackAdjustmentWithConfidence(value: int, confidence: int = 255)

__init__(value:int,confidence:int=255)None
Parameters:
  • value (int) –

  • confidence (int) –

Return type:

None

confidence:int=255
value:int

StructureBuilder

classStructureBuilder[source]

Bases:TypeBuilder

__init__(handle:LP_BNTypeBuilder,builder_handle:LP_BNStructureBuilder,platform:Platform|None=None,confidence:int=255)[source]
Parameters:
  • handle (LP_BNTypeBuilder) –

  • builder_handle (LP_BNStructureBuilder) –

  • platform (Platform |None) –

  • confidence (int) –

add_member_at_offset(name:str,type:TypeBuilder|Type,offset:int,overwrite_existing:bool=True,access:MemberAccess=MemberAccess.NoAccess,scope:MemberScope=MemberScope.NoScope,bit_position:int=0,bit_width:int=0)StructureBuilder[source]
Parameters:
Return type:

StructureBuilder

append(type:TypeBuilder|Type,name:str='',access:MemberAccess=MemberAccess.NoAccess,scope:MemberScope=MemberScope.NoScope)StructureBuilder[source]
Parameters:
Return type:

StructureBuilder

classmethodcreate(members:List[StructureMember]|List[Type]|List[Tuple[Type,str]]|None=None,type:StructureVariant=StructureVariant.StructStructureType,packed:bool=False,width:int|None=None,platform:Platform|None=None,confidence:int=255)StructureBuilder[source]
Parameters:
Return type:

StructureBuilder

index_by_name(name:str)int|None[source]
Parameters:

name (str) –

Return type:

int |None

index_by_offset(offset:int)int|None[source]
Parameters:

offset (int) –

Return type:

int |None

insert(offset:int,type:TypeBuilder|Type,name:str='',overwrite_existing:bool=True,access:MemberAccess=MemberAccess.NoAccess,scope:MemberScope=MemberScope.NoScope,bit_position:int=0,bit_width:int=0)[source]
Parameters:
member_at_offset(offset:int)StructureMember|None[source]
Parameters:

offset (int) –

Return type:

StructureMember |None

remove(index:int)[source]
Parameters:

index (int) –

replace(index:int,type:TypeBuilder|Type,name:str='',overwrite_existing:bool=True)[source]
Parameters:
propertyalignment:int
propertybase_structures:List[BaseStructure]

Base structure list. Offsets that are not defined by this structure will be filledin by the fields of the base structure(s).

propertychildren:List[TypeBuilder]
propertymembers:List[StructureMember]

Structure member list (read-only)

propertypacked:bool
propertypointer_offset:int
propertypropagate_data_var_refs:bool
propertytype:StructureVariant
propertyunion:bool
propertywidth:int

StructureMember

classStructureMember[source]

Bases:object

StructureMember(type: ‘Type’, name: str, offset: int, access: binaryninja.enums.MemberAccess = <MemberAccess.NoAccess: 0>, scope: binaryninja.enums.MemberScope = <MemberScope.NoScope: 0>, bit_position: int = 0, bit_width: int = 0)

__init__(type:Type,name:str,offset:int,access:MemberAccess=MemberAccess.NoAccess,scope:MemberScope=MemberScope.NoScope,bit_position:int=0,bit_width:int=0)None
Parameters:
Return type:

None

access:MemberAccess=0
propertybit_offset:int

Total bit offset from the start of the structure.

Computed as: offset * 8 + bit_position.

bit_position:int=0
bit_width:int=0
name:str
offset:int
scope:MemberScope=0
type:Type

StructureType

classStructureType[source]

Bases:Type

__init__(handle,platform:Platform|None=None,confidence:int=255)[source]
Parameters:
classmethodcreate(members:List[StructureMember]|List[Type]|List[Tuple[Type,str]]|None=None,packed:bool=False,type:StructureVariant=StructureVariant.StructStructureType,platform:Platform|None=None,confidence:int=255)StructureType[source]
Parameters:
Return type:

StructureType

classmethodfrom_core_struct(structure:BNStructure)StructureType[source]
Parameters:

structure (BNStructure) –

Return type:

StructureType

generate_named_type_reference(guid:str,name:Iterable[str|bytes]|str|QualifiedName)[source]
Parameters:
member_at_offset(offset:int)StructureMember[source]
Parameters:

offset (int) –

Return type:

StructureMember

member_at_offset_including_inherited(view:BinaryView,offset:int)InheritedStructureMember[source]

Returns the member (including inherited member at the specified offset

Parameters:
Return type:

InheritedStructureMember

members_including_inherited(view:BinaryView|TypeContainer)List[InheritedStructureMember][source]

Returns structure member list, including those inherited by base structures

Parameters:

view (BinaryView |TypeContainer) –

Return type:

List[InheritedStructureMember]

mutable_copy()StructureBuilder[source]
Return type:

StructureBuilder

resolve_member_or_base_member(view:BinaryView|None,offset:int,size:int,resolve_func:Callable[[NamedTypeReferenceType,StructureType,int,int,int,StructureMember],None],member_index_hint:int|None=None)bool[source]
Parameters:
Return type:

bool

with_replaced_enumeration(from_enum,to_enum)StructureType[source]
Return type:

StructureType

with_replaced_named_type_reference(from_ref,to_ref)StructureType[source]
Return type:

StructureType

with_replaced_structure(from_struct,to_struct)StructureType[source]
Return type:

StructureType

propertyalignment

Structure alignment

propertybase_structures:List[BaseStructure]

Base structure list (read-only). Offsets that are not defined by this structure will be filledin by the fields of the base structure(s).

propertychildren:List[Type]
propertymembers

Structure member list (read-only). This list willnot contain members inherited from base structures.To get members including inherited ones, callmembers_including_inherited.

propertypacked
propertypointer_offset

Structure pointer offset. Pointers to this structure will implicitlyhave this offset subtracted from the pointer to arrive at the start of the structure.Effectively, the pointer offset becomes the new start of the structure, and fieldsbefore it are accessed using negative offsets from the pointer.

propertypropagate_data_var_refs:bool

Whether structure field references propagate the references to data variable field values

propertytype:StructureVariant
propertywidth

Structure width

Symbol

classSymbol[source]

Bases:CoreSymbol

Symbols are defined as one of the following types:

SymbolType

Description

FunctionSymbol

Symbol for function that exists in the current binary

ImportAddressSymbol

Symbol defined in the Import Address Table

ImportedFunctionSymbol

Symbol for a function that is not defined in the current binary

DataSymbol

Symbol for data in the current binary

ImportedDataSymbol

Symbol for data that is not defined in the current binary

ExternalSymbol

Symbols for data and code that reside outside the BinaryView

LibraryFunctionSymbol

Symbols for functions identified as belonging to a shared library

SymbolicFunctionSymbol

Symbols for functions without a concrete implementation or which have been abstractly represented

LocalLabelSymbol

Symbol for a local label in the current binary

__init__(sym_type,addr,short_name,full_name=None,raw_name=None,binding=None,namespace=None,ordinal=0)[source]

Type

classType[source]

Bases:object

classType allows you to interact with the Binary Ninja type system. Note that therepr andstrhandlers respond differently on type objects.

Other related functions that may be helpful include:

parse_type_stringparse_types_from_sourceparse_types_from_source_file

__init__(handle,platform:Platform|None=None,confidence:int=255)[source]
Parameters:
staticarray(type:Type,count:int)ArrayType[source]
Parameters:
Return type:

ArrayType

staticbool()BoolType[source]
Return type:

BoolType

staticbuilder(bv:BinaryView,name:QualifiedName|None=None,id:str|None=None,platform:Platform|None=None,confidence:int=255)MutableTypeBuilder[source]
Parameters:
Return type:

MutableTypeBuilder

staticchar(alternate_name:str='')CharType[source]
Parameters:

alternate_name (str) –

Return type:

CharType

staticclass_type(members:List[StructureMember]|List[Type]|List[Tuple[Type,str]]|None=None,packed:bool=False)StructureType[source]
Parameters:
Return type:

StructureType

classmethodcreate(handle:LP_BNType,platform:Platform|None=None,confidence:int=255)Type[source]
Parameters:
  • handle (LP_BNType) –

  • platform (Platform |None) –

  • confidence (int) –

Return type:

Type

deref_named_type_reference(view:BinaryView)Type[source]

Dereferences any named type references to find the underlying type. This may still return anamed type reference if there are circular references. If the type isn’t a named typereference, the input type is returned unchanged.

Parameters:

view (BinaryView) – BinaryView object owning this Type

Returns:

Type with named type references resolved

Return type:

Type

staticenumeration(arch:Architecture|None=None,members:List[Tuple[str,int]]|List[str]|List[EnumerationMember]|None=None,width:int|None=None,sign:bool|BoolWithConfidence=False)EnumerationType[source]
Parameters:
Return type:

EnumerationType

staticenumeration_type(arch,enum:EnumerationBuilder,width:int|None=None,sign:bool=False)EnumerationType[source]
Parameters:
Return type:

EnumerationType

staticfloat(width:int,alternate_name:str='')FloatType[source]

float class method for creating floating point Types.

Parameters:
  • width (int) – width of the floating point number in bytes

  • alternate_name (str) – alternate name for type

Return type:

FloatType

staticfrom_core_struct(core_type:BNType)[source]
Parameters:

core_type (BNType) –

staticfunction(ret:Type|None=None,params:List[Type]|List[FunctionParameter]|List[Tuple[str,Type]]|None=None,calling_convention:CallingConvention|None=None,variable_arguments:bool|BoolWithConfidence=False,stack_adjust:OffsetWithConfidence=OffsetWithConfidence(value=0,confidence=255))FunctionType[source]

function class method for creating a function Type.

Parameters:
  • ret (Type) – return Type of the function

  • params (list(Type)) – list of parameter Types

  • calling_convention (CallingConvention) – optional argument for the function calling convention

  • variable_arguments (bool) – optional boolean, true if the function has a variable number of arguments

  • stack_adjust (OffsetWithConfidence) –

Return type:

FunctionType

staticgenerate_auto_demangled_type_id(name:Iterable[str|bytes]|str|QualifiedName)str[source]
Parameters:

name (Iterable[str |bytes]|str |QualifiedName) –

Return type:

str

staticgenerate_auto_type_id(source:str,name:Iterable[str|bytes]|str|QualifiedName)str[source]
Parameters:
Return type:

str

staticgenerate_named_type_reference(guid:str,name:Iterable[str|bytes]|str|QualifiedName)NamedTypeReferenceType[source]
Parameters:
Return type:

NamedTypeReferenceType

staticget_auto_demangled_type_id_source()str[source]
Return type:

str

get_builder(bv:BinaryView)MutableTypeBuilder[source]
Parameters:

bv (BinaryView) –

Return type:

MutableTypeBuilder

get_lines(bv:BinaryView|TypeContainer,name:str|QualifiedName,padding_cols:int=64,collapsed:bool=False,escaping:TokenEscapingType=TokenEscapingType.NoTokenEscapingType)List[TypeDefinitionLine][source]

Get a list ofTypeDefinitionLine structures for representing a Type in a structured form.This structure uses the same logic as Types View and will expand structures and enumerationsunlesscollapsed is set.

Parameters:
  • bv (BinaryView) – BinaryView object owning this Type

  • name (str) – Displayed name of the Type

  • padding_cols (int) – Maximum number of bytes represented by each padding line

  • collapsed (bool) – If the type should be collapsed, and not show fields/members

  • escaping (TokenEscapingType) – How to escape non-parsable strings in types

Returns:

Returns a list ofTypeDefinitionLine structures

Return type:

TypeDefinitionLine

get_string(escaping:TokenEscapingType=TokenEscapingType.NoTokenEscapingType)str[source]

Get string representation for this type

Parameters:

escaping (TokenEscapingType) – How to escape non-parsable strings in types

Returns:

String for type

Return type:

str

Example:
>>>Type.array(Type.int(4),10).get_string()'int32_t[0xa]'
get_string_after_name(escaping:TokenEscapingType=TokenEscapingType.NoTokenEscapingType)str[source]

Get the string to be printed after this type’s name in a representation

Parameters:

escaping (TokenEscapingType) – How to escape non-parsable strings in types

Returns:

String for type representation after the name

Return type:

str

Example:
>>>Type.array(Type.int(4),10).get_string()'int32_t[0xa]'>>>Type.array(Type.int(4),10).get_string_after_name()'[0xa]'
get_string_before_name(escaping:TokenEscapingType=TokenEscapingType.NoTokenEscapingType)str[source]

Get the string to be printed before this type’s name in a representation of it

Parameters:

escaping (TokenEscapingType) – How to escape non-parsable strings in types

Returns:

String for type representation before the name

Return type:

str

Example:
>>>Type.array(Type.int(4),10).get_string()'int32_t[0xa]'>>>Type.array(Type.int(4),10).get_string_before_name()'int32_t'
get_tokens(base_confidence=255,escaping:TokenEscapingType=TokenEscapingType.NoTokenEscapingType)List[InstructionTextToken][source]

Get a list of tokens for the definition of a type

Parameters:
  • base_confidence (int) – Confidence of this type

  • escaping (TokenEscapingType) – How to escape non-parsable strings in types

Returns:

List of tokens

Return type:

List[_function.InstructionTextToken]

Example:
>>>Type.array(Type.int(4),10).get_string()'int32_t[0xa]'>>>Type.array(Type.int(4),10).get_tokens()['int32_t', ' ', '[', '0xa', ']']
get_tokens_after_name(base_confidence=255,escaping:TokenEscapingType=TokenEscapingType.NoTokenEscapingType)List[InstructionTextToken][source]

Get a list of tokens for the definition of a type that are placed after the type name

Parameters:
  • base_confidence (int) – Confidence of this type

  • escaping (TokenEscapingType) – How to escape non-parsable strings in types

Returns:

List of tokens

Return type:

List[_function.InstructionTextToken]

Example:
>>>Type.array(Type.int(4),10).get_string()'int32_t[0xa]'>>>Type.array(Type.int(4),10).get_tokens_after_name()['[', '0xa', ']']
get_tokens_before_name(base_confidence=255,escaping:TokenEscapingType=TokenEscapingType.NoTokenEscapingType)List[InstructionTextToken][source]

Get a list of tokens for the definition of a type that are placed before the type name

Parameters:
  • base_confidence (int) – Confidence of this type

  • escaping (TokenEscapingType) – How to escape non-parsable strings in types

Returns:

List of tokens

Return type:

List[_function.InstructionTextToken]

Example:
>>>Type.array(Type.int(4),10).get_string()'int32_t[0xa]'>>>Type.array(Type.int(4),10).get_tokens_before_name()['int32_t']
immutable_copy()Type[source]
Return type:

Type

staticint(width:int,sign:bool|BoolWithConfidence=True,alternate_name:str='')IntegerType[source]

int class method for creating an int Type.

Parameters:
  • width (int) – width of the integer in bytes

  • sign (bool) – optional variable representing signedness

  • alternate_name (str) – alternate name for type

Return type:

IntegerType

mutable_copy()TypeBuilder[source]
Return type:

TypeBuilder

staticnamed_type(named_type:NamedTypeReferenceBuilder)NamedTypeReferenceType[source]
Parameters:

named_type (NamedTypeReferenceBuilder) –

Return type:

NamedTypeReferenceType

staticnamed_type_from_registered_type(view:BinaryView,name:Iterable[str|bytes]|str|QualifiedName)NamedTypeReferenceType[source]
Parameters:
Return type:

NamedTypeReferenceType

staticnamed_type_from_type(name:Iterable[str|bytes]|str|QualifiedName,type:Type)NamedTypeReferenceType[source]
Parameters:
Return type:

NamedTypeReferenceType

staticnamed_type_from_type_and_id(type_id:str,name:Iterable[str|bytes]|str|QualifiedName,type:Type|None=None)NamedTypeReferenceType[source]
Parameters:
Return type:

NamedTypeReferenceType

staticnamed_type_reference(type_class:NamedTypeReferenceClass,name:Iterable[str|bytes]|str|QualifiedName,type_id:str|None=None,alignment:int=1,width:int=0,const:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255),volatile:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255))[source]
Parameters:
staticpointer(arch:Architecture,type:Type,const:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255),volatile:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255),ref_type:ReferenceType=ReferenceType.PointerReferenceType,width:int|None=None)PointerType[source]
Parameters:
Return type:

PointerType

staticpointer_of_width(width:int,type:Type,const:bool|BoolWithConfidence=False,volatile:bool|BoolWithConfidence=False,ref_type:ReferenceType=ReferenceType.PointerReferenceType)PointerType[source]
Parameters:
Return type:

PointerType

staticstructure(members:List[StructureMember]|List[Type]|List[Tuple[Type,str]]|None=None,packed:bool=False,type:StructureVariant=StructureVariant.StructStructureType)StructureType[source]
Parameters:
Return type:

StructureType

staticstructure_type(structure:StructureBuilder)StructureType[source]
Parameters:

structure (StructureBuilder) –

Return type:

StructureType

staticunion(members:List[StructureMember]|List[Type]|List[Tuple[Type,str]]|None=None,packed:bool=False)StructureType[source]
Parameters:
Return type:

StructureType

staticvoid()VoidType[source]
Return type:

VoidType

staticwide_char(width:int,alternate_name:str='')WideCharType[source]

wide_char class method for creating wide char Types.

Parameters:
  • width (int) – width of the wide character in bytes

  • alternate_name (str) – alternate name for type

Return type:

WideCharType

with_confidence(confidence:int)Type[source]
Parameters:

confidence (int) –

Return type:

Type

with_replaced_enumeration(from_enum:EnumerationType,to_enum:EnumerationType)[source]
Parameters:
with_replaced_named_type_reference(from_ref:NamedTypeReferenceType,to_ref:NamedTypeReferenceType)[source]
Parameters:
with_replaced_structure(from_struct:StructureType,to_struct:StructureType)[source]
Parameters:
propertyalignment:int

Type alignment (read-only)

propertyaltname:str

Alternative name for the type object

propertyattributes:Dict[str,str]

Attribute names and their values

propertychildren:List[Type]
propertyconfidence:int
propertyconst

Whether type is const (read/write)

propertyhandle
propertyname:QualifiedName
propertyoffset:int

Offset into structure (read-only)

propertyplatform:Platform|None
propertyregistered_name:NamedTypeReferenceType|None

Name of type registered to binary view, if any (read-only)

propertysystem_call_number:int|None

Returns the system call number for a FunctionType object if one exists otherwise None

propertytokens:List[InstructionTextToken]

Type string as a list of tokens (read-only)

propertytype_class:TypeClass

Type class (read-only)

propertyvolatile

Whether type is volatile (read/write)

propertywidth:int

Type width (read-only)

TypeBuilder

classTypeBuilder[source]

Bases:object

All TypeBuilder objects should not be instantiated directly but created via.create APIs.

__init__(handle:LP_BNTypeBuilder,platform:Platform|None=None,confidence:int=255)[source]
Parameters:
  • handle (LP_BNTypeBuilder) –

  • platform (Platform |None) –

  • confidence (int) –

staticarray(type:Type,count:int)ArrayBuilder[source]
Parameters:
Return type:

ArrayBuilder

staticbool()BoolBuilder[source]
Return type:

BoolBuilder

classmethodbuilder(container:BinaryView|TypeLibrary,name:QualifiedName,user:bool=True,platform:Platform|None=None,confidence:int=255)MutableTypeBuilder[TB][source]
Parameters:
Return type:

MutableTypeBuilder[TB]

staticchar(alternate_name:str='')CharBuilder[source]
Parameters:

alternate_name (str) –

Return type:

CharBuilder

staticclass_type(members:List[StructureMember]|List[Type]|List[Tuple[Type,str]]|None=None,packed:bool=False)StructureBuilder[source]
Parameters:
Return type:

StructureBuilder

clear_system_call()None[source]
Return type:

None

classmethodcreate()[source]
staticenumeration(arch:Architecture|None=None,members:List[Tuple[str,int]]|List[str]|List[EnumerationMember]|None=None,width:int|None=None,sign:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255))EnumerationBuilder[source]
Parameters:
Return type:

EnumerationBuilder

staticfloat(width:int,altname:str='')FloatBuilder[source]

float class method for creating floating point Types.

Parameters:
  • width (int) – width of the floating point number in bytes

  • altname (str) – alternate name for type

Return type:

FloatBuilder

staticfunction(ret:Type|None=None,params:List[Type]|List[FunctionParameter]|List[Tuple[str,Type]]|None=None,calling_convention:CallingConvention|None=None,variable_arguments:bool|BoolWithConfidence|None=None,stack_adjust:int|OffsetWithConfidence|None=None)FunctionBuilder[source]

function class method for creating a function Type.

Parameters:
  • ret (Type) – return Type of the function

  • params (list(Type)) – list of parameter Types

  • calling_convention (CallingConvention) – optional argument for the function calling convention

  • variable_arguments (bool) – optional boolean, true if the function has a variable number of arguments

  • stack_adjust (int |OffsetWithConfidence |None) –

Return type:

FunctionBuilder

immutable_copy()[source]
staticint(width:int,sign:bool|BoolWithConfidence=BoolWithConfidence(value=True,confidence=255),altname:str='')IntegerBuilder[source]

int class method for creating an int Type.

Parameters:
  • width (int) – width of the integer in bytes

  • sign (bool) – optional variable representing signedness

  • altname (str) – alternate name for type

Return type:

IntegerBuilder

mutable_copy()TypeBuilder[source]
Return type:

TypeBuilder

staticnamed_type_from_registered_type(view:BinaryView,name:QualifiedName)NamedTypeReferenceBuilder[source]
Parameters:
Return type:

NamedTypeReferenceBuilder

staticnamed_type_from_type(name:Iterable[str|bytes]|str|QualifiedName,type_class:NamedTypeReferenceClass|None=None)NamedTypeReferenceBuilder[source]
Parameters:
Return type:

NamedTypeReferenceBuilder

staticnamed_type_from_type_and_id(type_id:str,name:Iterable[str|bytes]|str|QualifiedName,type:Type|None=None)NamedTypeReferenceBuilder[source]
Parameters:
Return type:

NamedTypeReferenceBuilder

staticnamed_type_reference(type_class:NamedTypeReferenceClass,name:QualifiedName,type_id:str|None=None,alignment:int=1,width:int=0,const:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255),volatile:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255))NamedTypeReferenceBuilder[source]
Parameters:
Return type:

NamedTypeReferenceBuilder

staticpointer(arch:Architecture,type:Type,const:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255),volatile:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255),ref_type:ReferenceType=ReferenceType.PointerReferenceType)PointerBuilder[source]
Parameters:
Return type:

PointerBuilder

staticpointer_of_width(width:int,type:Type,const:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255),volatile:bool|BoolWithConfidence=BoolWithConfidence(value=False,confidence=255),ref_type:ReferenceType=ReferenceType.PointerReferenceType)PointerBuilder[source]
Parameters:
Return type:

PointerBuilder

staticstructure(members:List[StructureMember]|List[Type]|List[Tuple[Type,str]]|None=None,packed:bool=False,type:StructureVariant=StructureVariant.StructStructureType)StructureBuilder[source]
Parameters:
Return type:

StructureBuilder

staticunion(members:List[StructureMember]|List[Type]|List[Tuple[Type,str]]|None=None,packed:bool=False)StructureBuilder[source]
Parameters:
Return type:

StructureBuilder

staticvoid()VoidBuilder[source]
Return type:

VoidBuilder

staticwide_char(width:int,altname:str='')WideCharBuilder[source]

wide_char class method for creating wide char Types.

Parameters:
  • width (int) – width of the wide character in bytes

  • altname (str) – alternate name for type

Return type:

WideCharBuilder

propertyalignment:int
propertyalternate_name:str|None
propertyattributes:Dict[str,str]

Attribute names and their values

propertychild:Type
propertychildren:List[TypeBuilder]
propertyconst:BoolWithConfidence

Whether type is const (read/write)

propertyhandle:LP_BNType
propertysigned:BoolWithConfidence
propertysystem_call_number:int|None

Gets/Sets the system call number for a FunctionType object if one exists otherwise None

propertytype_class:TypeClass
propertyvolatile:BoolWithConfidence

Whether type is volatile (read/write)

propertywidth:int

TypeBuilderAttributes

classTypeBuilderAttributes[source]

Bases:dict

__init__(builder,*args)[source]

TypeDefinitionLine

classTypeDefinitionLine[source]

Bases:object

TypeDefinitionLine(line_type: binaryninja.enums.TypeDefinitionLineType, tokens: List[ForwardRef(‘_function.InstructionTextToken’)], type: ‘Type’, parent_type: ‘Type’, root_type: ‘Type’, root_type_name: str, base_type: Optional[ForwardRef(‘NamedTypeReferenceType’)], base_offset: int, offset: int, field_index: int)

__init__(line_type:TypeDefinitionLineType,tokens:List[InstructionTextToken],type:Type,parent_type:Type,root_type:Type,root_type_name:str,base_type:NamedTypeReferenceType|None,base_offset:int,offset:int,field_index:int)None
Parameters:
Return type:

None

base_offset:int
base_type:NamedTypeReferenceType|None
field_index:int
line_type:TypeDefinitionLineType
offset:int
parent_type:Type
root_type:Type
root_type_name:str
tokens:List[InstructionTextToken]
type:Type

TypeFieldReference

classTypeFieldReference[source]

Bases:object

TypeFieldReference(func: Optional[ForwardRef(‘_function.Function’)], arch: Optional[ForwardRef(‘architecture.Architecture’)], address: int, size: int, incomingType: Optional[binaryninja.types.Type])

__init__(func:Function|None,arch:Architecture|None,address:int,size:int,incomingType:Type|None)None
Parameters:
Return type:

None

address:int
arch:Architecture|None
func:Function|None
incomingType:Type|None
size:int

TypeReferenceSource

classTypeReferenceSource[source]

Bases:object

TypeReferenceSource(name: binaryninja.types.QualifiedName, offset: int, ref_type: binaryninja.enums.TypeReferenceType)

__init__(name:QualifiedName,offset:int,ref_type:TypeReferenceType)None
Parameters:
Return type:

None

name:QualifiedName
offset:int
ref_type:TypeReferenceType

VoidBuilder

classVoidBuilder[source]

Bases:TypeBuilder

classmethodcreate(platform:Platform|None=None,confidence:int=255)VoidBuilder[source]
Parameters:
Return type:

VoidBuilder

VoidType

classVoidType[source]

Bases:Type

classmethodcreate(platform:Platform|None=None,confidence:int=255)VoidType[source]
Parameters:
Return type:

VoidType

WideCharBuilder

classWideCharBuilder[source]

Bases:TypeBuilder

classmethodcreate(width:int,alternate_name:str='',platform:Platform|None=None,confidence:int=255)WideCharBuilder[source]
Parameters:
  • width (int) –

  • alternate_name (str) –

  • platform (Platform |None) –

  • confidence (int) –

Return type:

WideCharBuilder

WideCharType

classWideCharType[source]

Bases:Type

classmethodcreate(width:int,alternate_name:str='',platform:Platform|None=None,confidence:int=255)WideCharType[source]

wide_char class method for creating wide char Types.

Parameters:
  • width (int) – width of the wide character in bytes

  • alternate_name (str) – alternate name for type

  • platform (Platform |None) –

  • confidence (int) –

Return type:

WideCharType

convert_integer

classconvert_integer[source]

Bases: