Workflows Ignore Project and Options Scoped Settings Changes

Open
#7,858 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Start with the Python reproducer using Settings, Workflow, Activity, and AnalysisContext, then trace how the cloned workflow runs at core.module.finishUpdate after project or open-options settings are applied. Confirm that the workflow reads the project and option scopes rather than only SettingsUserScope, and verify the behavior with the listed reproduction steps.

Written by the indexing model from the issue text.

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:

  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()
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Vector35/binaryninja-api

All issues in Vector35/binaryninja-api

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.