binaryninja.lowlevelil.LowLevelILFunction¶
-
class
binaryninja.lowlevelil.
LowLevelILFunction
(arch, handle=None, source_func=None)[source]¶ class LowLevelILFunction
contains the list of LowLevelILExpr objects that make up a binaryninja.function. LowLevelILExpr objects can be added to the LowLevelILFunction by callingappend
and passing the result of the various class methods which return LowLevelILExpr objects.LowLevelILFlagCondition values used as parameters in the
flag_condition
method.LowLevelILFlagCondition Operator Description LLFC_E == Equal LLFC_NE != Not equal LLFC_SLT s< Signed less than LLFC_ULT u< Unsigned less than LLFC_SLE s<= Signed less than or equal LLFC_ULE u<= Unsigned less than or equal LLFC_SGE s>= Signed greater than or equal LLFC_UGE u>= Unsigned greater than or equal LLFC_SGT s> Signed greather than LLFC_UGT u> Unsigned greater than LLFC_NEG Negative LLFC_POS Positive LLFC_O overflow Overflow LLFC_NO !overflow No overflow Methods
__init__
(arch[, handle, source_func])add
(size, a, b[, flags])add
adds expressiona
to expressionb
potentially setting flagsflags
and returningadd_carry
(size, a, b, carry[, flags])add_carry
adds with carry expressiona
to expressionb
potentially setting flagsflags
andadd_label_for_address
(arch, addr)add_label_for_address
adds a low-level IL label for the given architecturearch
at the given virtualadd_label_list
(labels)add_label_list
returns a label list expression for the given list of LowLevelILLabel objects.add_operand_list
(operands)add_operand_list
returns an operand list expression for the given list of integer operands.and_expr
(size, a, b[, flags])and_expr
bitwise and’s expressiona
and expressionb
potentially setting flagsflags
append
(expr)append
adds the LowLevelILExprexpr
to the current LowLevelILFunction.arith_shift_right
(size, a, b[, flags])arith_shift_right
shifts arithmatic right expressiona
by expressionb
potentially setting flagsbreakpoint
()breakpoint
returns a processor breakpoint expression.call
(dest)call
returns an expression which first pushes the address of the next instruction onto the stack then jumpscall_stack_adjust
(dest, stack_adjust)call_stack_adjust
returns an expression which first pushes the address of the next instruction onto the stackceil
(size, value[, flags])ceil
rounds a floating point value to an integer towards positive infinityclear_indirect_branches
()compare_equal
(size, a, b)compare_equal
returns comparison expression of sizesize
checking if expressiona
is equal tocompare_not_equal
(size, a, b)compare_not_equal
returns comparison expression of sizesize
checking if expressiona
is not equal tocompare_signed_greater_equal
(size, a, b)compare_signed_greater_equal
returns comparison expression of sizesize
checking if expressiona
iscompare_signed_greater_than
(size, a, b)compare_signed_greater_than
returns comparison expression of sizesize
checking if expressiona
iscompare_signed_less_equal
(size, a, b)compare_signed_less_equal
returns comparison expression of sizesize
checking if expressiona
iscompare_signed_less_than
(size, a, b)compare_signed_less_than
returns comparison expression of sizesize
checking if expressiona
iscompare_unsigned_greater_equal
(size, a, b)compare_unsigned_greater_equal
returns comparison expression of sizesize
checking if expressiona
compare_unsigned_greater_than
(size, a, b)compare_unsigned_greater_than
returns comparison expression of sizesize
checking if expressiona
iscompare_unsigned_less_equal
(size, a, b)compare_unsigned_less_equal
returns comparison expression of sizesize
checking if expressiona
iscompare_unsigned_less_than
(size, a, b)compare_unsigned_less_than
returns comparison expression of sizesize
checking if expressiona
isconst
(size, value)const
returns an expression for the constant integervalue
with sizesize
const_pointer
(size, value)const_pointer
returns an expression for the constant pointervalue
with sizesize
div_double_prec_signed
(size, a, b[, flags])div_double_prec_signed
signed double precision divide using expressiona
as adiv_double_prec_unsigned
(size, a, b[, flags])div_double_prec_unsigned
unsigned double precision divide using expressiona
asdiv_signed
(size, a, b[, flags])div_signed
signed divide expressiona
by expressionb
potentially setting flagsflags
div_unsigned
(size, a, b[, flags])div_unsigned
unsigned divide expressiona
by expressionb
potentially setting flagsflags
expr
(operation[, a, b, c, d, size, flags])finalize
()finalize
ends the function and computes the list of basic blocks.flag
(reg)flag
returns a flag expression for the given flag name.flag_bit
(size, reg, bit)flag_bit
sets the flag namedreg
and sizesize
to the constant integer valuebit
flag_condition
(cond[, sem_class])flag_condition
returns a flag_condition expression for the given LowLevelILFlagConditionflag_group
(sem_group)flag_group
returns a flag_group expression for the given semantic flag groupfloat_abs
(size, value[, flags])float_abs
returns absolute value of floating point expressionvalue
of sizesize
potentially setting flagsfloat_add
(size, a, b[, flags])float_add
adds floating point expressiona
to expressionb
potentially setting flagsflags
float_compare_equal
(size, a, b)float_compare_equal
returns floating point comparison expression of sizesize
checking iffloat_compare_greater_equal
(size, a, b)float_compare_greater_equal
returns floating point comparison expression of sizesize
checking iffloat_compare_greater_than
(size, a, b)float_compare_greater_than
returns floating point comparison expression of sizesize
checking iffloat_compare_less_equal
(size, a, b)float_compare_less_equal
returns floating point comparison expression of sizesize
checking iffloat_compare_less_than
(size, a, b)float_compare_less_than
returns floating point comparison expression of sizesize
checking iffloat_compare_not_equal
(size, a, b)float_compare_not_equal
returns floating point comparison expression of sizesize
checking iffloat_compare_unordered
(size, a, b)float_compare_unordered
returns floating point comparison expression of sizesize
checking iffloat_const_double
(value)float_const_double
returns an expression for the double precision floating point valuevalue
float_const_raw
(size, value)float_const_raw
returns an expression for the constant raw binary floating pointfloat_const_single
(value)float_const_single
returns an expression for the single precision floating point valuevalue
float_convert
(size, value[, flags])int_to_float
converts floating point value of expressionvalue
to sizesize
potentially setting flagsfloat_div
(size, a, b[, flags])float_div
divides floating point expressiona
by expressionb
potentially setting flagsflags
float_mult
(size, a, b[, flags])float_mult
multiplies floating point expressiona
by expressionb
potentially setting flagsflags
float_neg
(size, value[, flags])float_neg
returns sign negation of floating point expressionvalue
of sizesize
potentially setting flagsfloat_sqrt
(size, value[, flags])float_sqrt
returns square root of floating point expressionvalue
of sizesize
potentially setting flagsfloat_sub
(size, a, b[, flags])float_sub
subtracts floating point expressionb
from expressiona
potentially setting flagsflags
float_to_int
(size, value[, flags])float_to_int
returns integer value of floating point expressionvalue
of sizesize
potentially setting flagsfloat_trunc
(size, value[, flags])float_trunc
rounds a floating point value to an integer towards zerofloor
(size, value[, flags])floor
rounds a floating point value to an integer towards negative infinityget_instruction_start
(addr[, arch])get_label_for_address
(arch, addr)get_label_for_address
returns the LowLevelILLabel for the given Architecturearch
and IL addressaddr
.get_mapped_medium_level_il_expr_index
(expr)get_mapped_medium_level_il_instruction_index
(instr)get_medium_level_il_expr_index
(expr)get_medium_level_il_instruction_index
(instr)get_non_ssa_instruction_index
(instr)get_ssa_flag_definition
(flag_ssa)get_ssa_flag_uses
(flag_ssa)get_ssa_flag_value
(flag_ssa)get_ssa_instruction_index
(instr)get_ssa_memory_definition
(index)get_ssa_memory_uses
(index)get_ssa_reg_definition
(reg_ssa)get_ssa_reg_uses
(reg_ssa)get_ssa_reg_value
(reg_ssa)goto
(label)goto
returns a goto expression which jumps to the provided LowLevelILLabel.if_expr
(operand, t, f)if_expr
returns theif
expression which depending on conditionoperand
jumps to the LowLevelILLabelint_to_float
(size, value[, flags])int_to_float
returns floating point value of integer expressionvalue
of sizesize
potentially setting flagsintrinsic
(outputs, intrinsic, params[, flags])intrinsic
return an intrinsic expression.jump
(dest)jump
returns an expression which jumps (branches) to the expressiondest
load
(size, addr)load
Readssize
bytes from the expressionaddr
logical_shift_right
(size, a, b[, flags])logical_shift_right
shifts logically right expressiona
by expressionb
potentially setting flagslow_part
(size, value[, flags])low_part
truncatesvalue
tosize
bytesmark_label
(label)mark_label
assigns a LowLevelILLabel to the current IL address.mod_double_prec_signed
(size, a, b[, flags])mod_double_prec_signed
signed double precision modulus using expressiona
as a singlemod_double_prec_unsigned
(size, a, b[, flags])mod_double_prec_unsigned
unsigned double precision modulus using expressiona
asmod_signed
(size, a, b[, flags])mod_signed
signed modulus expressiona
by expressionb
potentially setting flagsflags
mod_unsigned
(size, a, b[, flags])mod_unsigned
unsigned modulus expressiona
by expressionb
potentially setting flagsflags
mult
(size, a, b[, flags])mult
multiplies expressiona
by expressionb
potentially setting flagsflags
and returning anmult_double_prec_signed
(size, a, b[, flags])mult_double_prec_signed
multiplies signed with double precision expressiona
by expressionb
mult_double_prec_unsigned
(size, a, b[, flags])mult_double_prec_unsigned
multiplies unsigned with double precision expressiona
by expressionb
neg_expr
(size, value[, flags])neg_expr
two’s complement sign negation of expressionvalue
of sizesize
potentially setting flagsno_ret
()no_ret
returns an expression halts disassemblynop
()nop
no operation, this instruction does nothingnot_expr
(size, value[, flags])not_expr
bitwise inverse of expressionvalue
of sizesize
potentially setting flagsoperand
(n, expr)operand
sets the operand number of the expressionexpr
and passes backexpr
without modification.or_expr
(size, a, b[, flags])or_expr
bitwise or’s expressiona
and expressionb
potentially setting flagsflags
pop
(size)pop
readssize
bytes from the stack, adjusting the stack bysize
.push
(size, value)push
writessize
bytes from expressionvalue
to the stack, adjusting the stack bysize
.reg
(size, reg)reg
returns a register of sizesize
with namereg
reg_split
(size, hi, lo)reg_split
combines registers of sizesize
with nameshi
andlo
reg_stack_pop
(size, reg_stack)reg_stack_pop
returns the top entry of sizesize
in register stack with namereg_stack
, andreg_stack_push
(size, reg_stack, value[, flags])reg_stack_push
pushes the expressionvalue
of sizesize
onto the top of the registerreg_stack_top_relative
(size, reg_stack, entry)reg_stack_top_relative
returns a register stack entry of sizesize
at top-relativeret
(dest)ret
returns an expression which jumps (branches) to the expressiondest
.ret
is a special alias forrotate_left
(size, a, b[, flags])rotate_left
bitwise rotates left expressiona
by expressionb
potentially setting flagsflags
rotate_left_carry
(size, a, b, carry[, flags])rotate_left_carry
bitwise rotates left with carry expressiona
by expressionb
potentially settingrotate_right
(size, a, b[, flags])rotate_right
bitwise rotates right expressiona
by expressionb
potentially setting flagsflags
rotate_right_carry
(size, a, b, carry[, flags])rotate_right_carry
bitwise rotates right with carry expressiona
by expressionb
potentially settinground_to_int
(size, value[, flags])round_to_int
rounds a floating point value to the nearest integerset_current_address
(value[, arch])set_flag
(flag, value)set_flag
sets the flagflag
to the LowLevelILExprvalue
set_indirect_branches
(branches)set_reg
(size, reg, value[, flags])set_reg
sets the registerreg
of sizesize
to the expressionvalue
set_reg_split
(size, hi, lo, value[, flags])set_reg_split
useshi
andlo
as a single extended register settinghi:lo
to the expressionset_reg_stack_top_relative
(size, reg_stack, ...)set_reg_stack_top_relative
sets the top-relative entryentry
of sizesize
in registershift_left
(size, a, b[, flags])shift_left
subtracts with borrow expressionb
from expressiona
potentially setting flagsflags
sign_extend
(size, value[, flags])sign_extend
two’s complement sign-extends the expression invalue
tosize
bytesstore
(size, addr, value[, flags])store
Writessize
bytes to expressionaddr
read from expressionvalue
sub
(size, a, b[, flags])sub
subtracts expressionb
from expressiona
potentially setting flagsflags
and returningsub_borrow
(size, a, b, carry[, flags])sub_borrow
subtracts with borrow expressionb
from expressiona
potentially setting flagsflags
system_call
()system_call
return a system call expression.tailcall
(dest)tailcall
returns an expression which jumps (branches) to the expressiondest
test_bit
(size, a, b)trap
(value)trap
returns a processor trap (interrupt) expression of the given integervalue
.undefined
()undefined
returns the undefined expression. This should be used for instructions which perform functions butunimplemented
()unimplemented
returns the unimplemented expression. This should be used for all instructions which aren’tunimplemented_memory_ref
(size, addr)unimplemented_memory_ref
a memory reference to expressionaddr
of sizesize
with unimplemented operation.xor_expr
(size, a, b[, flags])xor_expr
xor’s expressiona
with expressionb
potentially setting flagsflags
zero_extend
(size, value[, flags])zero_extend
zero-extends the expression invalue
tosize
bytesAttributes
basic_blocks
list of LowLevelILBasicBlock objects (read-only) current_address
Current IL Address (read/write) mapped_medium_level_il
Medium level IL with mappings between low level IL and medium level IL. medium_level_il
Medium level IL for this low level IL. non_ssa_form
Low level IL in non-SSA (default) form (read-only) ssa_form
Low level IL in SSA form (read-only) temp_flag_count
Number of temporary flags (read-only) temp_reg_count
Number of temporary registers (read-only)