binaryninja::low_level_il::function

Struct LowLevelILFunction

source
pub struct LowLevelILFunction<M: FunctionMutability, F: FunctionForm> { /* private fields */ }

Implementations§

source§

impl<M, F> LowLevelILFunction<M, F>

source

pub fn instruction_at<L: Into<Location>>( &self, loc: L, ) -> Option<LowLevelILInstruction<'_, M, F>>

source

pub fn instruction_index_at<L: Into<Location>>( &self, loc: L, ) -> Option<LowLevelInstructionIndex>

source

pub fn instruction_from_index( &self, index: LowLevelInstructionIndex, ) -> Option<LowLevelILInstruction<'_, M, F>>

source

pub fn instruction_count(&self) -> usize

source

pub fn expression_count(&self) -> usize

source

pub fn function(&self) -> Ref<Function>

source

pub fn basic_blocks(&self) -> Array<BasicBlock<LowLevelILBlock<'_, M, F>>>

source

pub fn basic_block_containing_index( &self, index: LowLevelInstructionIndex, ) -> Option<Ref<BasicBlock<LowLevelILBlock<'_, M, F>>>>

Returns the BasicBlock at the given instruction index.

You can also retrieve this using LowLevelILInstruction::basic_block.

source§

impl<M: FunctionMutability> LowLevelILFunction<M, NonSSA>

source

pub fn ssa_form(&self) -> Option<Ref<LowLevelILFunction<M, SSA>>>

Retrieve the SSA form of the function.

source§

impl LowLevelILFunction<Mutable, NonSSA>

source

pub fn new(arch: CoreArchitecture, source_func: Option<Function>) -> Ref<Self>

source

pub fn generate_ssa_form(&self)

source§

impl LowLevelILFunction<Mutable, NonSSA>

source

pub const NO_INPUTS: [ExpressionBuilder<'static, ValueExpr>; 0] = _

source

pub const NO_OUTPUTS: [LowLevelILRegisterKind<CoreRegister>; 0] = _

source

pub fn expression<'a, E: LiftableLowLevelIL<'a>>( &'a self, expr: E, ) -> LowLevelILExpression<'a, Mutable, NonSSA, E::Result>

source

pub fn add_instruction<'a, E: LiftableLowLevelIL<'a>>(&'a self, expr: E)

source

pub unsafe fn replace_expression<'a, E: LiftableLowLevelIL<'a>>( &'a self, replaced_expr_index: LowLevelExpressionIndex, replacement: E, ) -> bool

source

pub fn const_int( &self, size: usize, val: u64, ) -> LowLevelILMutableExpression<'_, ValueExpr>

source

pub fn const_ptr_sized( &self, size: usize, val: u64, ) -> LowLevelILMutableExpression<'_, ValueExpr>

source

pub fn const_ptr(&self, val: u64) -> LowLevelILMutableExpression<'_, ValueExpr>

source

pub fn trap( &self, val: u64, ) -> LowLevelILExpression<'_, Mutable, NonSSA, VoidExpr>

source

pub fn unimplemented( &self, ) -> LowLevelILExpression<'_, Mutable, NonSSA, ValueExpr>

source

pub fn undefined(&self) -> LowLevelILExpression<'_, Mutable, NonSSA, VoidExpr>

source

pub fn nop(&self) -> LowLevelILExpression<'_, Mutable, NonSSA, VoidExpr>

source

pub fn no_ret(&self) -> LowLevelILExpression<'_, Mutable, NonSSA, VoidExpr>

source

pub fn syscall(&self) -> LowLevelILExpression<'_, Mutable, NonSSA, VoidExpr>

source

pub fn bp(&self) -> LowLevelILExpression<'_, Mutable, NonSSA, VoidExpr>

source

pub fn call<'a, E>( &'a self, expr: E, ) -> LowLevelILExpression<'a, Mutable, NonSSA, VoidExpr>
where E: LiftableLowLevelIL<'a, Result = ValueExpr>,

source

pub fn ret<'a, E>( &'a self, expr: E, ) -> LowLevelILExpression<'a, Mutable, NonSSA, VoidExpr>
where E: LiftableLowLevelIL<'a, Result = ValueExpr>,

source

pub fn jump<'a, E>( &'a self, expr: E, ) -> LowLevelILExpression<'a, Mutable, NonSSA, VoidExpr>
where E: LiftableLowLevelIL<'a, Result = ValueExpr>,

source

pub fn if_expr<'a: 'b, 'b, C>( &'a self, cond: C, true_label: &'b mut LowLevelILLabel, false_label: &'b mut LowLevelILLabel, ) -> LowLevelILExpression<'a, Mutable, NonSSA, VoidExpr>
where C: LiftableLowLevelIL<'b, Result = ValueExpr>,

source

pub fn goto<'a: 'b, 'b>( &'a self, label: &'b mut LowLevelILLabel, ) -> LowLevelILExpression<'a, Mutable, NonSSA, VoidExpr>

source

pub fn reg<R: ArchReg, LR: Into<LowLevelILRegisterKind<R>>>( &self, size: usize, reg: LR, ) -> LowLevelILMutableExpression<'_, ValueExpr>

source

pub fn reg_split<R: ArchReg, LR: Into<LowLevelILRegisterKind<R>>>( &self, size: usize, hi_reg: LR, lo_reg: LR, ) -> LowLevelILMutableExpression<'_, ValueExpr>

source

pub fn set_reg<'a, R, LR, E>( &'a self, size: usize, dest_reg: LR, expr: E, ) -> ExpressionBuilder<'a, VoidExpr>

source

pub fn set_reg_split<'a, R, LR, E>( &'a self, size: usize, hi_reg: LR, lo_reg: LR, expr: E, ) -> ExpressionBuilder<'a, VoidExpr>

source

pub fn flag( &self, flag: impl Flag, ) -> LowLevelILMutableExpression<'_, ValueExpr>

source

pub fn flag_cond( &self, cond: FlagCondition, ) -> LowLevelILMutableExpression<'_, ValueExpr>

source

pub fn flag_group( &self, group: impl FlagGroup, ) -> LowLevelILMutableExpression<'_, ValueExpr>

source

pub fn set_flag<'a, E>( &'a self, dest_flag: impl Flag, expr: E, ) -> ExpressionBuilder<'a, VoidExpr>

source

pub fn load<'a, E>( &'a self, size: usize, source_mem: E, ) -> ExpressionBuilder<'a, ValueExpr>
where E: LiftableLowLevelIL<'a, Result = ValueExpr>,

source

pub fn store<'a, D, V>( &'a self, size: usize, dest_mem: D, value: V, ) -> ExpressionBuilder<'a, VoidExpr>

source

pub fn intrinsic<'a, R, O, P>( &'a self, outputs: impl IntoIterator<Item = O>, intrinsic: impl Intrinsic, inputs: impl IntoIterator<Item = P>, ) -> ExpressionBuilder<'a, VoidExpr>
where R: ArchReg, O: Into<LowLevelILRegisterKind<R>>, P: LiftableLowLevelIL<'a, Result = ValueExpr>,

source

pub fn push<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, VoidExpr>

source

pub fn pop(&self, size: usize) -> ExpressionBuilder<'_, ValueExpr>

source

pub fn unimplemented_mem<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn neg<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn not<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn sx<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn zx<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn low_part<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn add<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn add_overflow<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn sub<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn and<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn or<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn xor<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn lsl<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn lsr<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn asr<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn rol<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn rlc<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn ror<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn rrc<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn mul<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn muls_dp<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn mulu_dp<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn divs<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn divu<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn mods<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn modu<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn adc<'a, L, R, C>( &'a self, size: usize, left: L, right: R, carry: C, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn sbb<'a, L, R, C>( &'a self, size: usize, left: L, right: R, carry: C, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn cmp_e<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn cmp_ne<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn cmp_slt<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn cmp_ult<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn cmp_sle<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn cmp_ule<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn cmp_sge<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn cmp_uge<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn cmp_sgt<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn cmp_ugt<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn test_bit<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn bool_to_int<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fadd<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fsub<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fmul<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fdiv<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fsqrt<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fneg<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fabs<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn float_to_int<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn int_to_float<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn float_conv<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn round_to_int<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn floor<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn ceil<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn ftrunc<'a, E>( &'a self, size: usize, expr: E, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fcmp_e<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fcmp_ne<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fcmp_lt<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fcmp_le<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fcmp_ge<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fcmp_gt<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fcmp_o<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn fcmp_uo<'a, L, R>( &'a self, size: usize, left: L, right: R, ) -> ExpressionBuilder<'a, ValueExpr>

source

pub fn current_address(&self) -> u64

source

pub fn set_current_address<L: Into<Location>>(&self, loc: L)

source

pub fn label_for_address<L: Into<Location>>( &self, loc: L, ) -> Option<LowLevelILLabel>

source

pub fn mark_label(&self, label: &mut LowLevelILLabel)

Trait Implementations§

source§

impl<M, F> Debug for LowLevelILFunction<M, F>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<M: FunctionMutability, F: FunctionForm> Hash for LowLevelILFunction<M, F>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<M: FunctionMutability, F: FunctionForm> PartialEq for LowLevelILFunction<M, F>

source§

fn eq(&self, rhs: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<M, F> ToOwned for LowLevelILFunction<M, F>

source§

type Owned = Ref<LowLevelILFunction<M, F>>

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<M: FunctionMutability, F: FunctionForm> Eq for LowLevelILFunction<M, F>

source§

impl<M: FunctionMutability, F: FunctionForm> Send for LowLevelILFunction<M, F>

source§

impl<M: FunctionMutability, F: FunctionForm> Sync for LowLevelILFunction<M, F>

Auto Trait Implementations§

§

impl<M, F> Freeze for LowLevelILFunction<M, F>

§

impl<M, F> RefUnwindSafe for LowLevelILFunction<M, F>

§

impl<M, F> Unpin for LowLevelILFunction<M, F>
where M: Unpin, F: Unpin,

§

impl<M, F> UnwindSafe for LowLevelILFunction<M, F>
where M: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.