diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2025-01-14 09:28:37 -0500 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2025-01-14 09:28:37 -0500 |
| commit | 3ee274ac9111829d2abe2c051c694466a7d0d477 (patch) | |
| tree | 583de21ac4e5c000b96d6532835408a01e20871c /python/plugin.py | |
| parent | 17158e9942a73327f176ef642a1cafcaf8cb7b03 (diff) | |
add example to plugincommandcontext
Diffstat (limited to 'python/plugin.py')
| -rw-r--r-- | python/plugin.py | 14 |
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 |
