summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2025-01-14 09:28:37 -0500
committerJordan Wiens <jordan@psifertex.com>2025-01-14 09:28:37 -0500
commit3ee274ac9111829d2abe2c051c694466a7d0d477 (patch)
tree583de21ac4e5c000b96d6532835408a01e20871c /python
parent17158e9942a73327f176ef642a1cafcaf8cb7b03 (diff)
add example to plugincommandcontext
Diffstat (limited to 'python')
-rw-r--r--python/plugin.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/python/plugin.py b/python/plugin.py
index 1536b3bc..0250007e 100644
--- a/python/plugin.py
+++ b/python/plugin.py
@@ -37,7 +37,17 @@ from . import mediumlevelil
from . import highlevelil
-class PluginCommandContext:
+class PluginCommandContext: """
+ The ``class PluginCommandContext`` is used to access loaded plugins and their exposed methods with the context of a specific Binary VIew.
+
+ :Example:
+ # To trigger a registered plugin with a BinaryView, for example:
+ >>> bv = load("/tmp/file1")
+ >>> ctx = PluginCommandContext(bv);
+ >>> binexport = PluginCommand.get_valid_list(ctx)["BinExport"]
+ >>> binexport.execute(ctx)
+ """
+
def __init__(self, view):
self._view = view
self._address = 0
@@ -834,7 +844,7 @@ class PluginCommand(metaclass=_PluginCommandMetaClass):
def execute(self, context):
r"""
- ``execute`` Execute a Plugin
+ ``execute`` Execute a plugin. See the example in :class:`~PluginCommandContext`
:param str context: PluginCommandContext to pass the PluginCommand
:rtype: None