Skip to content

Workflows Ignore Project and Options Scoped Settings Changes #7858

@utkonos

Description

@utkonos

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:

  1. Paste the code below into a plugin.
  2. Enable the workflow at the project level or using open with options
  3. Open a raw file
  4. Look at the logs: note that the boolean is False.
  5. Close the file
  6. Open project settings or open with options
  7. Set the boolean to true
  8. Close settings
  9. Open a raw file
  10. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions