From 86773015c984ff1be8df8ac9b25b7f6bd2f8cca5 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Wed, 7 May 2025 06:43:04 -0700 Subject: [Rust] Add Function::variable_type --- rust/src/function.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'rust/src/function.rs') diff --git a/rust/src/function.rs b/rust/src/function.rs index d8b5c199..7990f109 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -467,6 +467,15 @@ impl Function { } } + pub fn variable_type(&self, var: &Variable) -> Option>> { + let raw_var = BNVariable::from(var); + let result = unsafe { BNGetVariableType(self.handle, &raw_var) }; + match result.type_.is_null() { + false => Some(Conf::>::from_owned_raw(result)), + true => None, + } + } + pub fn high_level_il(&self, full_ast: bool) -> Result, ()> { unsafe { let hlil_ptr = BNGetFunctionHighLevelIL(self.handle); -- cgit v1.3.1