plugin module¶
The |
|
The |
|
The |
|
- class BackgroundTask(initial_progress_text='', can_cancel=False, handle=None)[source]¶
Bases:
object
The
BackgroundTask
class provides a mechanism for reporting progress of an optionally cancelable task to the user via the status bar in the UI. Ifcan_cancel
is is True, then the task can be cancelled either programmatically (viacancel
) or by the user via the UI.Note this class does not provide a means to execute a task, which is available via the
BackgroundTaskThread
class.- Parameters:
initial_progress_text – text description of the task to display in the status bar in the UI, defaults to “”
can_cancel – whether to enable cancellation of the task, defaults to False
- property can_cancel¶
Whether the task can be cancelled (read-only)
- property cancelled¶
Whether the task has been cancelled
- property finished¶
Whether the task has finished
- property progress¶
Text description of the progress of the background task (displayed in status bar of the UI)
- class BackgroundTaskThread(initial_progress_text: str = '', can_cancel: bool = False)[source]¶
Bases:
BackgroundTask
The
BackgroundTaskThread
class provides an all-in-one solution for executing aBackgroundTask
in a thread.See the
BackgroundTask
for additional information.- Parameters:
- class PluginCommand(cmd)[source]¶
Bases:
object
The
class PluginCommand
contains all the plugin registration methods as class methods.You shouldn’t need to create an instance of this class, instead see register, register_for_address, register_for_function, and similar class methods for examples on how to register your plugin.
- execute(context)[source]¶
execute
Execute a Plugin- Parameters:
context (str) – PluginCommandContext to pass the PluginCommand
- Return type:
None
>>> ctx = PluginCommandContext(bv); >>> PluginCommand.get_valid_list(ctx)[r'PDB\Load'].execute(ctx)
- classmethod register(name: str, description: str, action: Callable[[BinaryView], None], is_valid: Callable[[BinaryView], bool] | None = None)[source]¶
register
Register a plugin- Parameters:
name (str) – name of the plugin (use ‘Folder\Name’ to have the menu item nested in a folder)
description (str) – description of the plugin
action (callback) – function to call with the
BinaryView
as an argumentis_valid (callback) – optional argument of a function passed a
BinaryView
to determine whether the plugin should be enabled for that view
- Return type:
None
- Example:
>>> def my_plugin(bv: BinaryView): >>> log_info(f"My plugin was called on bv: `{bv}`") >>> PluginCommand.register("My Plugin", "My plugin description (not used)", my_plugin) True >>> def is_valid(bv: BinaryView) -> bool: >>> return False >>> PluginCommand.register("My Plugin (With Valid Function)", "My plugin description (not used)", my_plugin, is_valid) True
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: str, description: str, action: Callable[[BinaryView, int], None], is_valid: Callable[[BinaryView, int], bool] | None = None)[source]¶
register_for_address
Register a plugin to be called with an address argument- Parameters:
name (str) – name of the plugin (use ‘Folder\Name’ to have the menu item nested in a folder)
description (str) – description of the plugin
action (callback) – function to call with the
BinaryView
and address as argumentsis_valid (callback) – optional argument of a function passed a
BinaryView
and address to determine whether the plugin should be enabled for that view
- Return type:
None
- Example:
>>> def my_plugin(bv: BinaryView, address: int): >>> log_info(f"My plugin was called on bv: `{bv}` at address {hex(address)}") >>> PluginCommand.register_for_address("My Plugin", "My plugin description (not used)", my_plugin) True >>> def is_valid(bv: BinaryView, address: int) -> bool: >>> return False >>> PluginCommand.register_for_address("My Plugin (With Valid Function)", "My plugin description (not used)", my_plugin, is_valid) True
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: str, description: str, action: Callable[[BinaryView, Function], None], is_valid: Callable[[BinaryView, Function], bool] | None = None)[source]¶
register_for_function
Register a plugin to be called with a function argument- Parameters:
name (str) – name of the plugin (use ‘Folder\Name’ to have the menu item nested in a folder)
description (str) – description of the plugin
action (callback) – function to call with the
BinaryView
and aFunction
as argumentsis_valid (callback) – optional argument of a function passed a
BinaryView
andFunction
to determine whether the plugin should be enabled for that view
- Return type:
None
- Example:
>>> def my_plugin(bv: BinaryView, func: Function): >>> log_info(f"My plugin was called on func {func} in bv `{bv}`") >>> PluginCommand.register_for_function("My Plugin", "My plugin description (not used)", my_plugin) True >>> def is_valid(bv: BinaryView, func: Function) -> bool: >>> return False >>> PluginCommand.register_for_function("My Plugin (With Valid Function)", "My plugin description (not used)", my_plugin, is_valid) True
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_high_level_il_function(name: str, description: str, action: Callable[[BinaryView, HighLevelILFunction], None], is_valid: Callable[[BinaryView, HighLevelILFunction], bool] | None = None)[source]¶
register_for_high_level_il_function
Register a plugin to be called with a high level IL function argument- Parameters:
name (str) – name of the plugin (use ‘Folder\Name’ to have the menu item nested in a folder)
description (str) – description of the plugin
action (callback) – function to call with the
BinaryView
and aHighLevelILFunction
as argumentsis_valid (callback) – optional argument of a function passed a
BinaryView
andHighLevelILFunction
to determine whether the plugin should be enabled for that view
- Return type:
None
- Example:
>>> def my_plugin(bv: BinaryView, func: HighLevelILFunction): >>> log_info(f"My plugin was called on func {func} in bv `{bv}`") >>> PluginCommand.register_for_low_level_il_function("My Plugin", "My plugin description (not used)", my_plugin) True >>> def is_valid(bv: BinaryView, func: HighLevelILFunction) -> bool: >>> return False >>> PluginCommand.register_for_low_level_il_function("My Plugin (With Valid Function)", "My plugin description (not used)", my_plugin, is_valid) True
Warning
Calling
register_for_high_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_high_level_il_instruction(name: str, description: str, action: Callable[[BinaryView, HighLevelILInstruction], None], is_valid: Callable[[BinaryView, HighLevelILInstruction], bool] | None = None)[source]¶
register_for_high_level_il_instruction
Register a plugin to be called with a high level IL instruction argument- Parameters:
name (str) – name of the plugin (use ‘Folder\Name’ to have the menu item nested in a folder)
description (str) – description of the plugin
action (callback) – function to call with the
BinaryView
and aHighLevelILInstruction
as argumentsis_valid (callback) – optional argument of a function passed a
BinaryView
andHighLevelILInstruction
to determine whether the plugin should be enabled for that view
- Return type:
None
- Example:
>>> def my_plugin(bv: BinaryView, inst: HighLevelILInstruction): >>> log_info(f"My plugin was called on inst {inst} in bv `{bv}`") >>> PluginCommand.register_for_low_level_il_instruction("My Plugin", "My plugin description (not used)", my_plugin) True >>> def is_valid(bv: BinaryView, inst: HighLevelILInstruction) -> bool: >>> return False >>> PluginCommand.register_for_low_level_il_instruction("My Plugin (With Valid Function)", "My plugin description (not used)", my_plugin, is_valid) True
Warning
Calling
register_for_high_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_low_level_il_function(name: str, description: str, action: Callable[[BinaryView, LowLevelILFunction], None], is_valid: Callable[[BinaryView, LowLevelILFunction], bool] | None = None)[source]¶
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 (use ‘Folder\Name’ to have the menu item nested in a folder)
description (str) – description of the plugin
action (callback) – function to call with the
BinaryView
and aLowLevelILFunction
as argumentsis_valid (callback) – optional argument of a function passed a
BinaryView
andLowLevelILFunction
to determine whether the plugin should be enabled for that view
- Return type:
None
- Example:
>>> def my_plugin(bv: BinaryView, func: LowLevelILFunction): >>> log_info(f"My plugin was called on func {func} in bv `{bv}`") >>> PluginCommand.register_for_low_level_il_function("My Plugin", "My plugin description (not used)", my_plugin) True >>> def is_valid(bv: BinaryView, func: LowLevelILFunction) -> bool: >>> return False >>> PluginCommand.register_for_low_level_il_function("My Plugin (With Valid Function)", "My plugin description (not used)", my_plugin, is_valid) True
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: str, description: str, action: Callable[[BinaryView, LowLevelILInstruction], None], is_valid: Callable[[BinaryView, LowLevelILInstruction], bool] | None = None)[source]¶
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 (use ‘Folder\Name’ to have the menu item nested in a folder)
description (str) – description of the plugin
action (callback) – function to call with the
BinaryView
and aLowLevelILInstruction
as argumentsis_valid (callback) – optional argument of a function passed a
BinaryView
andLowLevelILInstruction
to determine whether the plugin should be enabled for that view
- Return type:
None
- Example:
>>> def my_plugin(bv: BinaryView, inst: LowLevelILInstruction): >>> log_info(f"My plugin was called on inst {inst} in bv `{bv}`") >>> PluginCommand.register_for_low_level_il_instruction("My Plugin", "My plugin description (not used)", my_plugin) True >>> def is_valid(bv: BinaryView, inst: LowLevelILInstruction) -> bool: >>> return False >>> PluginCommand.register_for_low_level_il_instruction("My Plugin (With Valid Function)", "My plugin description (not used)", my_plugin, is_valid) True
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: str, description: str, action: Callable[[BinaryView, MediumLevelILFunction], None], is_valid: Callable[[BinaryView, MediumLevelILFunction], bool] | None = None)[source]¶
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 (use ‘Folder\Name’ to have the menu item nested in a folder)
description (str) – description of the plugin
action (callback) – function to call with the
BinaryView
and aMediumLevelILFunction
as argumentsis_valid (callback) – optional argument of a function passed a
BinaryView
andMediumLevelILFunction
to determine whether the plugin should be enabled for that view
- Return type:
None
- Example:
>>> def my_plugin(bv: BinaryView, func: MediumLevelILFunction): >>> log_info(f"My plugin was called on func {func} in bv `{bv}`") >>> PluginCommand.register_for_low_level_il_function("My Plugin", "My plugin description (not used)", my_plugin) True >>> def is_valid(bv: BinaryView, func: MediumLevelILFunction) -> bool: >>> return False >>> PluginCommand.register_for_low_level_il_function("My Plugin (With Valid Function)", "My plugin description (not used)", my_plugin, is_valid) True
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: str, description: str, action: Callable[[BinaryView, MediumLevelILInstruction], None], is_valid: Callable[[BinaryView, MediumLevelILInstruction], bool] | None = None)[source]¶
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 (use ‘Folder\Name’ to have the menu item nested in a folder)
description (str) – description of the plugin
action (callback) – function to call with the
BinaryView
and aMediumLevelILInstruction
as argumentsis_valid (callback) – optional argument of a function passed a
BinaryView
andMediumLevelILInstruction
to determine whether the plugin should be enabled for that view
- Return type:
None
- Example:
>>> def my_plugin(bv: BinaryView, inst: MediumLevelILInstruction): >>> log_info(f"My plugin was called on inst {inst} in bv `{bv}`") >>> PluginCommand.register_for_low_level_il_instruction("My Plugin", "My plugin description (not used)", my_plugin) True >>> def is_valid(bv: BinaryView, inst: MediumLevelILInstruction) -> bool: >>> return False >>> PluginCommand.register_for_low_level_il_instruction("My Plugin (With Valid Function)", "My plugin description (not used)", my_plugin, is_valid) True
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: str, description: str, action: Callable[[BinaryView, int, int], None], is_valid: Callable[[BinaryView, int, int], bool] | None = None)[source]¶
register_for_range
Register a plugin to be called with a range argument- Parameters:
name (str) – name of the plugin (use ‘Folder\Name’ to have the menu item nested in a folder)
description (str) – description of the plugin
action (callback) – function to call with the
BinaryView
, start address, and length as argumentsis_valid (callback) – optional argument of a function passed a
BinaryView
, start address, and length to determine whether the plugin should be enabled for that view
- Return type:
None
- Example:
>>> def my_plugin(bv: BinaryView, start: int, length: int): >>> log_info(f"My plugin was called on bv: `{bv}` at {hex(start)} of length {hex(length)}") >>> PluginCommand.register_for_range("My Plugin", "My plugin description (not used)", my_plugin) True >>> def is_valid(bv: BinaryView, start: int, length: int) -> bool: >>> return False >>> PluginCommand.register_for_range("My Plugin (With Valid Function)", "My plugin description (not used)", my_plugin, is_valid) True
Warning
Calling
register_for_range
with the same function name will replace the existing function but will leak the memory of the original plugin.
- property command¶
- property description¶
- property name¶
- property type¶