-
Notifications
You must be signed in to change notification settings - Fork 288
Expand file tree
/
Copy pathwf_module_helloworld.py
More file actions
36 lines (28 loc) · 989 Bytes
/
Copy pathwf_module_helloworld.py
File metadata and controls
36 lines (28 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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()