binaryninja.lowlevelil.LowLevelILFunction¶
-
class
LowLevelILFunction(arch=None, handle=None, source_func=None)[source]¶ class LowLevelILFunctioncontains the list of LowLevelILExpr objects that make up a binaryninja.function. LowLevelILExpr objects can be added to the LowLevelILFunction by callingappendand passing the result of the various class methods which return LowLevelILExpr objects.LowLevelILFlagCondition values used as parameters in the
flag_conditionmethod.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])addadds expressionato expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.add_carry(size, a, b, carry[, flags])add_carryadds with carry expressionato expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.add_label_for_address(arch, addr)add_label_for_addressadds a low-level IL label for the given architecturearchat the given virtual addressaddradd_label_list(labels)add_label_listreturns a label list expression for the given list of LowLevelILLabel objects.add_operand_list(operands)add_operand_listreturns an operand list expression for the given list of integer operands.and_expr(size, a, b[, flags])and_exprbitwise and’s expressionaand expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.append(expr)appendadds the LowLevelILExprexprto the current LowLevelILFunction.arith_shift_right(size, a, b[, flags])arith_shift_rightshifts arithmatic right expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.breakpoint()breakpointreturns a processor breakpoint expression.call(dest)callreturns an expression which first pushes the address of the next instruction onto the stack then jumps (branches) to the expressiondestcall_stack_adjust(dest, stack_adjust)call_stack_adjustreturns an expression which first pushes the address of the next instruction onto the stack then jumps (branches) to the expressiondest.ceil(size, value[, flags])ceilrounds a floating point value to an integer towards positive infinityclear_indirect_branches()compare_equal(size, a, b)compare_equalreturns comparison expression of sizesizechecking if expressionais equal to expressionbcompare_not_equal(size, a, b)compare_not_equalreturns comparison expression of sizesizechecking if expressionais not equal to expressionbcompare_signed_greater_equal(size, a, b)compare_signed_greater_equalreturns comparison expression of sizesizechecking if expressionais signed greater than or equal to expressionbcompare_signed_greater_than(size, a, b)compare_signed_greater_thanreturns comparison expression of sizesizechecking if expressionais signed greater than or equal to expressionbcompare_signed_less_equal(size, a, b)compare_signed_less_equalreturns comparison expression of sizesizechecking if expressionais signed less than or equal to expressionbcompare_signed_less_than(size, a, b)compare_signed_less_thanreturns comparison expression of sizesizechecking if expressionais signed less than expressionbcompare_unsigned_greater_equal(size, a, b)compare_unsigned_greater_equalreturns comparison expression of sizesizechecking if expressionais unsigned greater than or equal to expressionbcompare_unsigned_greater_than(size, a, b)compare_unsigned_greater_thanreturns comparison expression of sizesizechecking if expressionais unsigned greater than or equal to expressionbcompare_unsigned_less_equal(size, a, b)compare_unsigned_less_equalreturns comparison expression of sizesizechecking if expressionais unsigned less than or equal to expressionbcompare_unsigned_less_than(size, a, b)compare_unsigned_less_thanreturns comparison expression of sizesizechecking if expressionais unsigned less than expressionbconst(size, value)constreturns an expression for the constant integervaluewith sizesizeconst_pointer(size, value)const_pointerreturns an expression for the constant pointervaluewith sizesizecreate_graph([settings])div_double_prec_signed(size, a, b[, flags])div_double_prec_signedsigned double precision divide using expressionaas a single double precision register by expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.div_double_prec_unsigned(size, a, b[, flags])div_double_prec_unsignedunsigned double precision divide using expressionaas a single double precision register by expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.div_signed(size, a, b[, flags])div_signedsigned divide expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.div_unsigned(size, a, b[, flags])div_unsignedunsigned divide expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.expr(operation[, a, b, c, d, size, flags])finalize()finalizeends the function and computes the list of basic blocks.flag(reg)flagreturns a flag expression for the given flag name.flag_bit(size, reg, bit)flag_bitsets the flag namedregand sizesizeto the constant integer valuebitflag_condition(cond[, sem_class])flag_conditionreturns a flag_condition expression for the given LowLevelILFlagConditionflag_group(sem_group)flag_groupreturns a flag_group expression for the given semantic flag groupfloat_abs(size, value[, flags])float_absreturns absolute value of floating point expressionvalueof sizesizepotentially setting flagsfloat_add(size, a, b[, flags])float_addadds floating point expressionato expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.float_compare_equal(size, a, b)float_compare_equalreturns floating point comparison expression of sizesizechecking if expressionais equal to expressionbfloat_compare_greater_equal(size, a, b)float_compare_greater_equalreturns floating point comparison expression of sizesizechecking if expressionais greater than or equal to expressionbfloat_compare_greater_than(size, a, b)float_compare_greater_thanreturns floating point comparison expression of sizesizechecking if expressionais greater than or equal to expressionbfloat_compare_less_equal(size, a, b)float_compare_less_equalreturns floating point comparison expression of sizesizechecking if expressionais less than or equal to expressionbfloat_compare_less_than(size, a, b)float_compare_less_thanreturns floating point comparison expression of sizesizechecking if expressionais less than to expressionbfloat_compare_not_equal(size, a, b)float_compare_not_equalreturns floating point comparison expression of sizesizechecking if expressionais not equal to expressionbfloat_compare_unordered(size, a, b)float_compare_unorderedreturns floating point comparison expression of sizesizechecking if expressionais unordered relative to expressionbfloat_const_double(value)float_const_doublereturns an expression for the double precision floating point valuevaluefloat_const_raw(size, value)float_const_rawreturns an expression for the constant raw binary floating point valuevaluewith sizesizefloat_const_single(value)float_const_singlereturns an expression for the single precision floating point valuevaluefloat_convert(size, value[, flags])int_to_floatconverts floating point value of expressionvalueto sizesizepotentially setting flagsfloat_div(size, a, b[, flags])float_divdivides floating point expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.float_mult(size, a, b[, flags])float_multmultiplies floating point expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.float_neg(size, value[, flags])float_negreturns sign negation of floating point expressionvalueof sizesizepotentially setting flagsfloat_sqrt(size, value[, flags])float_sqrtreturns square root of floating point expressionvalueof sizesizepotentially setting flagsfloat_sub(size, a, b[, flags])float_subsubtracts floating point expressionbfrom expressionapotentially setting flagsflagsand returning an expression ofsizebytes.float_to_int(size, value[, flags])float_to_intreturns integer value of floating point expressionvalueof sizesizepotentially setting flagsfloat_trunc(size, value[, flags])float_truncrounds a floating point value to an integer towards zerofloor(size, value[, flags])floorrounds a floating point value to an integer towards negative infinityget_instruction_start(addr[, arch])get_label_for_address(arch, addr)get_label_for_addressreturns the LowLevelILLabel for the given Architecturearchand 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)gotoreturns a goto expression which jumps to the provided LowLevelILLabel.if_expr(operand, t, f)if_exprreturns theifexpression which depending on conditionoperandjumps to the LowLevelILLabeltwhen the condition expressionoperandis non-zero andfwhen it’s zero.int_to_float(size, value[, flags])int_to_floatreturns floating point value of integer expressionvalueof sizesizepotentially setting flagsintrinsic(outputs, intrinsic, params[, flags])intrinsicreturn an intrinsic expression.jump(dest)jumpreturns an expression which jumps (branches) to the expressiondestload(size, addr)loadReadssizebytes from the expressionaddrlogical_shift_right(size, a, b[, flags])logical_shift_rightshifts logically right expressionaby expressionbpotentially setting flagsflags``and returning an expression of ``sizebytes.low_part(size, value[, flags])low_parttruncatesvaluetosizebytesmark_label(label)mark_labelassigns a LowLevelILLabel to the current IL address.mod_double_prec_signed(size, a, b[, flags])mod_double_prec_signedsigned double precision modulus using expressionaas a single double precision register by expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.mod_double_prec_unsigned(size, a, b[, flags])mod_double_prec_unsignedunsigned double precision modulus using expressionaas a single double precision register by expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.mod_signed(size, a, b[, flags])mod_signedsigned modulus expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.mod_unsigned(size, a, b[, flags])mod_unsignedunsigned modulus expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.mult(size, a, b[, flags])multmultiplies expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.mult_double_prec_signed(size, a, b[, flags])mult_double_prec_signedmultiplies signed with double precision expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.mult_double_prec_unsigned(size, a, b[, flags])mult_double_prec_unsignedmultiplies unsigned with double precision expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.neg_expr(size, value[, flags])neg_exprtwo’s complement sign negation of expressionvalueof sizesizepotentially setting flagsno_ret()no_retreturns an expression halts disassemblynop()nopno operation, this instruction does nothingnot_expr(size, value[, flags])not_exprbitwise inverse of expressionvalueof sizesizepotentially setting flagsoperand(n, expr)operandsets the operand number of the expressionexprand passes backexprwithout modification.or_expr(size, a, b[, flags])or_exprbitwise or’s expressionaand expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.pop(size)popreadssizebytes from the stack, adjusting the stack bysize.push(size, value)pushwritessizebytes from expressionvalueto the stack, adjusting the stack bysize.reg(size, reg)regreturns a register of sizesizewith nameregreg_split(size, hi, lo)reg_splitcombines registers of sizesizewith nameshiandloreg_stack_pop(size, reg_stack)reg_stack_popreturns the top entry of sizesizein register stack with namereg_stack, and removes the entry from the stackreg_stack_push(size, reg_stack, value[, flags])reg_stack_pushpushes the expressionvalueof sizesizeonto the top of the register stackreg_stackreg_stack_top_relative(size, reg_stack, entry)reg_stack_top_relativereturns a register stack entry of sizesizeat top-relative locationentryin register stack with namereg_stackreloc_pointer(size, value)reloc_pointerreturns an expression for the constant relocated pointervaluewith sizesizeret(dest)retreturns an expression which jumps (branches) to the expressiondest.rotate_left(size, a, b[, flags])rotate_leftbitwise rotates left expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.rotate_left_carry(size, a, b, carry[, flags])rotate_left_carrybitwise rotates left with carry expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.rotate_right(size, a, b[, flags])rotate_rightbitwise rotates right expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.rotate_right_carry(size, a, b, carry[, flags])rotate_right_carrybitwise rotates right with carry expressionaby expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.round_to_int(size, value[, flags])round_to_introunds a floating point value to the nearest integerset_current_address(value[, arch])set_flag(flag, value)set_flagsets the flagflagto the LowLevelILExprvalueset_indirect_branches(branches)set_reg(size, reg, value[, flags])set_regsets the registerregof sizesizeto the expressionvalueset_reg_split(size, hi, lo, value[, flags])set_reg_splituseshiandloas a single extended register settinghi:loto the expressionvalue.set_reg_stack_top_relative(size, reg_stack, …)set_reg_stack_top_relativesets the top-relative entryentryof sizesizein register stackreg_stackto the expressionvalueshift_left(size, a, b[, flags])shift_leftsubtracts with borrow expressionbfrom expressionapotentially setting flagsflagsand returning an expression ofsizebytes.sign_extend(size, value[, flags])sign_extendtwo’s complement sign-extends the expression invaluetosizebytesstore(size, addr, value[, flags])storeWritessizebytes to expressionaddrread from expressionvaluesub(size, a, b[, flags])subsubtracts expressionbfrom expressionapotentially setting flagsflagsand returning an expression ofsizebytes.sub_borrow(size, a, b, carry[, flags])sub_borrowsubtracts with borrow expressionbfrom expressionapotentially setting flagsflagsand returning an expression ofsizebytes.system_call()system_callreturn a system call expression.tailcall(dest)tailcallreturns an expression which jumps (branches) to the expressiondesttest_bit(size, a, b)trap(value)trapreturns a processor trap (interrupt) expression of the given integervalue.undefined()undefinedreturns the undefined expression.unimplemented()unimplementedreturns the unimplemented expression.unimplemented_memory_ref(size, addr)unimplemented_memory_refa memory reference to expressionaddrof sizesizewith unimplemented operation.xor_expr(size, a, b[, flags])xor_exprxor’s expressionawith expressionbpotentially setting flagsflagsand returning an expression ofsizebytes.zero_extend(size, value[, flags])zero_extendzero-extends the expression invaluetosizebytesAttributes
basic_blockslist of LowLevelILBasicBlock objects (read-only) current_addressCurrent IL Address (read/write) instructionsA generator of llil instructions of the current llil function mapped_medium_level_ilMedium level IL with mappings between low level IL and medium level IL. medium_level_ilMedium level IL for this low level IL. non_ssa_formLow level IL in non-SSA (default) form (read-only) ssa_formLow level IL in SSA form (read-only) temp_flag_countNumber of temporary flags (read-only) temp_reg_countNumber of temporary registers (read-only) -