diff options
| author | Mark Rowe <mark@vector35.com> | 2025-08-07 22:54:38 -0700 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2025-08-13 19:25:43 -0700 |
| commit | 36a9dba87f042824114b9132607dba9e52c2242f (patch) | |
| tree | b315b702bde629223b75eefa214558cbdb25f9cc /plugins/svd | |
| parent | 395a6dc683bcb687ad5fd1c5b1b63205ffd1af79 (diff) | |
[SVD] Use type-safe activity configuration
Diffstat (limited to 'plugins/svd')
| -rw-r--r-- | plugins/svd/src/lib.rs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/plugins/svd/src/lib.rs b/plugins/svd/src/lib.rs index 3a40d2c0..4a611e3d 100644 --- a/plugins/svd/src/lib.rs +++ b/plugins/svd/src/lib.rs @@ -6,19 +6,9 @@ use crate::settings::LoadSettings; use binaryninja::binary_view::{BinaryView, BinaryViewBase, BinaryViewExt}; use binaryninja::command::Command; use binaryninja::logger::Logger; -use binaryninja::workflow::{Activity, AnalysisContext, Workflow}; +use binaryninja::workflow::{activity, Activity, AnalysisContext, Workflow}; use log::LevelFilter; -const LOADER_ACTIVITY_CONFIG: &str = r#"{ - "name": "analysis.svd.loader", - "title" : "SVD Loader", - "description": "This analysis step applies SVD info to the view...", - "eligibility": { - "auto": {}, - "runOnce": true - } -}"#; - struct LoadSVDFile; impl Command for LoadSVDFile { @@ -118,7 +108,13 @@ fn plugin_init() -> Result<(), ()> { }; // Register new workflow activity to load svd information. - let loader_activity = Activity::new_with_action(LOADER_ACTIVITY_CONFIG, loader_activity); + let loader_config = activity::Config::action( + "analysis.svd.loader", + "SVD Loader", + "This analysis step applies SVD info to the view...", + ) + .eligibility(activity::Eligibility::auto().run_once(true)); + let loader_activity = Activity::new_with_action(loader_config, loader_activity); Workflow::cloned("core.module.metaAnalysis") .ok_or(())? .activity_before(&loader_activity, "core.module.loadDebugInfo")? |
