binaryninja.lowlevelil.LowLevelILFunction¶
-
class
LowLevelILFunction
(arch=None, 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 greater than LLFC_UGT u> Unsigned greater than LLFC_NEG Negative LLFC_POS Positive LLFC_O overflow Overflow LLFC_NO !overflow No overflow -
__init__
(arch=None, handle=None, source_func=None)[source]¶ x.__init__(…) initializes x; see help(type(x)) for signature
Methods
__init__
([arch, handle, source_func])x.__init__(…) initializes x; see help(type(x)) for signature add
(size, a, b[, flags])add
adds expressiona
to expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.add_carry
(size, a, b, carry[, flags])add_carry
adds with carry expressiona
to expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.add_label_for_address
(arch, addr)add_label_for_address
adds a low-level IL label for the given architecturearch
at the given virtual addressaddr
add_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
and returning an expression ofsize
bytes.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 flagsflags
and returning an expression ofsize
bytes.breakpoint
()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 jumps (branches) to the expressiondest
call_stack_adjust
(dest, stack_adjust)call_stack_adjust
returns an expression which first pushes the address of the next instruction onto the stack then jumps (branches) to the expressiondest
.ceil
(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 to expressionb
compare_not_equal
(size, a, b)compare_not_equal
returns comparison expression of sizesize
checking if expressiona
is not equal to expressionb
compare_signed_greater_equal
(size, a, b)compare_signed_greater_equal
returns comparison expression of sizesize
checking if expressiona
is signed greater than or equal to expressionb
compare_signed_greater_than
(size, a, b)compare_signed_greater_than
returns comparison expression of sizesize
checking if expressiona
is signed greater than or equal to expressionb
compare_signed_less_equal
(size, a, b)compare_signed_less_equal
returns comparison expression of sizesize
checking if expressiona
is signed less than or equal to expressionb
compare_signed_less_than
(size, a, b)compare_signed_less_than
returns comparison expression of sizesize
checking if expressiona
is signed less than expressionb
compare_unsigned_greater_equal
(size, a, b)compare_unsigned_greater_equal
returns comparison expression of sizesize
checking if expressiona
is unsigned greater than or equal to expressionb
compare_unsigned_greater_than
(size, a, b)compare_unsigned_greater_than
returns comparison expression of sizesize
checking if expressiona
is unsigned greater than or equal to expressionb
compare_unsigned_less_equal
(size, a, b)compare_unsigned_less_equal
returns comparison expression of sizesize
checking if expressiona
is unsigned less than or equal to expressionb
compare_unsigned_less_than
(size, a, b)compare_unsigned_less_than
returns comparison expression of sizesize
checking if expressiona
is unsigned less than expressionb
const
(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
create_graph
([settings])div_double_prec_signed
(size, a, b[, flags])div_double_prec_signed
signed double precision divide using expressiona
as a single double precision register by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.div_double_prec_unsigned
(size, a, b[, flags])div_double_prec_unsigned
unsigned double precision divide using expressiona
as a single double precision register by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.div_signed
(size, a, b[, flags])div_signed
signed divide expressiona
by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.div_unsigned
(size, a, b[, flags])div_unsigned
unsigned divide expressiona
by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.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
and returning an expression ofsize
bytes.float_compare_equal
(size, a, b)float_compare_equal
returns floating point comparison expression of sizesize
checking if expressiona
is equal to expressionb
float_compare_greater_equal
(size, a, b)float_compare_greater_equal
returns floating point comparison expression of sizesize
checking if expressiona
is greater than or equal to expressionb
float_compare_greater_than
(size, a, b)float_compare_greater_than
returns floating point comparison expression of sizesize
checking if expressiona
is greater than or equal to expressionb
float_compare_less_equal
(size, a, b)float_compare_less_equal
returns floating point comparison expression of sizesize
checking if expressiona
is less than or equal to expressionb
float_compare_less_than
(size, a, b)float_compare_less_than
returns floating point comparison expression of sizesize
checking if expressiona
is less than to expressionb
float_compare_not_equal
(size, a, b)float_compare_not_equal
returns floating point comparison expression of sizesize
checking if expressiona
is not equal to expressionb
float_compare_unordered
(size, a, b)float_compare_unordered
returns floating point comparison expression of sizesize
checking if expressiona
is unordered relative to expressionb
float_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 point valuevalue
with sizesize
float_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
and returning an expression ofsize
bytes.float_mult
(size, a, b[, flags])float_mult
multiplies floating point expressiona
by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.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
and returning an expression ofsize
bytes.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 LowLevelILLabelt
when the condition expressionoperand
is non-zero andf
when it’s zero.int_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 flagsflags``and returning an expression of ``size
bytes.low_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 single double precision register by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.mod_double_prec_unsigned
(size, a, b[, flags])mod_double_prec_unsigned
unsigned double precision modulus using expressiona
as a single double precision register by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.mod_signed
(size, a, b[, flags])mod_signed
signed modulus expressiona
by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.mod_unsigned
(size, a, b[, flags])mod_unsigned
unsigned modulus expressiona
by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.mult
(size, a, b[, flags])mult
multiplies expressiona
by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.mult_double_prec_signed
(size, a, b[, flags])mult_double_prec_signed
multiplies signed with double precision expressiona
by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.mult_double_prec_unsigned
(size, a, b[, flags])mult_double_prec_unsigned
multiplies unsigned with double precision expressiona
by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.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
and returning an expression ofsize
bytes.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
, and removes the entry from the stackreg_stack_push
(size, reg_stack, value[, flags])reg_stack_push
pushes the expressionvalue
of sizesize
onto the top of the register stackreg_stack
reg_stack_top_relative
(size, reg_stack, entry)reg_stack_top_relative
returns a register stack entry of sizesize
at top-relative locationentry
in register stack with namereg_stack
reloc_pointer
(size, value)reloc_pointer
returns an expression for the constant relocated pointervalue
with sizesize
ret
(dest)ret
returns an expression which jumps (branches) to the expressiondest
.rotate_left
(size, a, b[, flags])rotate_left
bitwise rotates left expressiona
by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.rotate_left_carry
(size, a, b, carry[, flags])rotate_left_carry
bitwise rotates left with carry expressiona
by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.rotate_right
(size, a, b[, flags])rotate_right
bitwise rotates right expressiona
by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.rotate_right_carry
(size, a, b, carry[, flags])rotate_right_carry
bitwise rotates right with carry expressiona
by expressionb
potentially setting flagsflags
and returning an expression ofsize
bytes.round_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 expressionvalue
.set_reg_stack_top_relative
(size, reg_stack, …)set_reg_stack_top_relative
sets the top-relative entryentry
of sizesize
in register stackreg_stack
to the expressionvalue
shift_left
(size, a, b[, flags])shift_left
subtracts with borrow expressionb
from expressiona
potentially setting flagsflags
and returning an expression ofsize
bytes.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 returning an expression ofsize
bytes.sub_borrow
(size, a, b, carry[, flags])sub_borrow
subtracts with borrow expressionb
from expressiona
potentially setting flagsflags
and returning an expression ofsize
bytes.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.unimplemented
()unimplemented
returns the unimplemented expression.unimplemented_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
and returning an expression ofsize
bytes.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) instructions
A generator of llil instructions of the current llil function 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) -