# types module

`binaryninja.types.BoolWithConfidence`(value) |
`binaryninja.types.Enumeration`([handle]) |
`binaryninja.types.EnumerationMember`(name, ...) |
`binaryninja.types.FunctionParameter`(param_type) |
`binaryninja.types.NamedTypeReference`([...]) |
`binaryninja.types.QualifiedName`([name]) |
`binaryninja.types.ReferenceTypeWithConfidence`(value) |
`binaryninja.types.RegisterSet`(reg_list[, ...]) |
`binaryninja.types.RegisterStackAdjustmentWithConfidence`(value) |
`binaryninja.types.SizeWithConfidence`(value) |
`binaryninja.types.Structure`([handle]) |
`binaryninja.types.StructureMember`(t, name, ...) |
`binaryninja.types.Symbol`(sym_type, addr, ...) | Symbols are defined as one of the following types:
`binaryninja.types.Type`(handle[, platform, ...]) |
`binaryninja.types.TypeParserResult`(types, ...) |
`binaryninja.types.preprocess_source`(source) | `preprocess_source` run the C preprocessor on the given source or source filename.
`binaryninja.types.pyNativeStr`(arg) |
`binaryninja.types.range`(*args) | A Python2 and Python3 Compatible Range Generator

class `binaryninja.types.``BoolWithConfidence`(value, confidence=255)

  Bases: `object`

class `binaryninja.types.``Enumeration`(handle=None)

  Bases: `object`

  `append`(name, value=None)
  `members`

    Enumeration member list (read-only)

  `remove`(i)
  `replace`(i, name, value)

class `binaryninja.types.``EnumerationMember`(name, value, default)

  Bases: `object`

class `binaryninja.types.``FunctionParameter`(param_type, name='', location=None)

  Bases: `object`

class `binaryninja.types.``NamedTypeReference`(type_class=<NamedTypeReferenceClass.UnknownNamedTypeClass: 0>, type_id=None, name=None, handle=None)

  Bases: `object`

  classmethod `generate_auto_demangled_type_ref`(type_class, name)
  classmethod `generate_auto_type_ref`(type_class, source, name)
  `name`
  `type_class`
  `type_id`

class `binaryninja.types.``QualifiedName`(name=[])

  Bases: `object`

class `binaryninja.types.``ReferenceTypeWithConfidence`(value, confidence=255)

  Bases: `object`

class `binaryninja.types.``RegisterSet`(reg_list, confidence=255)

  Bases: `object`

  `with_confidence`(confidence)

class `binaryninja.types.``RegisterStackAdjustmentWithConfidence`(value, confidence=255)

  Bases: `object`

class `binaryninja.types.``SizeWithConfidence`(value, confidence=255)

  Bases: `object`

class `binaryninja.types.``Structure`(handle=None)

  Bases: `object`

  `alignment`

    Structure alignment

  `append`(t, name='')
  `insert`(offset, t, name='')
  `members`

    Structure member list (read-only)

  `packed`
  `remove`(i)
  `replace`(i, t, name='')
  `type`
  `union`
  `width`

    Structure width

class `binaryninja.types.``StructureMember`(t, name, offset)

  Bases: `object`

class `binaryninja.types.``Symbol`(sym_type, addr, short_name, full_name=None, raw_name=None, handle=None)

  Bases: `object`

  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 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

  `address`

    Symbol address (read-only)

  `auto`
  `full_name`

    Symbol full name (read-only)

  `name`

    Symbol name (read-only)

  `raw_name`

    Symbol raw name (read-only)

  `short_name`

    Symbol short name (read-only)

  `type`

    Symbol type (read-only)

class `binaryninja.types.``Type`(handle, platform=None, confidence=255)

  Bases: `object`

  `alignment`

    Type alignment (read-only)

  classmethod `array`(t, count)
  classmethod `bool`()
  `calling_convention`

    Calling convention (read-only)

  `can_return`

    Whether type can return (read-only)

  `const`

    Whether type is const (read-only)

  `count`

    Type count (read-only)

  `element_type`

    Target (read-only)

  `enumeration`

    Type enumeration (read-only)

  classmethod `enumeration_type`(arch, e, width=None, sign=False)
  classmethod `float`(width, altname='')

    `float` class method for creating an floating point Types.

    Parameters:

    - width (int) – width of the floating point number in bytes
    - altname (string) – alternate name for type

  classmethod `function`(ret, params, calling_convention=None, variable_arguments=None, stack_adjust=None)

    `function` class method for creating an function Type.

    Parameters:

    - ret (Type) – width of the integer in bytes
    - params (list(Type)) – list of parameter Types
    - calling_convention (CallingConvention) – optional argument for function calling convention
    - variable_arguments (bool) – optional argument for functions that have a variable number of arguments

  classmethod `generate_auto_demangled_type_id`(name)
  classmethod `generate_auto_type_id`(source, name)
  classmethod `get_auto_demangled_type_id_source`()
  `get_string_after_name`()
  `get_string_before_name`()
  `get_tokens`(base_confidence=255)
  `get_tokens_after_name`(base_confidence=255)
  `get_tokens_before_name`(base_confidence=255)
  `has_variable_arguments`

    Whether type has variable arguments (read-only)

  classmethod `int`(width, sign=None, altname='')

    `int` class method for creating an int Type.

    Parameters:

    - width (int) – width of the integer in bytes
    - sign (bool) – optional variable representing signedness
    - altname (string) – alternate name for type

  `modified`

    Whether type is modified (read-only)

  classmethod `named_type`(named_type, width=0, align=1)
  classmethod `named_type_from_registered_type`(view, name)
  classmethod `named_type_from_type`(name, t)
  classmethod `named_type_from_type_and_id`(type_id, name, t)
  `named_type_reference`

    Reference to a named type (read-only)

  `offset`

    Offset into structure (read-only)

  `parameters`

    Type parameters list (read-only)

  classmethod `pointer`(arch, t, const=None, volatile=None, ref_type=None)
  `return_value`

    Return value (read-only)

  `signed`

    Wether type is signed (read-only)

  `stack_adjustment`

    Stack adjustment for function (read-only)

  `structure`

    Structure of the type (read-only)

  classmethod `structure_type`(structure_type)
  `target`

    Target (read-only)

  `tokens`

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

  `type_class`

    Type class (read-only)

  classmethod `void`()
  `width`

    Type width (read-only)

  `with_confidence`(confidence)

class `binaryninja.types.``TypeParserResult`(types, variables, functions)

  Bases: `object`

`binaryninja.types.``preprocess_source`(source, filename=None, include_dirs=[])

  `preprocess_source` run the C preprocessor on the given source or source filename.

  Parameters:

  - source (str) – source to preprocess
  - filename (str) – optional filename to preprocess
  - include_dirs (list(str)) – list of string directorires to use as include directories.

  Returns: | returns a tuple of (preprocessed_source, error_string)
  Return type: | tuple(str,str)

  Example:

      >>> source = "#define TEN 10\nint x[TEN];\n"
      >>> preprocess_source(source)
      ('#line 1 "input"\n\n#line 2 "input"\n int x [ 10 ] ;\n', '')
      >>>