plugin module

binaryninja.plugin.BackgroundTask([...])
binaryninja.plugin.BackgroundTaskThread([...])
binaryninja.plugin.MainThreadAction(handle)
binaryninja.plugin.MainThreadActionHandler()
binaryninja.plugin.PluginCommand(cmd)
binaryninja.plugin.PluginCommandContext(view)
class binaryninja.plugin.BackgroundTask(initial_progress_text='', can_cancel=False, handle=None)[source]

Bases: object

can_cancel

Whether the task can be cancelled (read-only)

cancel()[source]
cancelled

Whether the task has been cancelled

finish()[source]
finished

Whether the task has finished

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)[source]

Bases: binaryninja.plugin.BackgroundTask

join()[source]
run()[source]
start()[source]
class binaryninja.plugin.MainThreadAction(handle)[source]

Bases: object

done
execute()[source]
wait()[source]
class binaryninja.plugin.MainThreadActionHandler[source]

Bases: object

add_action(action)[source]
register()[source]
class binaryninja.plugin.PluginCommand(cmd)[source]

Bases: object

execute(context)[source]
classmethod get_valid_list(context)[source]

Dict of registered plugins

is_valid(context)[source]
classmethod register(name, description, action, is_valid=None)[source]

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)[source]

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)[source]

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_range(name, description, action, is_valid=None)[source]

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)[source]

Bases: object