From c4ba6d79ae3b96d56cc6b3744e7c64e004ecd161 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 21 Apr 2026 18:10:51 -0700 Subject: [Rust] Refactor `binary_view` module - Remove the "viral" `BinaryViewExt` trait and its blanket impl - Split up the binary view type from the custom trait impl - Simplify and fix bugs regarding custom binary view initialization - Rewrite Minidump binary view example, parses the PE headers to create proper sections now - Add some extra documentation - Add unit test for custom binary view --- plugins/workflow_objc/src/metadata/global_state.rs | 7 ++----- plugins/workflow_objc/src/metadata/selector.rs | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'plugins/workflow_objc/src/metadata') diff --git a/plugins/workflow_objc/src/metadata/global_state.rs b/plugins/workflow_objc/src/metadata/global_state.rs index 6c128e22..a3693140 100644 --- a/plugins/workflow_objc/src/metadata/global_state.rs +++ b/plugins/workflow_objc/src/metadata/global_state.rs @@ -1,7 +1,7 @@ use binaryninja::file_metadata::SessionId; use binaryninja::object_destructor::register_object_destructor; use binaryninja::{ - binary_view::{BinaryView, BinaryViewBase, BinaryViewExt}, + binary_view::{BinaryView, BinaryViewBase}, file_metadata::FileMetadata, metadata::Metadata, object_destructor::ObjectDestructor, @@ -155,10 +155,7 @@ impl AnalysisInfo { } fn load_selector_impls(&self, bv: &BinaryView) -> Option { - let Some(Ok(meta)) = bv.get_metadata::>>("Objective-C") - else { - return None; - }; + let meta = bv.get_metadata::>>("Objective-C")?; let version_meta = meta.get("version")?; if version_meta.get_unsigned_integer()? != 1 { tracing::error!( diff --git a/plugins/workflow_objc/src/metadata/selector.rs b/plugins/workflow_objc/src/metadata/selector.rs index de2e883e..aa51d8e9 100644 --- a/plugins/workflow_objc/src/metadata/selector.rs +++ b/plugins/workflow_objc/src/metadata/selector.rs @@ -1,5 +1,5 @@ use crate::Error; -use binaryninja::binary_view::{BinaryView, BinaryViewBase as _, BinaryViewExt}; +use binaryninja::binary_view::{BinaryView, BinaryViewBase as _}; pub struct Selector { pub name: String, -- cgit v1.3.1