binaryninja::medium_level_il::instruction

Struct MediumLevelILInstruction

source
pub struct MediumLevelILInstruction {
    pub function: Ref<MediumLevelILFunction>,
    pub address: u64,
    pub expr_index: MediumLevelInstructionIndex,
    pub size: usize,
    pub kind: MediumLevelILInstructionKind,
}

Fields§

§function: Ref<MediumLevelILFunction>§address: u64§expr_index: MediumLevelInstructionIndex§size: usize§kind: MediumLevelILInstructionKind

Implementations§

source§

impl MediumLevelILInstruction

source

pub fn lift(&self) -> MediumLevelILLiftedInstruction

source

pub fn tokens(&self) -> Array<InstructionTextToken>

source

pub fn value(&self) -> RegisterValue

Value of expression if constant or a known value

source

pub fn basic_block(&self) -> Option<Ref<BasicBlock<MediumLevelILBlock>>>

Returns the BasicBlock containing the given MediumLevelILInstruction.

source

pub fn possible_values(&self) -> PossibleValueSet

Possible values of expression using path-sensitive static data flow analysis

source

pub fn possible_values_with_opts( &self, options: &[DataFlowQueryOption], ) -> PossibleValueSet

Possible values of expression using path-sensitive static data flow analysis

source

pub fn possible_ssa_variable_values( &self, ssa_var: &SSAVariable, ) -> PossibleValueSet

source

pub fn possible_ssa_variable_values_with_opts( &self, ssa_var: &SSAVariable, options: &[DataFlowQueryOption], ) -> PossibleValueSet

source

pub fn ssa_variable_version(&self, var: Variable) -> SSAVariable

Return the ssa version of a Variable at the given instruction.

source

pub fn ssa_variable_version_after(&self, var: Variable) -> SSAVariable

Return the ssa version of a Variable after the given instruction.

source

pub fn branch_dependencies(&self) -> Array<BranchDependence>

Set of branching instructions that must take the true or false path to reach this instruction

source

pub fn branch_dependence_at( &self, instruction: MediumLevelILInstruction, ) -> BranchDependence

source

pub fn ssa_memory_version(&self) -> usize

Version of active memory contents in SSA form for this instruction

source

pub fn ssa_memory_version_after(&self) -> usize

Version of active memory contents in SSA form for this instruction

source

pub fn expr_type(&self) -> Option<Conf<Ref<Type>>>

Type of expression

source

pub fn set_expr_type<'a, T: Into<Conf<&'a Type>>>(&self, ty: T)

Set type of expression

This API is only meant for workflows or for debugging purposes, since the changes they make are not persistent and get lost after a database save and reload. To make persistent changes to the analysis, one should use other APIs to, for example, change the type of variables. The analysis will then propagate the type of the variable and update the type of related expressions.

source

pub fn variable_for_register(&self, reg_id: RegisterId) -> Variable

source

pub fn variable_for_register_after(&self, reg_id: RegisterId) -> Variable

source

pub fn variable_for_flag(&self, flag_id: FlagId) -> Variable

source

pub fn variable_for_flag_after(&self, flag_id: FlagId) -> Variable

source

pub fn variable_for_stack_location(&self, offset: i64) -> Variable

source

pub fn variable_for_stack_location_after(&self, offset: i64) -> Variable

source

pub fn register_value(&self, reg_id: RegisterId) -> RegisterValue

source

pub fn register_value_after(&self, reg_id: RegisterId) -> RegisterValue

source

pub fn possible_register_values(&self, reg_id: RegisterId) -> PossibleValueSet

source

pub fn possible_register_values_with_opts( &self, reg_id: RegisterId, options: &[DataFlowQueryOption], ) -> PossibleValueSet

source

pub fn possible_register_values_after( &self, reg_id: RegisterId, ) -> PossibleValueSet

source

pub fn possible_register_values_after_with_opts( &self, reg_id: RegisterId, options: &[DataFlowQueryOption], ) -> PossibleValueSet

source

pub fn flag_value(&self, flag_id: FlagId) -> RegisterValue

source

pub fn flag_value_after(&self, flag_id: FlagId) -> RegisterValue

source

pub fn possible_flag_values(&self, flag_id: FlagId) -> PossibleValueSet

source

pub fn possible_flag_values_with_opts( &self, flag_id: FlagId, options: &[DataFlowQueryOption], ) -> PossibleValueSet

source

pub fn possible_flag_values_after_with_opts( &self, flag_id: FlagId, options: &[DataFlowQueryOption], ) -> PossibleValueSet

source

pub fn stack_contents(&self, offset: i64, size: usize) -> RegisterValue

source

pub fn stack_contents_after(&self, offset: i64, size: usize) -> RegisterValue

source

pub fn possible_stack_contents_with_opts( &self, offset: i64, size: usize, options: &[DataFlowQueryOption], ) -> PossibleValueSet

source

pub fn possible_stack_contents_after_with_opts( &self, offset: i64, size: usize, options: &[DataFlowQueryOption], ) -> PossibleValueSet

source

pub fn split_var_for_definition(&self, var: &Variable) -> Variable

Gets the unique variable for a definition instruction. This unique variable can be passed to crate::function::Function::split_variable to split a variable at a definition. The given var is the assigned variable to query.

  • var - variable to query
source

pub fn get_split_var_for_definition(&self, var: &Variable) -> Variable

Trait Implementations§

source§

impl Clone for MediumLevelILInstruction

source§

fn clone(&self) -> MediumLevelILInstruction

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CoreArrayProvider for MediumLevelILInstruction

source§

impl Debug for MediumLevelILInstruction

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit #126799)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.