Skip to content

Commit

Permalink
add Function::{set_user_parameter_variables, set_auto_parameter_varia…
Browse files Browse the repository at this point in the history
…bles} methods
  • Loading branch information
rbran committed May 14, 2024
1 parent 352e24b commit 479b585
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions rust/src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,40 @@ impl Function {
}
}

pub fn set_user_parameter_variables<I>(&self, values: I, confidence: u8)
where
I: IntoIterator<Item = Variable>,
{
let mut vars: Box<[BNVariable]> = values.into_iter().map(|var| var.raw()).collect();
unsafe {
BNSetUserFunctionParameterVariables(
self.handle,
&mut BNParameterVariablesWithConfidence {
vars: vars.as_mut_ptr(),
count: vars.len(),
confidence,
},
)
}
}

pub fn set_auto_parameter_variables<I>(&self, values: I, confidence: u8)
where
I: IntoIterator<Item = Variable>,
{
let mut vars: Box<[BNVariable]> = values.into_iter().map(|var| var.raw()).collect();
unsafe {
BNSetAutoFunctionParameterVariables(
self.handle,
&mut BNParameterVariablesWithConfidence {
vars: vars.as_mut_ptr(),
count: vars.len(),
confidence,
},
)
}
}

pub fn parameter_at(
&self,
addr: u64,
Expand Down

0 comments on commit 479b585

Please sign in to comment.