diff options
| author | Mason Reed <mason@vector35.com> | 2025-10-07 16:52:16 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-10-07 16:52:16 -0400 |
| commit | 47f5c67fd7f68dfd95392531431a3efca0ccda3c (patch) | |
| tree | 3ebc34e86e592e2f8b973ac69129da43e1cfa058 | |
| parent | 64633f61f7b9e03be9437b5f4896bbe122f7a7a2 (diff) | |
[Rust] Update the workflow example following API changes
| -rw-r--r-- | rust/examples/workflow.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/rust/examples/workflow.rs b/rust/examples/workflow.rs index db0bf599..d030209a 100644 --- a/rust/examples/workflow.rs +++ b/rust/examples/workflow.rs @@ -52,13 +52,14 @@ pub fn main() { binaryninja::headless::Session::new().expect("Failed to initialize session"); println!("Registering workflow..."); - let old_meta_workflow = Workflow::get("core.function.metaAnalysis"); - let meta_workflow = old_meta_workflow.clone_to("core.function.metaAnalysis"); let activity = Activity::new_with_action(RUST_ACTIVITY_CONFIG, example_activity); - meta_workflow.register_activity(&activity).unwrap(); - meta_workflow.insert("core.function.runFunctionRecognizers", [RUST_ACTIVITY_NAME]); - // Re-register the meta workflow with our changes. - meta_workflow.register().unwrap(); + // Update the meta-workflow with our new activity. + Workflow::cloned("core.function.metaAnalysis") + .expect("Couldn't find meta workflow") + .activity_after(&activity, "core.function.runFunctionRecognizers") + .expect("Couldn't find runFunctionRecognizers") + .register() + .expect("Couldn't register activity"); println!("Loading binary..."); let bv = headless_session |
