-
Notifications
You must be signed in to change notification settings - Fork 271
Open
Description
Version and Platform (required):
- Binary Ninja Version: 5.3.8844-dev Ultimate, 29d8484
- OS: macos
- OS Version: 26.2.0
- CPU Architecture: arm64
Bug Description:
If you have a setting configured in a workflow plugin, and try to set it at the project level or set it when opening with options, that setting is ignored and the SettingsUserScope setting is used.
Steps To Reproduce:
- Paste the code below into a plugin.
- Enable the workflow at the project level or using open with options
- Open a raw file
- Look at the logs: note that the boolean is False.
- Close the file
- Open project settings or open with options
- Set the boolean to true
- Close settings
- Open a raw file
- Look at the logs: note that the boolean is False
Expected Behavior:
Workflow plugin obeys SettingsProjectScope and obeys the settings when you open with options.
Additional Information:
import json
from binaryninja.log import Logger
from binaryninja.settings import Settings
from binaryninja.workflow import Workflow, Activity, AnalysisContext
plugin_name = 'ScopeTest'
log = Logger(0, plugin_name)
s = Settings()
s.register_group('scopetest', plugin_name)
setting = {
'description': 'This setting has bad breath: give it some scope?',
'title': 'Scope',
'default': False,
'type': 'boolean'
}
s.register_setting('scopetest.scope', json.dumps(setting))
def do_action(context: AnalysisContext):
"""Do stuff in main workflow action."""
test_scope = s.get_bool('scopetest.scope')
log.log_info(f'{test_scope}, {type(test_scope)}')
wf = Workflow('core.module.metaAnalysis').clone('plugin.module.ScopeTest')
wf.register_activity(Activity(
configuration=json.dumps({
'name': 'analysis.scope',
'title': 'Scope Test',
'description': 'Testing Settings Scope.',
'eligibility': {
'runOnce': True
},
'dependencies': {
'downstream': ['core.module.update']
}
}),
action=do_action
))
wf.insert('core.module.finishUpdate', ['analysis.scope'])
wf.register()Metadata
Metadata
Assignees
Labels
No labels