# plugin module

`binaryninja.plugin.BackgroundTask`([...]) |
`binaryninja.plugin.BackgroundTaskThread`([...]) |
`binaryninja.plugin.MainThreadAction`(handle) |
`binaryninja.plugin.MainThreadActionHandler`() |
`binaryninja.plugin.PluginCommand`(cmd) |
`binaryninja.plugin.PluginCommandContext`(view) |
`binaryninja.plugin.range`(*args) | A Python2 and Python3 Compatible Range Generator
`binaryninja.plugin.with_metaclass`(meta, *bases) | Create a base class with a metaclass.

class `binaryninja.plugin.``BackgroundTask`(initial_progress_text='', can_cancel=False, handle=None)

  Bases: `object`

  `can_cancel`

    Whether the task can be cancelled (read-only)

  `cancel`()
  `cancelled`

    Whether the task has been cancelled

  `finish`()
  `finished`

    Whether the task has finished

  `list` = []
  `progress`

    Text description of the progress of the background task (displayed in status bar of the UI)

class `binaryninja.plugin.``BackgroundTaskThread`(initial_progress_text='', can_cancel=False)

  Bases: `binaryninja.plugin.BackgroundTask`

  `join`()
  `run`()
  `start`()

class `binaryninja.plugin.``MainThreadAction`(handle)

  Bases: `object`

  `done`
  `execute`()
  `wait`()

class `binaryninja.plugin.``MainThreadActionHandler`

  Bases: `object`

  `add_action`(action)
  `register`()

class `binaryninja.plugin.``PluginCommand`(cmd)

  Bases: `object`

  `execute`(context)
  classmethod `get_valid_list`(context)

    Dict of registered plugins

  `is_valid`(context)
  `list` = [<PluginCommand: Load PDB (BETA)>, <PluginCommand: Set PDB symbol path (BETA)>]
  classmethod `register`(name, description, action, is_valid=None)

    `register` Register a plugin

    Parameters:

    - name (str) – name of the plugin
    - description (str) – description of the plugin
    - action – function to call with the `BinaryView` as an argument
    - is_valid – optional argument of a function passed a `BinaryView` to determine whether the plugin should be enabled for that view

    Return type: | None

    Warning

    Calling `register` with the same function name will replace the existing function but will leak the memory of the original plugin.

  classmethod `register_for_address`(name, description, action, is_valid=None)

    `register_for_address` Register a plugin to be called with an address argument

    Parameters:

    - name (str) – name of the plugin
    - description (str) – description of the plugin
    - action – function to call with the `BinaryView` and address as arguments
    - is_valid – optional argument of a function passed a `BinaryView` to determine whether the plugin should be enabled for that view

    Return type: | None

    Warning

    Calling `register_for_address` with the same function name will replace the existing function but will leak the memory of the original plugin.

  classmethod `register_for_function`(name, description, action, is_valid=None)

    `register_for_function` Register a plugin to be called with a function argument

    Parameters:

    - name (str) – name of the plugin
    - description (str) – description of the plugin
    - action – function to call with the `BinaryView` and a `Function` as arguments
    - is_valid – optional argument of a function passed a `BinaryView` to determine whether the plugin should be enabled for that view

    Return type: | None

    Warning

    Calling `register_for_function` with the same function name will replace the existing function but will leak the memory of the original plugin.

  classmethod `register_for_low_level_il_function`(name, description, action, is_valid=None)

    `register_for_low_level_il_function` Register a plugin to be called with a low level IL function argument

    Parameters:

    - name (str) – name of the plugin
    - description (str) – description of the plugin
    - action – function to call with the `BinaryView` and a `LowLevelILFunction` as arguments
    - is_valid – optional argument of a function passed a `BinaryView` to determine whether the plugin should be enabled for that view

    Return type: | None

    Warning

    Calling `register_for_low_level_il_function` with the same function name will replace the existing function but will leak the memory of the original plugin.

  classmethod `register_for_low_level_il_instruction`(name, description, action, is_valid=None)

    `register_for_low_level_il_instruction` Register a plugin to be called with a low level IL instruction argument

    Parameters:

    - name (str) – name of the plugin
    - description (str) – description of the plugin
    - action – function to call with the `BinaryView` and a `LowLevelILInstruction` as arguments
    - is_valid – optional argument of a function passed a `BinaryView` to determine whether the plugin should be enabled for that view

    Return type: | None

    Warning

    Calling `register_for_low_level_il_instruction` with the same function name will replace the existing function but will leak the memory of the original plugin.

  classmethod `register_for_medium_level_il_function`(name, description, action, is_valid=None)

    `register_for_medium_level_il_function` Register a plugin to be called with a medium level IL function argument

    Parameters:

    - name (str) – name of the plugin
    - description (str) – description of the plugin
    - action – function to call with the `BinaryView` and a `MediumLevelILFunction` as arguments
    - is_valid – optional argument of a function passed a `BinaryView` to determine whether the plugin should be enabled for that view

    Return type: | None

    Warning

    Calling `register_for_medium_level_il_function` with the same function name will replace the existing function but will leak the memory of the original plugin.

  classmethod `register_for_medium_level_il_instruction`(name, description, action, is_valid=None)

    `register_for_medium_level_il_instruction` Register a plugin to be called with a medium level IL instruction argument

    Parameters:

    - name (str) – name of the plugin
    - description (str) – description of the plugin
    - action – function to call with the `BinaryView` and a `MediumLevelILInstruction` as arguments
    - is_valid – optional argument of a function passed a `BinaryView` to determine whether the plugin should be enabled for that view

    Return type: | None

    Warning

    Calling `register_for_medium_level_il_instruction` with the same function name will replace the existing function but will leak the memory of the original plugin.

  classmethod `register_for_range`(name, description, action, is_valid=None)

    `register_for_range` Register a plugin to be called with a range argument

    Parameters:

    - name (str) – name of the plugin
    - description (str) – description of the plugin
    - action – function to call with the `BinaryView` and `AddressRange` as arguments
    - is_valid – optional argument of a function passed a `BinaryView` to determine whether the plugin should be enabled for that view

    Return type: | None

    Warning

    Calling `register_for_range` with the same function name will replace the existing function but will leak the memory of the original plugin.

class `binaryninja.plugin.``PluginCommandContext`(view)

  Bases: `object`