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

Method instruction_index_at

rust/src/low_level_il/function.rs:111–126  ·  view source on GitHub ↗
(
        &self,
        loc: L,
    )

Source from the content-addressed store, hash-verified

109 }
110
111 pub fn instruction_index_at<L: Into<Location>>(
112 &self,
113 loc: L,
114 ) -> Option<LowLevelInstructionIndex> {
115 use binaryninjacore_sys::BNLowLevelILGetInstructionStart;
116 let loc: Location = loc.into();
117 let arch = loc.arch.unwrap_or_else(|| *self.arch().as_ref());
118 let instr_idx =
119 unsafe { BNLowLevelILGetInstructionStart(self.handle, arch.handle, loc.addr) };
120 // `instr_idx` will equal self.instruction_count() if the instruction is not valid.
121 if instr_idx >= self.instruction_count() {
122 None
123 } else {
124 Some(LowLevelInstructionIndex(instr_idx))
125 }
126 }
127
128 pub fn instruction_from_index(
129 &self,

Callers 1

instruction_atMethod · 0.45

Calls 4

as_refMethod · 0.45
archMethod · 0.45
instruction_countMethod · 0.45

Tested by

no test coverage detected