diff options
Diffstat (limited to 'rust/src/function.rs')
| -rw-r--r-- | rust/src/function.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rust/src/function.rs b/rust/src/function.rs index 8b38ec54..01b086f2 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -42,6 +42,8 @@ pub use binaryninjacore_sys::BNFunctionUpdateType as FunctionUpdateType; use std::{fmt, mem}; use std::{ffi::c_char, hash::Hash, ops::Range}; +use std::ptr::NonNull; +use crate::workflow::Workflow; pub struct Location { pub arch: Option<CoreArchitecture>, @@ -163,6 +165,13 @@ impl Function { } } + pub fn workflow(&self) -> Option<Ref<Workflow>> { + unsafe { + let workflow = NonNull::new(BNGetWorkflowForFunction(self.handle))?; + Some(Workflow::ref_from_raw(workflow)) + } + } + pub fn start(&self) -> u64 { unsafe { BNGetFunctionStart(self.handle) } } |
