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

Method code_refs_from_addr

rust/src/binary_view.rs:1368–1380  ·  view source on GitHub ↗

Retrieves a list of addresses pointed to by a given address.

(&self, addr: u64, func: Option<&Function>)

Source from the content-addressed store, hash-verified

1366
1367 /// Retrieves a list of addresses pointed to by a given address.
1368 fn code_refs_from_addr(&self, addr: u64, func: Option<&Function>) -> Vec<u64> {
1369 unsafe {
1370 let mut count = 0;
1371 let code_ref =
1372 CodeReference::new(addr, func.map(|f| f.to_owned()), func.map(|f| f.arch()));
1373 let mut raw_code_ref = CodeReference::into_owned_raw(&code_ref);
1374 let addresses =
1375 BNGetCodeReferencesFrom(self.as_ref().handle, &mut raw_code_ref, &mut count);
1376 let res = std::slice::from_raw_parts(addresses, count).to_vec();
1377 BNFreeAddressList(addresses);
1378 res
1379 }
1380 }
1381
1382 /// Retrieves a list of [DataReference]s pointing to a given address.
1383 fn data_refs_to_addr(&self, addr: u64) -> Array<DataReference> {

Callers 1

call_site_constraintsMethod · 0.80

Implementers 1

binary_view.rsrust/src/binary_view.rs

Calls 5

mapMethod · 0.80
to_vecMethod · 0.80
to_ownedMethod · 0.45
archMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected