Returns the BasicBlock that contains the given address `addr`. `addr` - Address of the BasicBlock to retrieve. `arch` - Architecture of the basic block if different from the Function's self.arch # Example ```no_run # use binaryninja::function::Function; # let fun: Function = todo!(); let blocks = fun.basic_block_containing(0x1000, None); ```
(
&self,
addr: u64,
arch: Option<CoreArchitecture>,
)
| 431 | /// let blocks = fun.basic_block_containing(0x1000, None); |
| 432 | /// ``` |
| 433 | pub fn basic_block_containing( |
| 434 | &self, |
| 435 | addr: u64, |
| 436 | arch: Option<CoreArchitecture>, |
| 437 | ) -> Option<Ref<BasicBlock<NativeBlock>>> { |
| 438 | let arch = arch.unwrap_or_else(|| self.arch()); |
| 439 | unsafe { |
| 440 | let basic_block_ptr = BNGetFunctionBasicBlockAtAddress(self.handle, arch.handle, addr); |
| 441 | let context = NativeBlock { _priv: () }; |
| 442 | match basic_block_ptr.is_null() { |
| 443 | false => Some(BasicBlock::ref_from_raw(basic_block_ptr, context)), |
| 444 | true => None, |
| 445 | } |
| 446 | } |
| 447 | } |
| 448 | |
| 449 | pub fn block_annotations( |
| 450 | &self, |