summaryrefslogtreecommitdiff
path: root/rust/src/workflow.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/workflow.rs')
-rw-r--r--rust/src/workflow.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/rust/src/workflow.rs b/rust/src/workflow.rs
index b3a17a77..8409ad70 100644
--- a/rust/src/workflow.rs
+++ b/rust/src/workflow.rs
@@ -10,6 +10,7 @@ use crate::llil::{self, FunctionForm, Mutable};
use crate::rc::{Array, CoreArrayProvider, CoreArrayProviderInner, Guard, Ref, RefCountable};
use crate::string::{BnStrCompatible, BnString};
use crate::{hlil, mlil};
+use crate::binaryview::BinaryView;
#[repr(transparent)]
/// The AnalysisContext struct is used to represent the current state of
@@ -29,6 +30,13 @@ impl AnalysisContext {
Ref::new(Self { handle })
}
+ /// BinaryView for the current AnalysisContext
+ pub fn view(&self) -> Ref<BinaryView> {
+ let result = unsafe { BNAnalysisContextGetBinaryView(self.handle.as_ptr()) };
+ assert!(!result.is_null());
+ unsafe { BinaryView::from_raw(result) }
+ }
+
/// Function for the current AnalysisContext
pub fn function(&self) -> Ref<Function> {
let result = unsafe { BNAnalysisContextGetFunction(self.handle.as_ptr()) };