diff options
| author | Malware Utkonos <utkonos@malwarolo.gy> | 2026-01-05 18:19:37 -0500 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2026-01-12 12:34:50 -0500 |
| commit | fbed08463104a53e38109210cccf3157450453a7 (patch) | |
| tree | 9a503dc0c6f73ccdba74daceafddfd3e690c42b5 /python/examples | |
| parent | 2ef0ec1b7b9a7cabee332171c088d2dcbba3a972 (diff) | |
Add module workflow hello world example.
Diffstat (limited to 'python/examples')
| -rw-r--r-- | python/examples/wf_module_helloworld.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/python/examples/wf_module_helloworld.py b/python/examples/wf_module_helloworld.py new file mode 100644 index 00000000..3ebe8c55 --- /dev/null +++ b/python/examples/wf_module_helloworld.py @@ -0,0 +1,36 @@ +"""Module Workflow hello world.""" +import json + +from binaryninja.log import Logger +from binaryninja.workflow import Workflow, Activity, AnalysisContext + +log = Logger(0, 'WorkflowHelloWorld') + + +def do_action(context: AnalysisContext): + """Do stuff in main workflow action.""" + bv = context.view + log.session_id = bv.file.session_id + bv.add_tag(bv.entry_point, 'Needs Analysis', 'Hello World!') + log.log_info('Added Hello World Tag') + + +wf = Workflow('core.module.metaAnalysis').clone('plugin.module.HelloWorld') + +wf.register_activity(Activity( + configuration=json.dumps({ + 'name': 'analysis.helloworld', + 'title': 'Tag Entry Point', + 'description': 'Tag the entry point with "Hello World!".', + 'eligibility': { + 'runOnce': True + }, + 'dependencies': { + 'downstream': ['core.module.update'] + } + }), + action=do_action +)) + +wf.insert('core.module.finishUpdate', ['analysis.helloworld']) +wf.register() |
