MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / clear_user_var_value

Method clear_user_var_value

rust/src/medium_level_il/function.rs:234–253  ·  view source on GitHub ↗

Clears a previously defined user variable value. `var` - Variable for which the value was informed `def_addr` - Address of the definition site of the variable

(&self, var: &Variable, addr: u64, after: bool)

Source from the content-addressed store, hash-verified

232 /// * `var` - Variable for which the value was informed
233 /// * `def_addr` - Address of the definition site of the variable
234 pub fn clear_user_var_value(&self, var: &Variable, addr: u64, after: bool) -> Result<(), ()> {
235 let Some(_var_def) = self
236 .var_definitions(var)
237 .iter()
238 .find(|site| site.address == addr)
239 else {
240 //error "Could not get definition for Variable"
241 return Err(());
242 };
243
244 let function = self.function();
245 let raw_var = BNVariable::from(var);
246 let def_site = BNArchitectureAndAddress {
247 arch: function.arch().handle,
248 address: addr,
249 };
250
251 unsafe { BNClearUserVariableValue(function.handle, &raw_var, &def_site, after) };
252 Ok(())
253 }
254
255 /// Returns a map of current defined user variable values.
256 /// Returns a Map of user current defined user variable values and their definition sites.

Callers 1

clear_user_var_valuesMethod · 0.45

Calls 5

findMethod · 0.80
var_definitionsMethod · 0.80
iterMethod · 0.45
functionMethod · 0.45
archMethod · 0.45

Tested by

no test coverage detected