summaryrefslogtreecommitdiff
path: root/rust/src/function.rs
diff options
context:
space:
mode:
authortoolCHAINZ <toolCHAINZ@users.noreply.github.com>2023-05-04 21:19:32 -0400
committerKyleMiles <krm504@nyu.edu>2023-05-10 17:45:15 -0400
commit3cbd7682c8696a2005b98e3c1b09f3357ced012d (patch)
treea80ee5ba13b068e048605215ea4abf07bab1616b /rust/src/function.rs
parentdfd2b29120baa6d86ab6e76ab5f940dec63ffe37 (diff)
Added some stack layout and reference APIs
Diffstat (limited to 'rust/src/function.rs')
-rw-r--r--rust/src/function.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/rust/src/function.rs b/rust/src/function.rs
index 426f936b..ab504bb7 100644
--- a/rust/src/function.rs
+++ b/rust/src/function.rs
@@ -23,7 +23,7 @@ use crate::{
llil,
platform::Platform,
symbol::Symbol,
- types::{Conf, Type},
+ types::{Conf, NamedTypedVariable, Type},
};
use std::{fmt, mem};
@@ -258,6 +258,14 @@ impl Function {
BNSetFunctionUserType(self.handle, t.handle);
}
}
+
+ pub fn stack_layout(&self) -> Array<NamedTypedVariable> {
+ let mut count = 0;
+ unsafe {
+ let variables = BNGetStackLayout(self.handle, &mut count);
+ Array::new(variables, count, ())
+ }
+ }
}
impl fmt::Debug for Function {