angr 9.2.117__py3-none-manylinux2014_x86_64.whl → 9.2.119__py3-none-manylinux2014_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of angr might be problematic. Click here for more details.
- angr/__init__.py +2 -1
- angr/__main__.py +21 -1
- angr/analyses/__init__.py +4 -0
- angr/analyses/analysis.py +88 -46
- angr/analyses/backward_slice.py +15 -18
- angr/analyses/binary_optimizer.py +29 -34
- angr/analyses/bindiff.py +35 -44
- angr/analyses/boyscout.py +1 -0
- angr/analyses/callee_cleanup_finder.py +3 -4
- angr/analyses/calling_convention.py +98 -98
- angr/analyses/cdg.py +5 -12
- angr/analyses/cfg/__init__.py +1 -0
- angr/analyses/cfg/cfb.py +14 -20
- angr/analyses/cfg/cfg.py +2 -1
- angr/analyses/cfg/cfg_arch_options.py +4 -1
- angr/analyses/cfg/cfg_base.py +122 -165
- angr/analyses/cfg/cfg_emulated.py +60 -92
- angr/analyses/cfg/cfg_fast.py +406 -335
- angr/analyses/cfg/cfg_fast_soot.py +10 -17
- angr/analyses/cfg/cfg_job_base.py +6 -7
- angr/analyses/cfg/indirect_jump_resolvers/__init__.py +1 -0
- angr/analyses/cfg/indirect_jump_resolvers/amd64_elf_got.py +2 -3
- angr/analyses/cfg/indirect_jump_resolvers/amd64_pe_iat.py +2 -3
- angr/analyses/cfg/indirect_jump_resolvers/arm_elf_fast.py +6 -8
- angr/analyses/cfg/indirect_jump_resolvers/const_resolver.py +3 -5
- angr/analyses/cfg/indirect_jump_resolvers/default_resolvers.py +1 -0
- angr/analyses/cfg/indirect_jump_resolvers/jumptable.py +97 -112
- angr/analyses/cfg/indirect_jump_resolvers/mips_elf_fast.py +26 -32
- angr/analyses/cfg/indirect_jump_resolvers/propagator_utils.py +1 -0
- angr/analyses/cfg/indirect_jump_resolvers/resolver.py +7 -7
- angr/analyses/cfg/indirect_jump_resolvers/x86_elf_pic_plt.py +3 -8
- angr/analyses/cfg/indirect_jump_resolvers/x86_pe_iat.py +2 -3
- angr/analyses/cfg_slice_to_sink/__init__.py +1 -0
- angr/analyses/cfg_slice_to_sink/cfg_slice_to_sink.py +4 -4
- angr/analyses/cfg_slice_to_sink/graph.py +4 -1
- angr/analyses/cfg_slice_to_sink/transitions.py +4 -2
- angr/analyses/class_identifier.py +1 -0
- angr/analyses/code_tagging.py +9 -9
- angr/analyses/complete_calling_conventions.py +28 -36
- angr/analyses/congruency_check.py +6 -11
- angr/analyses/data_dep/__init__.py +1 -0
- angr/analyses/data_dep/data_dependency_analysis.py +38 -48
- angr/analyses/data_dep/dep_nodes.py +13 -12
- angr/analyses/data_dep/sim_act_location.py +3 -0
- angr/analyses/datagraph_meta.py +7 -7
- angr/analyses/ddg.py +48 -69
- angr/analyses/decompiler/__init__.py +3 -0
- angr/analyses/decompiler/ail_simplifier.py +929 -400
- angr/analyses/decompiler/ailgraph_walker.py +1 -0
- angr/analyses/decompiler/block_io_finder.py +13 -4
- angr/analyses/decompiler/block_similarity.py +28 -18
- angr/analyses/decompiler/block_simplifier.py +40 -104
- angr/analyses/decompiler/callsite_maker.py +124 -82
- angr/analyses/decompiler/ccall_rewriters/__init__.py +1 -0
- angr/analyses/decompiler/ccall_rewriters/amd64_ccalls.py +115 -105
- angr/analyses/decompiler/ccall_rewriters/rewriter_base.py +2 -1
- angr/analyses/decompiler/clinic.py +371 -184
- angr/analyses/decompiler/condition_processor.py +127 -116
- angr/analyses/decompiler/counters/__init__.py +5 -0
- angr/analyses/decompiler/counters/boolean_counter.py +27 -0
- angr/analyses/decompiler/{call_counter.py → counters/call_counter.py} +5 -4
- angr/analyses/decompiler/{expression_counters.py → counters/expression_counters.py} +5 -4
- angr/analyses/decompiler/counters/seq_cf_structure_counter.py +63 -0
- angr/analyses/decompiler/decompilation_cache.py +2 -1
- angr/analyses/decompiler/decompilation_options.py +1 -0
- angr/analyses/decompiler/decompiler.py +50 -27
- angr/analyses/decompiler/dephication/__init__.py +6 -0
- angr/analyses/decompiler/dephication/dephication_base.py +87 -0
- angr/analyses/decompiler/dephication/graph_dephication.py +63 -0
- angr/analyses/decompiler/dephication/graph_rewriting.py +116 -0
- angr/analyses/decompiler/dephication/graph_vvar_mapping.py +313 -0
- angr/analyses/decompiler/dephication/rewriting_engine.py +247 -0
- angr/analyses/decompiler/dephication/seqnode_dephication.py +106 -0
- angr/analyses/decompiler/empty_node_remover.py +1 -0
- angr/analyses/decompiler/expression_narrower.py +12 -17
- angr/analyses/decompiler/goto_manager.py +43 -4
- angr/analyses/decompiler/graph_region.py +19 -31
- angr/analyses/decompiler/jump_target_collector.py +1 -0
- angr/analyses/decompiler/jumptable_entry_condition_rewriter.py +2 -1
- angr/analyses/decompiler/optimization_passes/__init__.py +7 -3
- angr/analyses/decompiler/optimization_passes/base_ptr_save_simplifier.py +23 -18
- angr/analyses/decompiler/optimization_passes/call_stmt_rewriter.py +46 -0
- angr/analyses/decompiler/optimization_passes/code_motion.py +4 -2
- angr/analyses/decompiler/optimization_passes/const_derefs.py +36 -36
- angr/analyses/decompiler/optimization_passes/const_prop_reverter.py +6 -9
- angr/analyses/decompiler/optimization_passes/cross_jump_reverter.py +4 -3
- angr/analyses/decompiler/optimization_passes/deadblock_remover.py +1 -0
- angr/analyses/decompiler/optimization_passes/div_simplifier.py +78 -72
- angr/analyses/decompiler/optimization_passes/duplication_reverter/__init__.py +2 -0
- angr/analyses/decompiler/optimization_passes/duplication_reverter/ail_merge_graph.py +503 -0
- angr/analyses/decompiler/optimization_passes/duplication_reverter/duplication_reverter.py +1215 -0
- angr/analyses/decompiler/optimization_passes/duplication_reverter/errors.py +16 -0
- angr/analyses/decompiler/optimization_passes/duplication_reverter/similarity.py +126 -0
- angr/analyses/decompiler/optimization_passes/duplication_reverter/utils.py +169 -0
- angr/analyses/decompiler/optimization_passes/engine_base.py +60 -63
- angr/analyses/decompiler/optimization_passes/expr_op_swapper.py +6 -7
- angr/analyses/decompiler/optimization_passes/flip_boolean_cmp.py +1 -0
- angr/analyses/decompiler/optimization_passes/inlined_string_transformation_simplifier.py +102 -37
- angr/analyses/decompiler/optimization_passes/ite_expr_converter.py +8 -10
- angr/analyses/decompiler/optimization_passes/ite_region_converter.py +128 -18
- angr/analyses/decompiler/optimization_passes/lowered_switch_simplifier.py +142 -145
- angr/analyses/decompiler/optimization_passes/mod_simplifier.py +27 -23
- angr/analyses/decompiler/optimization_passes/multi_simplifier.py +30 -34
- angr/analyses/decompiler/optimization_passes/optimization_pass.py +108 -47
- angr/analyses/decompiler/optimization_passes/register_save_area_simplifier.py +10 -3
- angr/analyses/decompiler/optimization_passes/ret_addr_save_simplifier.py +5 -6
- angr/analyses/decompiler/optimization_passes/ret_deduplicator.py +3 -2
- angr/analyses/decompiler/optimization_passes/return_duplicator_base.py +125 -13
- angr/analyses/decompiler/optimization_passes/return_duplicator_high.py +1 -0
- angr/analyses/decompiler/optimization_passes/return_duplicator_low.py +3 -2
- angr/analyses/decompiler/optimization_passes/stack_canary_simplifier.py +52 -21
- angr/analyses/decompiler/optimization_passes/switch_default_case_duplicator.py +3 -2
- angr/analyses/decompiler/optimization_passes/win_stack_canary_simplifier.py +47 -36
- angr/analyses/decompiler/optimization_passes/x86_gcc_getpc_simplifier.py +2 -1
- angr/analyses/decompiler/peephole_optimizations/__init__.py +2 -0
- angr/analyses/decompiler/peephole_optimizations/a_div_const_add_a_mul_n_div_const.py +26 -22
- angr/analyses/decompiler/peephole_optimizations/a_mul_const_div_shr_const.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/a_shl_const_sub_a.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/a_sub_a_div.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/a_sub_a_div_const_mul_const.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/a_sub_a_sub_n.py +8 -4
- angr/analyses/decompiler/peephole_optimizations/arm_cmpf.py +28 -27
- angr/analyses/decompiler/peephole_optimizations/base.py +17 -20
- angr/analyses/decompiler/peephole_optimizations/basepointeroffset_add_n.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/basepointeroffset_and_mask.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/bitwise_or_to_logical_or.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/bool_expr_xor_1.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/bswap.py +29 -22
- angr/analyses/decompiler/peephole_optimizations/cmpord_rewriter.py +3 -4
- angr/analyses/decompiler/peephole_optimizations/coalesce_adjacent_shrs.py +39 -0
- angr/analyses/decompiler/peephole_optimizations/coalesce_same_cascading_ifs.py +2 -1
- angr/analyses/decompiler/peephole_optimizations/const_mull_a_shift.py +94 -29
- angr/analyses/decompiler/peephole_optimizations/constant_derefs.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/conv_a_sub0_shr_and.py +48 -49
- angr/analyses/decompiler/peephole_optimizations/conv_shl_shr.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/eager_eval.py +41 -34
- angr/analyses/decompiler/peephole_optimizations/extended_byte_and_mask.py +2 -1
- angr/analyses/decompiler/peephole_optimizations/inlined_strcpy.py +28 -18
- angr/analyses/decompiler/peephole_optimizations/inlined_strcpy_consolidation.py +8 -4
- angr/analyses/decompiler/peephole_optimizations/inlined_wstrcpy.py +28 -18
- angr/analyses/decompiler/peephole_optimizations/invert_negated_logical_conjuction_disjunction.py +32 -32
- angr/analyses/decompiler/peephole_optimizations/one_sub_bool.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/remove_cascading_conversions.py +23 -3
- angr/analyses/decompiler/peephole_optimizations/remove_empty_if_body.py +2 -1
- angr/analyses/decompiler/peephole_optimizations/remove_noop_conversions.py +4 -0
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_bitmasks.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_conversions.py +4 -6
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_ite_branch.py +14 -13
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_ite_comparisons.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_nots.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_reinterprets.py +3 -2
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_shifts.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_shifts_around_comparators.py +20 -16
- angr/analyses/decompiler/peephole_optimizations/rewrite_bit_extractions.py +3 -3
- angr/analyses/decompiler/peephole_optimizations/rewrite_mips_gp_loads.py +4 -2
- angr/analyses/decompiler/peephole_optimizations/rol_ror.py +66 -40
- angr/analyses/decompiler/peephole_optimizations/sar_to_signed_div.py +64 -57
- angr/analyses/decompiler/peephole_optimizations/simplify_pc_relative_loads.py +14 -14
- angr/analyses/decompiler/peephole_optimizations/single_bit_cond_to_boolexpr.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/single_bit_xor.py +8 -5
- angr/analyses/decompiler/peephole_optimizations/tidy_stack_addr.py +4 -6
- angr/analyses/decompiler/redundant_label_remover.py +20 -19
- angr/analyses/decompiler/region_identifier.py +64 -77
- angr/analyses/decompiler/region_simplifiers/__init__.py +1 -0
- angr/analyses/decompiler/region_simplifiers/cascading_cond_transformer.py +2 -1
- angr/analyses/decompiler/region_simplifiers/cascading_ifs.py +1 -0
- angr/analyses/decompiler/region_simplifiers/expr_folding.py +43 -29
- angr/analyses/decompiler/region_simplifiers/goto.py +1 -0
- angr/analyses/decompiler/region_simplifiers/if_.py +29 -36
- angr/analyses/decompiler/region_simplifiers/ifelse.py +1 -0
- angr/analyses/decompiler/region_simplifiers/loop.py +27 -13
- angr/analyses/decompiler/region_simplifiers/node_address_finder.py +1 -0
- angr/analyses/decompiler/region_simplifiers/region_simplifier.py +1 -0
- angr/analyses/decompiler/region_simplifiers/switch_cluster_simplifier.py +12 -16
- angr/analyses/decompiler/region_simplifiers/switch_expr_simplifier.py +36 -32
- angr/analyses/decompiler/region_walker.py +1 -0
- angr/analyses/decompiler/return_maker.py +1 -0
- angr/analyses/decompiler/seq_to_blocks.py +1 -0
- angr/analyses/decompiler/sequence_walker.py +5 -10
- angr/analyses/decompiler/ssailification/__init__.py +4 -0
- angr/analyses/decompiler/ssailification/rewriting.py +325 -0
- angr/analyses/decompiler/ssailification/rewriting_engine.py +601 -0
- angr/analyses/decompiler/ssailification/rewriting_state.py +60 -0
- angr/analyses/decompiler/ssailification/ssailification.py +213 -0
- angr/analyses/decompiler/ssailification/traversal.py +97 -0
- angr/analyses/decompiler/ssailification/traversal_engine.py +131 -0
- angr/analyses/decompiler/ssailification/traversal_state.py +42 -0
- angr/analyses/decompiler/structured_codegen/__init__.py +1 -0
- angr/analyses/decompiler/structured_codegen/base.py +2 -2
- angr/analyses/decompiler/structured_codegen/c.py +172 -160
- angr/analyses/decompiler/structured_codegen/dummy.py +1 -0
- angr/analyses/decompiler/structured_codegen/dwarf_import.py +1 -0
- angr/analyses/decompiler/structuring/__init__.py +1 -0
- angr/analyses/decompiler/structuring/dream.py +27 -43
- angr/analyses/decompiler/structuring/phoenix.py +201 -201
- angr/analyses/decompiler/structuring/recursive_structurer.py +4 -3
- angr/analyses/decompiler/structuring/sailr.py +5 -4
- angr/analyses/decompiler/structuring/structurer_base.py +26 -23
- angr/analyses/decompiler/structuring/structurer_nodes.py +14 -24
- angr/analyses/decompiler/utils.py +112 -52
- angr/analyses/disassembly.py +75 -77
- angr/analyses/disassembly_utils.py +10 -13
- angr/analyses/dominance_frontier.py +25 -7
- angr/analyses/find_objects_static.py +3 -2
- angr/analyses/flirt.py +7 -10
- angr/analyses/forward_analysis/__init__.py +1 -0
- angr/analyses/forward_analysis/forward_analysis.py +9 -6
- angr/analyses/forward_analysis/job_info.py +3 -3
- angr/analyses/forward_analysis/visitors/__init__.py +1 -0
- angr/analyses/forward_analysis/visitors/call_graph.py +1 -0
- angr/analyses/forward_analysis/visitors/function_graph.py +3 -2
- angr/analyses/forward_analysis/visitors/graph.py +9 -9
- angr/analyses/forward_analysis/visitors/loop.py +1 -0
- angr/analyses/forward_analysis/visitors/single_node_graph.py +2 -2
- angr/analyses/identifier/__init__.py +1 -0
- angr/analyses/identifier/custom_callable.py +2 -2
- angr/analyses/identifier/errors.py +1 -0
- angr/analyses/identifier/func.py +6 -3
- angr/analyses/identifier/functions/__init__.py +2 -1
- angr/analyses/identifier/functions/atoi.py +2 -4
- angr/analyses/identifier/functions/based_atoi.py +3 -6
- angr/analyses/identifier/functions/fdprintf.py +1 -0
- angr/analyses/identifier/functions/free.py +3 -5
- angr/analyses/identifier/functions/int2str.py +11 -26
- angr/analyses/identifier/functions/malloc.py +4 -6
- angr/analyses/identifier/functions/memcmp.py +2 -4
- angr/analyses/identifier/functions/memcpy.py +2 -2
- angr/analyses/identifier/functions/memset.py +2 -2
- angr/analyses/identifier/functions/printf.py +1 -0
- angr/analyses/identifier/functions/recv_until.py +3 -6
- angr/analyses/identifier/functions/skip_calloc.py +2 -1
- angr/analyses/identifier/functions/skip_realloc.py +4 -6
- angr/analyses/identifier/functions/skip_recv_n.py +4 -6
- angr/analyses/identifier/functions/snprintf.py +2 -4
- angr/analyses/identifier/functions/sprintf.py +1 -0
- angr/analyses/identifier/functions/strcasecmp.py +1 -0
- angr/analyses/identifier/functions/strcmp.py +2 -1
- angr/analyses/identifier/functions/strcpy.py +2 -2
- angr/analyses/identifier/functions/strlen.py +1 -0
- angr/analyses/identifier/functions/strncmp.py +2 -1
- angr/analyses/identifier/functions/strncpy.py +2 -2
- angr/analyses/identifier/functions/strtol.py +2 -4
- angr/analyses/identifier/identify.py +35 -54
- angr/analyses/identifier/runner.py +6 -5
- angr/analyses/init_finder.py +17 -17
- angr/analyses/loop_analysis.py +10 -14
- angr/analyses/loopfinder.py +9 -13
- angr/analyses/propagator/__init__.py +1 -0
- angr/analyses/propagator/engine_ail.py +161 -166
- angr/analyses/propagator/engine_base.py +3 -2
- angr/analyses/propagator/engine_vex.py +47 -48
- angr/analyses/propagator/outdated_definition_walker.py +18 -23
- angr/analyses/propagator/propagator.py +8 -12
- angr/analyses/propagator/tmpvar_finder.py +1 -0
- angr/analyses/propagator/top_checker_mixin.py +2 -4
- angr/analyses/propagator/values.py +1 -0
- angr/analyses/propagator/vex_vars.py +3 -2
- angr/analyses/proximity_graph.py +12 -20
- angr/analyses/reaching_definitions/__init__.py +5 -4
- angr/analyses/reaching_definitions/call_trace.py +7 -6
- angr/analyses/reaching_definitions/dep_graph.py +18 -23
- angr/analyses/reaching_definitions/engine_ail.py +89 -121
- angr/analyses/reaching_definitions/engine_vex.py +20 -32
- angr/analyses/reaching_definitions/function_handler.py +38 -35
- angr/analyses/reaching_definitions/function_handler_library/__init__.py +1 -0
- angr/analyses/reaching_definitions/function_handler_library/stdio.py +4 -6
- angr/analyses/reaching_definitions/function_handler_library/stdlib.py +1 -2
- angr/analyses/reaching_definitions/function_handler_library/string.py +2 -4
- angr/analyses/reaching_definitions/function_handler_library/unistd.py +1 -0
- angr/analyses/reaching_definitions/heap_allocator.py +7 -6
- angr/analyses/reaching_definitions/rd_initializer.py +27 -25
- angr/analyses/reaching_definitions/rd_state.py +14 -16
- angr/analyses/reaching_definitions/reaching_definitions.py +27 -36
- angr/analyses/reaching_definitions/subject.py +3 -2
- angr/analyses/reassembler.py +189 -253
- angr/analyses/s_liveness/__init__.py +2 -0
- angr/analyses/s_liveness/s_liveness.py +153 -0
- angr/analyses/s_propagator/__init__.py +2 -0
- angr/analyses/s_propagator/s_propagator.py +250 -0
- angr/analyses/s_reaching_definitions/__init__.py +2 -0
- angr/analyses/s_reaching_definitions/s_rda.py +479 -0
- angr/analyses/soot_class_hierarchy.py +15 -24
- angr/analyses/stack_pointer_tracker.py +106 -98
- angr/analyses/static_hooker.py +3 -2
- angr/analyses/typehoon/__init__.py +1 -0
- angr/analyses/typehoon/dfa.py +5 -5
- angr/analyses/typehoon/lifter.py +5 -4
- angr/analyses/typehoon/simple_solver.py +80 -64
- angr/analyses/typehoon/translator.py +26 -16
- angr/analyses/typehoon/typeconsts.py +22 -12
- angr/analyses/typehoon/typehoon.py +8 -10
- angr/analyses/typehoon/typevars.py +37 -49
- angr/analyses/typehoon/variance.py +1 -0
- angr/analyses/variable_recovery/__init__.py +1 -0
- angr/analyses/variable_recovery/annotations.py +1 -0
- angr/analyses/variable_recovery/engine_ail.py +78 -32
- angr/analyses/variable_recovery/engine_base.py +233 -59
- angr/analyses/variable_recovery/engine_vex.py +17 -21
- angr/analyses/variable_recovery/irsb_scanner.py +1 -0
- angr/analyses/variable_recovery/variable_recovery.py +14 -16
- angr/analyses/variable_recovery/variable_recovery_base.py +12 -14
- angr/analyses/variable_recovery/variable_recovery_fast.py +67 -47
- angr/analyses/veritesting.py +10 -16
- angr/analyses/vfg.py +102 -148
- angr/analyses/vsa_ddg.py +3 -5
- angr/analyses/vtable.py +6 -6
- angr/analyses/xrefs.py +9 -13
- angr/angrdb/__init__.py +4 -2
- angr/angrdb/db.py +51 -53
- angr/angrdb/models.py +1 -0
- angr/angrdb/serializers/__init__.py +1 -0
- angr/angrdb/serializers/cfg_model.py +2 -2
- angr/angrdb/serializers/comments.py +1 -0
- angr/angrdb/serializers/funcs.py +4 -3
- angr/angrdb/serializers/kb.py +3 -2
- angr/angrdb/serializers/labels.py +1 -0
- angr/angrdb/serializers/structured_code.py +5 -10
- angr/angrdb/serializers/variables.py +6 -6
- angr/angrdb/serializers/xrefs.py +2 -2
- angr/annocfg.py +17 -25
- angr/blade.py +19 -23
- angr/block.py +11 -13
- angr/callable.py +4 -3
- angr/calling_conventions.py +147 -147
- angr/code_location.py +12 -13
- angr/codenode.py +2 -1
- angr/concretization_strategies/__init__.py +6 -6
- angr/concretization_strategies/any.py +5 -4
- angr/concretization_strategies/any_named.py +1 -0
- angr/concretization_strategies/controlled_data.py +1 -0
- angr/concretization_strategies/eval.py +2 -2
- angr/concretization_strategies/logging.py +1 -0
- angr/concretization_strategies/max.py +6 -6
- angr/concretization_strategies/nonzero.py +1 -0
- angr/concretization_strategies/nonzero_range.py +4 -3
- angr/concretization_strategies/norepeats.py +5 -4
- angr/concretization_strategies/norepeats_range.py +1 -0
- angr/concretization_strategies/range.py +1 -0
- angr/concretization_strategies/signed_add.py +13 -9
- angr/concretization_strategies/single.py +2 -0
- angr/concretization_strategies/solutions.py +1 -0
- angr/concretization_strategies/unlimited_range.py +1 -0
- angr/distributed/__init__.py +1 -0
- angr/distributed/server.py +2 -2
- angr/distributed/worker.py +3 -3
- angr/engines/__init__.py +1 -0
- angr/engines/concrete.py +2 -1
- angr/engines/engine.py +4 -6
- angr/engines/failure.py +2 -1
- angr/engines/hook.py +1 -0
- angr/engines/light/__init__.py +1 -0
- angr/engines/light/data.py +221 -255
- angr/engines/light/engine.py +72 -85
- angr/engines/pcode/__init__.py +1 -0
- angr/engines/pcode/behavior.py +3 -3
- angr/engines/pcode/cc.py +1 -0
- angr/engines/pcode/emulate.py +13 -16
- angr/engines/pcode/engine.py +7 -5
- angr/engines/pcode/lifter.py +62 -79
- angr/engines/procedure.py +1 -0
- angr/engines/soot/__init__.py +1 -0
- angr/engines/soot/engine.py +46 -52
- angr/engines/soot/exceptions.py +3 -0
- angr/engines/soot/expressions/__init__.py +1 -0
- angr/engines/soot/expressions/arrayref.py +1 -0
- angr/engines/soot/expressions/base.py +4 -5
- angr/engines/soot/expressions/binop.py +1 -0
- angr/engines/soot/expressions/cast.py +1 -0
- angr/engines/soot/expressions/condition.py +2 -1
- angr/engines/soot/expressions/constants.py +1 -0
- angr/engines/soot/expressions/instanceOf.py +1 -0
- angr/engines/soot/expressions/instancefieldref.py +1 -0
- angr/engines/soot/expressions/invoke.py +7 -9
- angr/engines/soot/expressions/length.py +1 -0
- angr/engines/soot/expressions/local.py +1 -0
- angr/engines/soot/expressions/new.py +1 -0
- angr/engines/soot/expressions/newArray.py +1 -0
- angr/engines/soot/expressions/newMultiArray.py +3 -3
- angr/engines/soot/expressions/paramref.py +1 -0
- angr/engines/soot/expressions/phi.py +1 -0
- angr/engines/soot/expressions/staticfieldref.py +1 -0
- angr/engines/soot/expressions/thisref.py +1 -0
- angr/engines/soot/expressions/unsupported.py +1 -0
- angr/engines/soot/field_dispatcher.py +5 -8
- angr/engines/soot/method_dispatcher.py +4 -7
- angr/engines/soot/statements/__init__.py +4 -4
- angr/engines/soot/statements/assign.py +1 -0
- angr/engines/soot/statements/base.py +6 -7
- angr/engines/soot/statements/goto.py +2 -1
- angr/engines/soot/statements/identity.py +1 -0
- angr/engines/soot/statements/if_.py +2 -1
- angr/engines/soot/statements/invoke.py +1 -0
- angr/engines/soot/statements/return_.py +1 -0
- angr/engines/soot/statements/switch.py +1 -0
- angr/engines/soot/statements/throw.py +2 -1
- angr/engines/soot/values/__init__.py +4 -2
- angr/engines/soot/values/arrayref.py +8 -10
- angr/engines/soot/values/base.py +4 -1
- angr/engines/soot/values/constants.py +1 -0
- angr/engines/soot/values/instancefieldref.py +1 -0
- angr/engines/soot/values/local.py +1 -0
- angr/engines/soot/values/paramref.py +1 -0
- angr/engines/soot/values/staticfieldref.py +1 -0
- angr/engines/soot/values/strref.py +3 -2
- angr/engines/soot/values/thisref.py +1 -0
- angr/engines/successors.py +21 -24
- angr/engines/syscall.py +9 -9
- angr/engines/unicorn.py +14 -9
- angr/engines/vex/__init__.py +1 -0
- angr/engines/vex/claripy/__init__.py +1 -0
- angr/engines/vex/claripy/ccall.py +86 -112
- angr/engines/vex/claripy/datalayer.py +12 -16
- angr/engines/vex/claripy/irop.py +85 -104
- angr/engines/vex/heavy/__init__.py +1 -0
- angr/engines/vex/heavy/actions.py +1 -0
- angr/engines/vex/heavy/concretizers.py +8 -9
- angr/engines/vex/heavy/dirty.py +6 -5
- angr/engines/vex/heavy/heavy.py +15 -14
- angr/engines/vex/heavy/inspect.py +1 -0
- angr/engines/vex/heavy/resilience.py +2 -2
- angr/engines/vex/heavy/super_fastpath.py +2 -2
- angr/engines/vex/lifter.py +28 -35
- angr/engines/vex/light/__init__.py +1 -0
- angr/engines/vex/light/light.py +2 -4
- angr/engines/vex/light/resilience.py +1 -0
- angr/engines/vex/light/slicing.py +1 -0
- angr/errors.py +6 -1
- angr/exploration_techniques/__init__.py +3 -2
- angr/exploration_techniques/bucketizer.py +2 -3
- angr/exploration_techniques/common.py +3 -3
- angr/exploration_techniques/dfs.py +1 -0
- angr/exploration_techniques/director.py +17 -19
- angr/exploration_techniques/driller_core.py +3 -7
- angr/exploration_techniques/explorer.py +7 -3
- angr/exploration_techniques/lengthlimiter.py +1 -0
- angr/exploration_techniques/local_loop_seer.py +2 -2
- angr/exploration_techniques/loop_seer.py +11 -14
- angr/exploration_techniques/manual_mergepoint.py +3 -2
- angr/exploration_techniques/memory_watcher.py +1 -0
- angr/exploration_techniques/oppologist.py +4 -4
- angr/exploration_techniques/slicecutor.py +1 -0
- angr/exploration_techniques/spiller.py +8 -8
- angr/exploration_techniques/spiller_db.py +1 -0
- angr/exploration_techniques/stochastic.py +3 -4
- angr/exploration_techniques/stub_stasher.py +1 -0
- angr/exploration_techniques/suggestions.py +5 -4
- angr/exploration_techniques/symbion.py +1 -0
- angr/exploration_techniques/tech_builder.py +1 -0
- angr/exploration_techniques/threading.py +1 -0
- angr/exploration_techniques/timeout.py +1 -0
- angr/exploration_techniques/tracer.py +34 -39
- angr/exploration_techniques/unique.py +1 -0
- angr/exploration_techniques/veritesting.py +1 -0
- angr/factory.py +9 -9
- angr/flirt/__init__.py +1 -0
- angr/flirt/build_sig.py +8 -12
- angr/keyed_region.py +10 -17
- angr/knowledge_base/__init__.py +1 -0
- angr/knowledge_base/knowledge_base.py +17 -17
- angr/knowledge_plugins/__init__.py +1 -0
- angr/knowledge_plugins/callsite_prototypes.py +1 -0
- angr/knowledge_plugins/cfg/__init__.py +2 -0
- angr/knowledge_plugins/cfg/cfg_manager.py +2 -1
- angr/knowledge_plugins/cfg/cfg_model.py +27 -43
- angr/knowledge_plugins/cfg/cfg_node.py +8 -19
- angr/knowledge_plugins/cfg/indirect_jump.py +3 -5
- angr/knowledge_plugins/cfg/memory_data.py +4 -3
- angr/knowledge_plugins/comments.py +1 -0
- angr/knowledge_plugins/custom_strings.py +1 -0
- angr/knowledge_plugins/data.py +1 -0
- angr/knowledge_plugins/debug_variables.py +18 -23
- angr/knowledge_plugins/functions/__init__.py +1 -0
- angr/knowledge_plugins/functions/function.py +49 -53
- angr/knowledge_plugins/functions/function_manager.py +14 -14
- angr/knowledge_plugins/functions/function_parser.py +38 -42
- angr/knowledge_plugins/functions/soot_function.py +5 -6
- angr/knowledge_plugins/indirect_jumps.py +1 -0
- angr/knowledge_plugins/key_definitions/__init__.py +1 -0
- angr/knowledge_plugins/key_definitions/atoms.py +65 -17
- angr/knowledge_plugins/key_definitions/constants.py +6 -0
- angr/knowledge_plugins/key_definitions/definition.py +22 -25
- angr/knowledge_plugins/key_definitions/environment.py +18 -14
- angr/knowledge_plugins/key_definitions/heap_address.py +4 -3
- angr/knowledge_plugins/key_definitions/key_definition_manager.py +5 -4
- angr/knowledge_plugins/key_definitions/live_definitions.py +36 -45
- angr/knowledge_plugins/key_definitions/liveness.py +18 -23
- angr/knowledge_plugins/key_definitions/rd_model.py +29 -34
- angr/knowledge_plugins/key_definitions/tag.py +7 -6
- angr/knowledge_plugins/key_definitions/undefined.py +3 -0
- angr/knowledge_plugins/key_definitions/unknown_size.py +3 -0
- angr/knowledge_plugins/key_definitions/uses.py +21 -23
- angr/knowledge_plugins/labels.py +3 -2
- angr/knowledge_plugins/patches.py +2 -1
- angr/knowledge_plugins/plugin.py +2 -1
- angr/knowledge_plugins/propagations/__init__.py +1 -0
- angr/knowledge_plugins/propagations/prop_value.py +25 -27
- angr/knowledge_plugins/propagations/propagation_manager.py +2 -2
- angr/knowledge_plugins/propagations/propagation_model.py +5 -4
- angr/knowledge_plugins/propagations/states.py +71 -81
- angr/knowledge_plugins/structured_code/__init__.py +1 -0
- angr/knowledge_plugins/structured_code/manager.py +5 -4
- angr/knowledge_plugins/sync/__init__.py +1 -0
- angr/knowledge_plugins/sync/sync_controller.py +10 -15
- angr/knowledge_plugins/types.py +1 -0
- angr/knowledge_plugins/variables/__init__.py +1 -0
- angr/knowledge_plugins/variables/variable_access.py +9 -10
- angr/knowledge_plugins/variables/variable_manager.py +84 -55
- angr/knowledge_plugins/xrefs/__init__.py +1 -0
- angr/knowledge_plugins/xrefs/xref.py +7 -11
- angr/knowledge_plugins/xrefs/xref_manager.py +1 -0
- angr/knowledge_plugins/xrefs/xref_types.py +3 -0
- angr/misc/__init__.py +1 -0
- angr/misc/ansi.py +1 -0
- angr/misc/autoimport.py +3 -2
- angr/misc/bug_report.py +6 -5
- angr/misc/hookset.py +3 -2
- angr/misc/loggers.py +2 -2
- angr/misc/picklable_lock.py +1 -0
- angr/misc/plugins.py +11 -13
- angr/misc/range.py +3 -0
- angr/misc/telemetry.py +54 -0
- angr/misc/testing.py +2 -1
- angr/misc/ux.py +5 -5
- angr/misc/weakpatch.py +1 -0
- angr/procedures/__init__.py +1 -0
- angr/procedures/cgc/_terminate.py +1 -0
- angr/procedures/cgc/allocate.py +1 -0
- angr/procedures/cgc/deallocate.py +1 -0
- angr/procedures/cgc/fdwait.py +1 -0
- angr/procedures/cgc/random.py +1 -0
- angr/procedures/cgc/receive.py +26 -26
- angr/procedures/cgc/transmit.py +1 -0
- angr/procedures/definitions/__init__.py +9 -10
- angr/procedures/definitions/cgc.py +1 -0
- angr/procedures/definitions/glibc.py +1 -0
- angr/procedures/definitions/gnulib.py +1 -0
- angr/procedures/definitions/libstdcpp.py +1 -0
- angr/procedures/definitions/linux_kernel.py +1 -0
- angr/procedures/definitions/linux_loader.py +1 -0
- angr/procedures/definitions/msvcr.py +1 -0
- angr/procedures/definitions/parse_syscalls_from_local_system.py +2 -1
- angr/procedures/definitions/parse_win32json.py +27 -30
- angr/procedures/definitions/types_win32.py +1 -0
- angr/procedures/definitions/wdk_api-ms-win-dx-d3dkmt-l1-1-4.py +1 -0
- angr/procedures/definitions/wdk_api-ms-win-dx-d3dkmt-l1-1-6.py +1 -0
- angr/procedures/definitions/wdk_clfs.py +1 -0
- angr/procedures/definitions/wdk_fltmgr.py +1 -0
- angr/procedures/definitions/wdk_fwpkclnt.py +1 -0
- angr/procedures/definitions/wdk_fwpuclnt.py +1 -0
- angr/procedures/definitions/wdk_gdi32.py +1 -0
- angr/procedures/definitions/wdk_hal.py +1 -0
- angr/procedures/definitions/wdk_ksecdd.py +1 -0
- angr/procedures/definitions/wdk_ndis.py +1 -0
- angr/procedures/definitions/wdk_ntoskrnl.py +1 -0
- angr/procedures/definitions/wdk_offreg.py +1 -0
- angr/procedures/definitions/wdk_pshed.py +1 -0
- angr/procedures/definitions/wdk_secur32.py +1 -0
- angr/procedures/definitions/wdk_vhfum.py +1 -0
- angr/procedures/definitions/win32_aclui.py +1 -0
- angr/procedures/definitions/win32_activeds.py +1 -0
- angr/procedures/definitions/win32_advapi32.py +1 -0
- angr/procedures/definitions/win32_advpack.py +1 -0
- angr/procedures/definitions/win32_amsi.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-appmodel-runtime-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-appmodel-runtime-l1-1-3.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-appmodel-runtime-l1-1-6.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-apiquery-l2-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-backgroundtask-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-comm-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-comm-l1-1-2.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-enclave-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-errorhandling-l1-1-3.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-featurestaging-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-featurestaging-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-file-fromapp-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-handle-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-ioring-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-marshal-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-memory-l1-1-3.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-memory-l1-1-4.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-memory-l1-1-5.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-memory-l1-1-6.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-memory-l1-1-7.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-memory-l1-1-8.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-path-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-psm-appnotify-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-psm-appnotify-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-realtime-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-realtime-l1-1-2.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-slapi-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-state-helpers-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-synch-l1-2-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-sysinfo-l1-2-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-sysinfo-l1-2-3.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-sysinfo-l1-2-4.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-sysinfo-l1-2-6.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-util-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-error-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-error-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-registration-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-robuffer-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-roparameterizediid-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-string-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-string-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-wow64-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-devices-query-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-devices-query-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-dx-d3dkmt-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-deviceinformation-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-expandedresources-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-tcui-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-tcui-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-tcui-l1-1-2.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-tcui-l1-1-3.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-tcui-l1-1-4.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-mm-misc-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-net-isolation-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-security-base-l1-2-2.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-security-isolatedcontainer-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-security-isolatedcontainer-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-service-core-l1-1-3.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-service-core-l1-1-4.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-service-core-l1-1-5.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-shcore-scaling-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-shcore-scaling-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-shcore-scaling-l1-1-2.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-shcore-stream-winrt-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-wsl-api-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_apphelp.py +1 -0
- angr/procedures/definitions/win32_authz.py +1 -0
- angr/procedures/definitions/win32_avicap32.py +1 -0
- angr/procedures/definitions/win32_avifil32.py +1 -0
- angr/procedures/definitions/win32_avrt.py +1 -0
- angr/procedures/definitions/win32_bcp47mrm.py +1 -0
- angr/procedures/definitions/win32_bcrypt.py +1 -0
- angr/procedures/definitions/win32_bcryptprimitives.py +1 -0
- angr/procedures/definitions/win32_bluetoothapis.py +1 -0
- angr/procedures/definitions/win32_bthprops.py +1 -0
- angr/procedures/definitions/win32_bthprops_cpl.py +1 -0
- angr/procedures/definitions/win32_cabinet.py +1 -0
- angr/procedures/definitions/win32_certadm.py +1 -0
- angr/procedures/definitions/win32_certpoleng.py +1 -0
- angr/procedures/definitions/win32_cfgmgr32.py +1 -0
- angr/procedures/definitions/win32_chakra.py +1 -0
- angr/procedures/definitions/win32_cldapi.py +1 -0
- angr/procedures/definitions/win32_clfsw32.py +1 -0
- angr/procedures/definitions/win32_clusapi.py +1 -0
- angr/procedures/definitions/win32_comctl32.py +1 -0
- angr/procedures/definitions/win32_comdlg32.py +1 -0
- angr/procedures/definitions/win32_compstui.py +1 -0
- angr/procedures/definitions/win32_computecore.py +1 -0
- angr/procedures/definitions/win32_computenetwork.py +1 -0
- angr/procedures/definitions/win32_computestorage.py +1 -0
- angr/procedures/definitions/win32_comsvcs.py +1 -0
- angr/procedures/definitions/win32_coremessaging.py +1 -0
- angr/procedures/definitions/win32_credui.py +1 -0
- angr/procedures/definitions/win32_crypt32.py +1 -0
- angr/procedures/definitions/win32_cryptnet.py +1 -0
- angr/procedures/definitions/win32_cryptui.py +1 -0
- angr/procedures/definitions/win32_cryptxml.py +1 -0
- angr/procedures/definitions/win32_cscapi.py +1 -0
- angr/procedures/definitions/win32_d2d1.py +1 -0
- angr/procedures/definitions/win32_d3d10.py +1 -0
- angr/procedures/definitions/win32_d3d10_1.py +1 -0
- angr/procedures/definitions/win32_d3d11.py +1 -0
- angr/procedures/definitions/win32_d3d12.py +1 -0
- angr/procedures/definitions/win32_d3d9.py +1 -0
- angr/procedures/definitions/win32_d3dcompiler_47.py +1 -0
- angr/procedures/definitions/win32_d3dcsx.py +1 -0
- angr/procedures/definitions/win32_davclnt.py +1 -0
- angr/procedures/definitions/win32_dbgeng.py +1 -0
- angr/procedures/definitions/win32_dbghelp.py +1 -0
- angr/procedures/definitions/win32_dbgmodel.py +1 -0
- angr/procedures/definitions/win32_dciman32.py +1 -0
- angr/procedures/definitions/win32_dcomp.py +1 -0
- angr/procedures/definitions/win32_ddraw.py +1 -0
- angr/procedures/definitions/win32_deviceaccess.py +1 -0
- angr/procedures/definitions/win32_dflayout.py +1 -0
- angr/procedures/definitions/win32_dhcpcsvc.py +1 -0
- angr/procedures/definitions/win32_dhcpcsvc6.py +1 -0
- angr/procedures/definitions/win32_dhcpsapi.py +1 -0
- angr/procedures/definitions/win32_diagnosticdataquery.py +1 -0
- angr/procedures/definitions/win32_dinput8.py +1 -0
- angr/procedures/definitions/win32_directml.py +1 -0
- angr/procedures/definitions/win32_dmprocessxmlfiltered.py +1 -0
- angr/procedures/definitions/win32_dnsapi.py +1 -0
- angr/procedures/definitions/win32_drt.py +1 -0
- angr/procedures/definitions/win32_drtprov.py +1 -0
- angr/procedures/definitions/win32_drttransport.py +1 -0
- angr/procedures/definitions/win32_dsound.py +1 -0
- angr/procedures/definitions/win32_dsparse.py +1 -0
- angr/procedures/definitions/win32_dsprop.py +1 -0
- angr/procedures/definitions/win32_dssec.py +1 -0
- angr/procedures/definitions/win32_dsuiext.py +1 -0
- angr/procedures/definitions/win32_dwmapi.py +1 -0
- angr/procedures/definitions/win32_dwrite.py +1 -0
- angr/procedures/definitions/win32_dxcompiler.py +1 -0
- angr/procedures/definitions/win32_dxcore.py +1 -0
- angr/procedures/definitions/win32_dxgi.py +1 -0
- angr/procedures/definitions/win32_dxva2.py +1 -0
- angr/procedures/definitions/win32_eappcfg.py +1 -0
- angr/procedures/definitions/win32_eappprxy.py +1 -0
- angr/procedures/definitions/win32_efswrt.py +1 -0
- angr/procedures/definitions/win32_elscore.py +1 -0
- angr/procedures/definitions/win32_esent.py +1 -0
- angr/procedures/definitions/win32_evr.py +1 -0
- angr/procedures/definitions/win32_faultrep.py +1 -0
- angr/procedures/definitions/win32_fhsvcctl.py +1 -0
- angr/procedures/definitions/win32_firewallapi.py +1 -0
- angr/procedures/definitions/win32_fltlib.py +1 -0
- angr/procedures/definitions/win32_fontsub.py +1 -0
- angr/procedures/definitions/win32_forceinline.py +1 -0
- angr/procedures/definitions/win32_fwpuclnt.py +1 -0
- angr/procedures/definitions/win32_fxsutility.py +1 -0
- angr/procedures/definitions/win32_gdi32.py +1 -0
- angr/procedures/definitions/win32_gdiplus.py +1 -0
- angr/procedures/definitions/win32_glu32.py +1 -0
- angr/procedures/definitions/win32_gpedit.py +1 -0
- angr/procedures/definitions/win32_hhctrl_ocx.py +1 -0
- angr/procedures/definitions/win32_hid.py +1 -0
- angr/procedures/definitions/win32_hlink.py +1 -0
- angr/procedures/definitions/win32_hrtfapo.py +1 -0
- angr/procedures/definitions/win32_httpapi.py +1 -0
- angr/procedures/definitions/win32_icm32.py +1 -0
- angr/procedures/definitions/win32_icmui.py +1 -0
- angr/procedures/definitions/win32_icu.py +1 -0
- angr/procedures/definitions/win32_ieframe.py +1 -0
- angr/procedures/definitions/win32_imagehlp.py +1 -0
- angr/procedures/definitions/win32_imgutil.py +1 -0
- angr/procedures/definitions/win32_imm32.py +1 -0
- angr/procedures/definitions/win32_infocardapi.py +1 -0
- angr/procedures/definitions/win32_inkobjcore.py +1 -0
- angr/procedures/definitions/win32_iphlpapi.py +1 -0
- angr/procedures/definitions/win32_iscsidsc.py +1 -0
- angr/procedures/definitions/win32_isolatedwindowsenvironmentutils.py +1 -0
- angr/procedures/definitions/win32_kernel32.py +1 -0
- angr/procedures/definitions/win32_kernelbase.py +1 -0
- angr/procedures/definitions/win32_keycredmgr.py +1 -0
- angr/procedures/definitions/win32_ksproxy_ax.py +1 -0
- angr/procedures/definitions/win32_ksuser.py +1 -0
- angr/procedures/definitions/win32_ktmw32.py +1 -0
- angr/procedures/definitions/win32_licenseprotection.py +1 -0
- angr/procedures/definitions/win32_loadperf.py +1 -0
- angr/procedures/definitions/win32_magnification.py +1 -0
- angr/procedures/definitions/win32_mapi32.py +1 -0
- angr/procedures/definitions/win32_mdmlocalmanagement.py +1 -0
- angr/procedures/definitions/win32_mdmregistration.py +1 -0
- angr/procedures/definitions/win32_mf.py +1 -0
- angr/procedures/definitions/win32_mfcore.py +1 -0
- angr/procedures/definitions/win32_mfplat.py +1 -0
- angr/procedures/definitions/win32_mfplay.py +1 -0
- angr/procedures/definitions/win32_mfreadwrite.py +1 -0
- angr/procedures/definitions/win32_mfsensorgroup.py +1 -0
- angr/procedures/definitions/win32_mfsrcsnk.py +1 -0
- angr/procedures/definitions/win32_mgmtapi.py +1 -0
- angr/procedures/definitions/win32_mi.py +1 -0
- angr/procedures/definitions/win32_mmdevapi.py +1 -0
- angr/procedures/definitions/win32_mpr.py +1 -0
- angr/procedures/definitions/win32_mprapi.py +1 -0
- angr/procedures/definitions/win32_mqrt.py +1 -0
- angr/procedures/definitions/win32_mrmsupport.py +1 -0
- angr/procedures/definitions/win32_msacm32.py +1 -0
- angr/procedures/definitions/win32_msajapi.py +1 -0
- angr/procedures/definitions/win32_mscms.py +1 -0
- angr/procedures/definitions/win32_mscoree.py +1 -0
- angr/procedures/definitions/win32_msctfmonitor.py +1 -0
- angr/procedures/definitions/win32_msdelta.py +1 -0
- angr/procedures/definitions/win32_msdmo.py +1 -0
- angr/procedures/definitions/win32_msdrm.py +1 -0
- angr/procedures/definitions/win32_msi.py +1 -0
- angr/procedures/definitions/win32_msimg32.py +1 -0
- angr/procedures/definitions/win32_mspatcha.py +1 -0
- angr/procedures/definitions/win32_mspatchc.py +1 -0
- angr/procedures/definitions/win32_msports.py +1 -0
- angr/procedures/definitions/win32_msrating.py +1 -0
- angr/procedures/definitions/win32_mssign32.py +1 -0
- angr/procedures/definitions/win32_mstask.py +1 -0
- angr/procedures/definitions/win32_msvfw32.py +1 -0
- angr/procedures/definitions/win32_mswsock.py +1 -0
- angr/procedures/definitions/win32_mtxdm.py +1 -0
- angr/procedures/definitions/win32_ncrypt.py +1 -0
- angr/procedures/definitions/win32_ndfapi.py +1 -0
- angr/procedures/definitions/win32_netapi32.py +1 -0
- angr/procedures/definitions/win32_netsh.py +1 -0
- angr/procedures/definitions/win32_netshell.py +1 -0
- angr/procedures/definitions/win32_newdev.py +1 -0
- angr/procedures/definitions/win32_ninput.py +1 -0
- angr/procedures/definitions/win32_normaliz.py +1 -0
- angr/procedures/definitions/win32_ntdll.py +1 -0
- angr/procedures/definitions/win32_ntdllk.py +1 -0
- angr/procedures/definitions/win32_ntdsapi.py +1 -0
- angr/procedures/definitions/win32_ntlanman.py +1 -0
- angr/procedures/definitions/win32_odbc32.py +1 -0
- angr/procedures/definitions/win32_odbcbcp.py +1 -0
- angr/procedures/definitions/win32_ole32.py +1 -0
- angr/procedures/definitions/win32_oleacc.py +1 -0
- angr/procedures/definitions/win32_oleaut32.py +1 -0
- angr/procedures/definitions/win32_oledlg.py +1 -0
- angr/procedures/definitions/win32_ondemandconnroutehelper.py +1 -0
- angr/procedures/definitions/win32_opengl32.py +1 -0
- angr/procedures/definitions/win32_opmxbox.py +1 -0
- angr/procedures/definitions/win32_p2p.py +1 -0
- angr/procedures/definitions/win32_p2pgraph.py +1 -0
- angr/procedures/definitions/win32_pdh.py +1 -0
- angr/procedures/definitions/win32_peerdist.py +1 -0
- angr/procedures/definitions/win32_powrprof.py +1 -0
- angr/procedures/definitions/win32_prntvpt.py +1 -0
- angr/procedures/definitions/win32_projectedfslib.py +1 -0
- angr/procedures/definitions/win32_propsys.py +1 -0
- angr/procedures/definitions/win32_psapi.py +1 -0
- angr/procedures/definitions/win32_quartz.py +1 -0
- angr/procedures/definitions/win32_query.py +1 -0
- angr/procedures/definitions/win32_qwave.py +1 -0
- angr/procedures/definitions/win32_rasapi32.py +1 -0
- angr/procedures/definitions/win32_rasdlg.py +1 -0
- angr/procedures/definitions/win32_resutils.py +1 -0
- angr/procedures/definitions/win32_rometadata.py +1 -0
- angr/procedures/definitions/win32_rpcns4.py +1 -0
- angr/procedures/definitions/win32_rpcproxy.py +1 -0
- angr/procedures/definitions/win32_rpcrt4.py +1 -0
- angr/procedures/definitions/win32_rstrtmgr.py +1 -0
- angr/procedures/definitions/win32_rtm.py +1 -0
- angr/procedures/definitions/win32_rtutils.py +1 -0
- angr/procedures/definitions/win32_rtworkq.py +1 -0
- angr/procedures/definitions/win32_sas.py +1 -0
- angr/procedures/definitions/win32_scarddlg.py +1 -0
- angr/procedures/definitions/win32_schannel.py +1 -0
- angr/procedures/definitions/win32_sechost.py +1 -0
- angr/procedures/definitions/win32_secur32.py +1 -0
- angr/procedures/definitions/win32_sensapi.py +1 -0
- angr/procedures/definitions/win32_sensorsutilsv2.py +1 -0
- angr/procedures/definitions/win32_setupapi.py +1 -0
- angr/procedures/definitions/win32_sfc.py +1 -0
- angr/procedures/definitions/win32_shdocvw.py +1 -0
- angr/procedures/definitions/win32_shell32.py +1 -0
- angr/procedures/definitions/win32_shlwapi.py +1 -0
- angr/procedures/definitions/win32_slc.py +1 -0
- angr/procedures/definitions/win32_slcext.py +1 -0
- angr/procedures/definitions/win32_slwga.py +1 -0
- angr/procedures/definitions/win32_snmpapi.py +1 -0
- angr/procedures/definitions/win32_spoolss.py +1 -0
- angr/procedures/definitions/win32_srclient.py +1 -0
- angr/procedures/definitions/win32_srpapi.py +1 -0
- angr/procedures/definitions/win32_sspicli.py +1 -0
- angr/procedures/definitions/win32_sti.py +1 -0
- angr/procedures/definitions/win32_t2embed.py +1 -0
- angr/procedures/definitions/win32_tapi32.py +1 -0
- angr/procedures/definitions/win32_tbs.py +1 -0
- angr/procedures/definitions/win32_tdh.py +1 -0
- angr/procedures/definitions/win32_tokenbinding.py +1 -0
- angr/procedures/definitions/win32_traffic.py +1 -0
- angr/procedures/definitions/win32_txfw32.py +1 -0
- angr/procedures/definitions/win32_ualapi.py +1 -0
- angr/procedures/definitions/win32_uiautomationcore.py +1 -0
- angr/procedures/definitions/win32_urlmon.py +1 -0
- angr/procedures/definitions/win32_user32.py +1 -0
- angr/procedures/definitions/win32_userenv.py +1 -0
- angr/procedures/definitions/win32_usp10.py +1 -0
- angr/procedures/definitions/win32_uxtheme.py +1 -0
- angr/procedures/definitions/win32_verifier.py +1 -0
- angr/procedures/definitions/win32_version.py +1 -0
- angr/procedures/definitions/win32_vertdll.py +1 -0
- angr/procedures/definitions/win32_virtdisk.py +1 -0
- angr/procedures/definitions/win32_vmdevicehost.py +1 -0
- angr/procedures/definitions/win32_vmsavedstatedumpprovider.py +1 -0
- angr/procedures/definitions/win32_vssapi.py +1 -0
- angr/procedures/definitions/win32_wcmapi.py +1 -0
- angr/procedures/definitions/win32_wdsbp.py +1 -0
- angr/procedures/definitions/win32_wdsclientapi.py +1 -0
- angr/procedures/definitions/win32_wdsmc.py +1 -0
- angr/procedures/definitions/win32_wdspxe.py +1 -0
- angr/procedures/definitions/win32_wdstptc.py +1 -0
- angr/procedures/definitions/win32_webauthn.py +1 -0
- angr/procedures/definitions/win32_webservices.py +1 -0
- angr/procedures/definitions/win32_websocket.py +1 -0
- angr/procedures/definitions/win32_wecapi.py +1 -0
- angr/procedures/definitions/win32_wer.py +1 -0
- angr/procedures/definitions/win32_wevtapi.py +1 -0
- angr/procedures/definitions/win32_winbio.py +1 -0
- angr/procedures/definitions/win32_windows_ai_machinelearning.py +1 -0
- angr/procedures/definitions/win32_windows_data_pdf.py +1 -0
- angr/procedures/definitions/win32_windows_media_mediacontrol.py +1 -0
- angr/procedures/definitions/win32_windows_networking.py +1 -0
- angr/procedures/definitions/win32_windows_ui_xaml.py +1 -0
- angr/procedures/definitions/win32_windowscodecs.py +1 -0
- angr/procedures/definitions/win32_winfax.py +1 -0
- angr/procedures/definitions/win32_winhttp.py +1 -0
- angr/procedures/definitions/win32_winhvemulation.py +1 -0
- angr/procedures/definitions/win32_winhvplatform.py +1 -0
- angr/procedures/definitions/win32_wininet.py +1 -0
- angr/procedures/definitions/win32_winml.py +1 -0
- angr/procedures/definitions/win32_winmm.py +1 -0
- angr/procedures/definitions/win32_winscard.py +1 -0
- angr/procedures/definitions/win32_winspool.py +1 -0
- angr/procedures/definitions/win32_winspool_drv.py +1 -0
- angr/procedures/definitions/win32_wintrust.py +1 -0
- angr/procedures/definitions/win32_winusb.py +1 -0
- angr/procedures/definitions/win32_wlanapi.py +1 -0
- angr/procedures/definitions/win32_wlanui.py +1 -0
- angr/procedures/definitions/win32_wldap32.py +1 -0
- angr/procedures/definitions/win32_wldp.py +1 -0
- angr/procedures/definitions/win32_wmvcore.py +1 -0
- angr/procedures/definitions/win32_wnvapi.py +1 -0
- angr/procedures/definitions/win32_wofutil.py +1 -0
- angr/procedures/definitions/win32_ws2_32.py +1 -0
- angr/procedures/definitions/win32_wscapi.py +1 -0
- angr/procedures/definitions/win32_wsclient.py +1 -0
- angr/procedures/definitions/win32_wsdapi.py +1 -0
- angr/procedures/definitions/win32_wsmsvc.py +1 -0
- angr/procedures/definitions/win32_wsnmp32.py +1 -0
- angr/procedures/definitions/win32_wtsapi32.py +1 -0
- angr/procedures/definitions/win32_xaudio2_8.py +1 -0
- angr/procedures/definitions/win32_xinput1_4.py +1 -0
- angr/procedures/definitions/win32_xinputuap.py +1 -0
- angr/procedures/definitions/win32_xmllite.py +1 -0
- angr/procedures/definitions/win32_xolehlp.py +1 -0
- angr/procedures/definitions/win32_xpsprint.py +1 -0
- angr/procedures/glibc/__ctype_b_loc.py +2 -3
- angr/procedures/glibc/__ctype_tolower_loc.py +2 -3
- angr/procedures/glibc/__ctype_toupper_loc.py +2 -3
- angr/procedures/glibc/__errno_location.py +1 -0
- angr/procedures/glibc/__libc_init.py +1 -0
- angr/procedures/glibc/__libc_start_main.py +2 -3
- angr/procedures/glibc/dynamic_loading.py +1 -0
- angr/procedures/glibc/scanf.py +1 -0
- angr/procedures/glibc/sscanf.py +1 -0
- angr/procedures/gnulib/xalloc_die.py +1 -0
- angr/procedures/gnulib/xstrtol_fatal.py +1 -0
- angr/procedures/java/__init__.py +1 -0
- angr/procedures/java/unconstrained.py +4 -3
- angr/procedures/java_io/read.py +1 -0
- angr/procedures/java_io/write.py +1 -0
- angr/procedures/java_jni/__init__.py +25 -18
- angr/procedures/java_jni/array_operations.py +1 -0
- angr/procedures/java_jni/class_and_interface_operations.py +3 -3
- angr/procedures/java_jni/field_access.py +3 -6
- angr/procedures/java_jni/global_and_local_refs.py +1 -0
- angr/procedures/java_jni/method_calls.py +3 -2
- angr/procedures/java_jni/not_implemented.py +2 -1
- angr/procedures/java_jni/object_operations.py +3 -4
- angr/procedures/java_jni/string_operations.py +2 -1
- angr/procedures/java_jni/version_information.py +1 -0
- angr/procedures/java_lang/character.py +2 -3
- angr/procedures/java_lang/double.py +2 -2
- angr/procedures/java_lang/exit.py +1 -0
- angr/procedures/java_lang/getsimplename.py +2 -2
- angr/procedures/java_lang/integer.py +1 -0
- angr/procedures/java_lang/load_library.py +1 -0
- angr/procedures/java_lang/math.py +1 -0
- angr/procedures/java_lang/string.py +3 -3
- angr/procedures/java_lang/stringbuilder.py +1 -0
- angr/procedures/java_lang/system.py +1 -0
- angr/procedures/java_util/collection.py +1 -0
- angr/procedures/java_util/iterator.py +1 -0
- angr/procedures/java_util/list.py +1 -0
- angr/procedures/java_util/map.py +3 -4
- angr/procedures/java_util/random.py +1 -0
- angr/procedures/java_util/scanner_nextline.py +2 -1
- angr/procedures/libc/abort.py +1 -0
- angr/procedures/libc/access.py +1 -0
- angr/procedures/libc/atoi.py +2 -2
- angr/procedures/libc/atol.py +1 -0
- angr/procedures/libc/calloc.py +1 -0
- angr/procedures/libc/closelog.py +1 -0
- angr/procedures/libc/err.py +1 -0
- angr/procedures/libc/error.py +2 -3
- angr/procedures/libc/exit.py +1 -0
- angr/procedures/libc/fclose.py +2 -3
- angr/procedures/libc/feof.py +1 -0
- angr/procedures/libc/fflush.py +1 -0
- angr/procedures/libc/fgetc.py +1 -0
- angr/procedures/libc/fgets.py +19 -19
- angr/procedures/libc/fopen.py +6 -8
- angr/procedures/libc/fprintf.py +1 -0
- angr/procedures/libc/fputc.py +1 -0
- angr/procedures/libc/fputs.py +1 -0
- angr/procedures/libc/fread.py +1 -0
- angr/procedures/libc/free.py +1 -0
- angr/procedures/libc/fscanf.py +2 -2
- angr/procedures/libc/fseek.py +3 -2
- angr/procedures/libc/ftell.py +1 -0
- angr/procedures/libc/fwrite.py +1 -0
- angr/procedures/libc/getchar.py +2 -2
- angr/procedures/libc/getdelim.py +25 -25
- angr/procedures/libc/getegid.py +1 -0
- angr/procedures/libc/geteuid.py +1 -0
- angr/procedures/libc/getgid.py +1 -0
- angr/procedures/libc/gets.py +18 -18
- angr/procedures/libc/getuid.py +1 -0
- angr/procedures/libc/malloc.py +1 -0
- angr/procedures/libc/memcmp.py +3 -6
- angr/procedures/libc/memcpy.py +1 -0
- angr/procedures/libc/memset.py +1 -0
- angr/procedures/libc/openlog.py +1 -0
- angr/procedures/libc/perror.py +1 -0
- angr/procedures/libc/printf.py +1 -0
- angr/procedures/libc/putchar.py +1 -0
- angr/procedures/libc/puts.py +1 -0
- angr/procedures/libc/rand.py +1 -0
- angr/procedures/libc/realloc.py +1 -0
- angr/procedures/libc/rewind.py +2 -1
- angr/procedures/libc/scanf.py +2 -2
- angr/procedures/libc/setbuf.py +1 -0
- angr/procedures/libc/setvbuf.py +1 -0
- angr/procedures/libc/snprintf.py +1 -0
- angr/procedures/libc/sprintf.py +1 -0
- angr/procedures/libc/srand.py +1 -0
- angr/procedures/libc/sscanf.py +2 -2
- angr/procedures/libc/stpcpy.py +2 -2
- angr/procedures/libc/strcat.py +1 -0
- angr/procedures/libc/strchr.py +1 -0
- angr/procedures/libc/strcmp.py +1 -0
- angr/procedures/libc/strcpy.py +2 -2
- angr/procedures/libc/strlen.py +35 -31
- angr/procedures/libc/strncat.py +1 -0
- angr/procedures/libc/strncmp.py +9 -11
- angr/procedures/libc/strncpy.py +1 -0
- angr/procedures/libc/strnlen.py +2 -2
- angr/procedures/libc/strstr.py +8 -4
- angr/procedures/libc/strtol.py +9 -9
- angr/procedures/libc/strtoul.py +2 -2
- angr/procedures/libc/system.py +1 -0
- angr/procedures/libc/time.py +2 -2
- angr/procedures/libc/tmpnam.py +1 -0
- angr/procedures/libc/tolower.py +1 -0
- angr/procedures/libc/toupper.py +1 -0
- angr/procedures/libc/ungetc.py +1 -0
- angr/procedures/libc/vsnprintf.py +1 -0
- angr/procedures/libc/wchar.py +1 -0
- angr/procedures/libstdcpp/_unwind_resume.py +1 -0
- angr/procedures/libstdcpp/std____throw_bad_alloc.py +1 -0
- angr/procedures/libstdcpp/std____throw_bad_cast.py +1 -0
- angr/procedures/libstdcpp/std____throw_length_error.py +1 -0
- angr/procedures/libstdcpp/std____throw_logic_error.py +1 -0
- angr/procedures/libstdcpp/std__terminate.py +1 -0
- angr/procedures/linux_kernel/access.py +1 -0
- angr/procedures/linux_kernel/arch_prctl.py +1 -0
- angr/procedures/linux_kernel/arm_user_helpers.py +1 -0
- angr/procedures/linux_kernel/brk.py +1 -0
- angr/procedures/linux_kernel/cwd.py +1 -0
- angr/procedures/linux_kernel/fstat.py +2 -1
- angr/procedures/linux_kernel/fstat64.py +2 -1
- angr/procedures/linux_kernel/futex.py +3 -3
- angr/procedures/linux_kernel/getegid.py +1 -0
- angr/procedures/linux_kernel/geteuid.py +1 -0
- angr/procedures/linux_kernel/getgid.py +1 -0
- angr/procedures/linux_kernel/getpid.py +1 -0
- angr/procedures/linux_kernel/getrlimit.py +3 -3
- angr/procedures/linux_kernel/gettid.py +1 -0
- angr/procedures/linux_kernel/getuid.py +1 -0
- angr/procedures/linux_kernel/iovec.py +1 -0
- angr/procedures/linux_kernel/lseek.py +1 -0
- angr/procedures/linux_kernel/mmap.py +1 -0
- angr/procedures/linux_kernel/mprotect.py +7 -6
- angr/procedures/linux_kernel/munmap.py +1 -0
- angr/procedures/linux_kernel/openat.py +3 -5
- angr/procedures/linux_kernel/set_tid_address.py +1 -0
- angr/procedures/linux_kernel/sigaction.py +1 -0
- angr/procedures/linux_kernel/sigprocmask.py +1 -0
- angr/procedures/linux_kernel/stat.py +3 -2
- angr/procedures/linux_kernel/sysinfo.py +1 -0
- angr/procedures/linux_kernel/tgkill.py +1 -0
- angr/procedures/linux_kernel/time.py +2 -1
- angr/procedures/linux_kernel/uid.py +1 -0
- angr/procedures/linux_kernel/uname.py +1 -0
- angr/procedures/linux_kernel/unlink.py +2 -2
- angr/procedures/linux_kernel/vsyscall.py +2 -1
- angr/procedures/linux_loader/_dl_initial_error_catch_tsd.py +1 -0
- angr/procedures/linux_loader/_dl_rtld_lock.py +1 -0
- angr/procedures/linux_loader/sim_loader.py +1 -0
- angr/procedures/linux_loader/tls.py +2 -2
- angr/procedures/msvcr/__getmainargs.py +1 -0
- angr/procedures/msvcr/_initterm.py +1 -0
- angr/procedures/msvcr/fmode.py +1 -0
- angr/procedures/ntdll/exceptions.py +4 -3
- angr/procedures/posix/accept.py +2 -2
- angr/procedures/posix/bind.py +1 -0
- angr/procedures/posix/bzero.py +1 -0
- angr/procedures/posix/chroot.py +1 -0
- angr/procedures/posix/close.py +2 -2
- angr/procedures/posix/closedir.py +1 -0
- angr/procedures/posix/dup.py +4 -3
- angr/procedures/posix/fcntl.py +1 -0
- angr/procedures/posix/fdopen.py +16 -19
- angr/procedures/posix/fileno.py +1 -0
- angr/procedures/posix/fork.py +1 -0
- angr/procedures/posix/getenv.py +1 -0
- angr/procedures/posix/gethostbyname.py +1 -0
- angr/procedures/posix/getpass.py +1 -0
- angr/procedures/posix/getsockopt.py +1 -0
- angr/procedures/posix/htonl.py +2 -2
- angr/procedures/posix/htons.py +2 -2
- angr/procedures/posix/inet_ntoa.py +3 -5
- angr/procedures/posix/listen.py +1 -0
- angr/procedures/posix/mmap.py +2 -1
- angr/procedures/posix/open.py +1 -0
- angr/procedures/posix/opendir.py +1 -0
- angr/procedures/posix/poll.py +3 -3
- angr/procedures/posix/pread64.py +1 -0
- angr/procedures/posix/pthread.py +3 -3
- angr/procedures/posix/pwrite64.py +1 -0
- angr/procedures/posix/read.py +1 -0
- angr/procedures/posix/readdir.py +1 -1
- angr/procedures/posix/recv.py +1 -0
- angr/procedures/posix/recvfrom.py +1 -0
- angr/procedures/posix/select.py +7 -7
- angr/procedures/posix/send.py +2 -2
- angr/procedures/posix/setsockopt.py +1 -0
- angr/procedures/posix/sigaction.py +1 -0
- angr/procedures/posix/sim_time.py +1 -0
- angr/procedures/posix/sleep.py +1 -0
- angr/procedures/posix/socket.py +2 -2
- angr/procedures/posix/strcasecmp.py +1 -0
- angr/procedures/posix/strdup.py +1 -0
- angr/procedures/posix/strtok_r.py +32 -36
- angr/procedures/posix/syslog.py +1 -0
- angr/procedures/posix/tz.py +1 -0
- angr/procedures/posix/unlink.py +1 -0
- angr/procedures/posix/usleep.py +1 -0
- angr/procedures/posix/write.py +1 -0
- angr/procedures/procedure_dict.py +1 -0
- angr/procedures/stubs/CallReturn.py +1 -0
- angr/procedures/stubs/NoReturnUnconstrained.py +1 -0
- angr/procedures/stubs/Nop.py +1 -0
- angr/procedures/stubs/PathTerminator.py +1 -0
- angr/procedures/stubs/Redirect.py +3 -2
- angr/procedures/stubs/ReturnChar.py +1 -0
- angr/procedures/stubs/ReturnUnconstrained.py +2 -1
- angr/procedures/stubs/UnresolvableCallTarget.py +1 -0
- angr/procedures/stubs/UnresolvableJumpTarget.py +1 -0
- angr/procedures/stubs/UserHook.py +2 -1
- angr/procedures/stubs/b64_decode.py +1 -0
- angr/procedures/stubs/caller.py +1 -0
- angr/procedures/stubs/crazy_scanf.py +1 -0
- angr/procedures/stubs/format_parser.py +12 -16
- angr/procedures/stubs/syscall_stub.py +6 -7
- angr/procedures/testing/manyargs.py +1 -0
- angr/procedures/testing/retreg.py +2 -2
- angr/procedures/tracer/random.py +1 -0
- angr/procedures/tracer/receive.py +4 -4
- angr/procedures/tracer/transmit.py +4 -4
- angr/procedures/uclibc/__uClibc_main.py +1 -0
- angr/procedures/win32/EncodePointer.py +1 -0
- angr/procedures/win32/ExitProcess.py +1 -0
- angr/procedures/win32/GetCommandLine.py +1 -0
- angr/procedures/win32/GetCurrentProcessId.py +1 -0
- angr/procedures/win32/GetCurrentThreadId.py +1 -0
- angr/procedures/win32/GetLastInputInfo.py +1 -0
- angr/procedures/win32/GetModuleHandle.py +3 -4
- angr/procedures/win32/GetProcessAffinityMask.py +1 -0
- angr/procedures/win32/InterlockedExchange.py +2 -1
- angr/procedures/win32/IsProcessorFeaturePresent.py +1 -0
- angr/procedures/win32/VirtualAlloc.py +2 -1
- angr/procedures/win32/VirtualProtect.py +1 -0
- angr/procedures/win32/critical_section.py +1 -0
- angr/procedures/win32/dynamic_loading.py +2 -1
- angr/procedures/win32/file_handles.py +4 -4
- angr/procedures/win32/gethostbyname.py +2 -2
- angr/procedures/win32/heap.py +1 -0
- angr/procedures/win32/is_bad_ptr.py +1 -0
- angr/procedures/win32/local_storage.py +7 -6
- angr/procedures/win32/mutex.py +1 -0
- angr/procedures/win32/sim_time.py +7 -10
- angr/procedures/win32/system_paths.py +5 -4
- angr/procedures/win32_kernel/ExAllocatePool.py +1 -0
- angr/procedures/win32_kernel/ExFreePoolWithTag.py +1 -0
- angr/procedures/win_user32/chars.py +1 -0
- angr/procedures/win_user32/keyboard.py +1 -0
- angr/procedures/win_user32/messagebox.py +2 -4
- angr/project.py +15 -22
- angr/protos/__init__.py +1 -0
- angr/serializable.py +6 -3
- angr/sim_manager.py +18 -18
- angr/sim_options.py +5 -7
- angr/sim_procedure.py +16 -15
- angr/sim_state.py +61 -88
- angr/sim_state_options.py +9 -15
- angr/sim_type.py +135 -123
- angr/sim_variable.py +23 -38
- angr/simos/__init__.py +3 -1
- angr/simos/cgc.py +2 -1
- angr/simos/javavm.py +84 -95
- angr/simos/linux.py +54 -64
- angr/simos/simos.py +14 -23
- angr/simos/snimmuc_nxp.py +3 -6
- angr/simos/userland.py +6 -6
- angr/simos/windows.py +14 -11
- angr/slicer.py +13 -11
- angr/state_hierarchy.py +4 -4
- angr/state_plugins/__init__.py +1 -0
- angr/state_plugins/callstack.py +19 -18
- angr/state_plugins/cgc.py +5 -4
- angr/state_plugins/concrete.py +7 -8
- angr/state_plugins/debug_variables.py +15 -17
- angr/state_plugins/filesystem.py +13 -19
- angr/state_plugins/gdb.py +3 -2
- angr/state_plugins/globals.py +5 -1
- angr/state_plugins/heap/__init__.py +1 -0
- angr/state_plugins/heap/heap_base.py +1 -0
- angr/state_plugins/heap/heap_brk.py +9 -6
- angr/state_plugins/heap/heap_freelist.py +12 -9
- angr/state_plugins/heap/heap_libc.py +1 -0
- angr/state_plugins/heap/heap_ptmalloc.py +27 -36
- angr/state_plugins/heap/utils.py +1 -0
- angr/state_plugins/history.py +7 -10
- angr/state_plugins/inspect.py +1 -0
- angr/state_plugins/javavm_classloader.py +3 -2
- angr/state_plugins/jni_references.py +2 -1
- angr/state_plugins/libc.py +4 -4
- angr/state_plugins/light_registers.py +6 -8
- angr/state_plugins/log.py +1 -0
- angr/state_plugins/loop_data.py +1 -0
- angr/state_plugins/plugin.py +7 -8
- angr/state_plugins/posix.py +14 -22
- angr/state_plugins/preconstrainer.py +4 -3
- angr/state_plugins/scratch.py +6 -5
- angr/state_plugins/sim_action.py +15 -20
- angr/state_plugins/sim_action_object.py +205 -82
- angr/state_plugins/sim_event.py +1 -0
- angr/state_plugins/solver.py +65 -93
- angr/state_plugins/symbolizer.py +5 -6
- angr/state_plugins/trace_additions.py +32 -42
- angr/state_plugins/uc_manager.py +16 -9
- angr/state_plugins/unicorn_engine.py +21 -37
- angr/state_plugins/view.py +20 -19
- angr/storage/__init__.py +1 -0
- angr/storage/file.py +31 -33
- angr/storage/memory_mixins/__init__.py +12 -15
- angr/storage/memory_mixins/__init__.pyi +13 -14
- angr/storage/memory_mixins/actions_mixin.py +2 -1
- angr/storage/memory_mixins/address_concretization_mixin.py +11 -15
- angr/storage/memory_mixins/bvv_conversion_mixin.py +10 -11
- angr/storage/memory_mixins/clouseau_mixin.py +1 -0
- angr/storage/memory_mixins/conditional_store_mixin.py +1 -0
- angr/storage/memory_mixins/convenient_mappings_mixin.py +7 -8
- angr/storage/memory_mixins/default_filler_mixin.py +12 -14
- angr/storage/memory_mixins/dirty_addrs_mixin.py +1 -0
- angr/storage/memory_mixins/hex_dumper_mixin.py +6 -9
- angr/storage/memory_mixins/javavm_memory/__init__.py +1 -0
- angr/storage/memory_mixins/javavm_memory/javavm_memory_mixin.py +16 -23
- angr/storage/memory_mixins/keyvalue_memory/__init__.py +1 -0
- angr/storage/memory_mixins/keyvalue_memory/keyvalue_memory_mixin.py +2 -1
- angr/storage/memory_mixins/label_merger_mixin.py +2 -2
- angr/storage/memory_mixins/multi_value_merger_mixin.py +6 -5
- angr/storage/memory_mixins/name_resolution_mixin.py +12 -15
- angr/storage/memory_mixins/paged_memory/page_backer_mixins.py +6 -6
- angr/storage/memory_mixins/paged_memory/paged_memory_mixin.py +22 -36
- angr/storage/memory_mixins/paged_memory/paged_memory_multivalue_mixin.py +1 -0
- angr/storage/memory_mixins/paged_memory/pages/__init__.py +1 -2
- angr/storage/memory_mixins/paged_memory/pages/cooperation.py +4 -3
- angr/storage/memory_mixins/paged_memory/pages/history_tracking_mixin.py +4 -4
- angr/storage/memory_mixins/paged_memory/pages/ispo_mixin.py +1 -0
- angr/storage/memory_mixins/paged_memory/pages/list_page.py +12 -20
- angr/storage/memory_mixins/paged_memory/pages/multi_values.py +14 -19
- angr/storage/memory_mixins/paged_memory/pages/mv_list_page.py +26 -32
- angr/storage/memory_mixins/paged_memory/pages/permissions_mixin.py +1 -0
- angr/storage/memory_mixins/paged_memory/pages/refcount_mixin.py +2 -2
- angr/storage/memory_mixins/paged_memory/pages/ultra_page.py +38 -42
- angr/storage/memory_mixins/paged_memory/privileged_mixin.py +1 -0
- angr/storage/memory_mixins/paged_memory/stack_allocation_mixin.py +1 -0
- angr/storage/memory_mixins/regioned_memory/__init__.py +1 -0
- angr/storage/memory_mixins/regioned_memory/abstract_address_descriptor.py +5 -4
- angr/storage/memory_mixins/regioned_memory/abstract_merger_mixin.py +6 -21
- angr/storage/memory_mixins/regioned_memory/region_category_mixin.py +1 -0
- angr/storage/memory_mixins/regioned_memory/region_data.py +4 -5
- angr/storage/memory_mixins/regioned_memory/region_meta_mixin.py +129 -13
- angr/storage/memory_mixins/regioned_memory/regioned_address_concretization_mixin.py +2 -1
- angr/storage/memory_mixins/regioned_memory/regioned_memory_mixin.py +34 -44
- angr/storage/memory_mixins/regioned_memory/static_find_mixin.py +7 -9
- angr/storage/memory_mixins/simple_interface_mixin.py +8 -11
- angr/storage/memory_mixins/simplification_mixin.py +1 -0
- angr/storage/memory_mixins/size_resolution_mixin.py +5 -4
- angr/storage/memory_mixins/slotted_memory.py +3 -3
- angr/storage/memory_mixins/smart_find_mixin.py +3 -2
- angr/storage/memory_mixins/symbolic_merger_mixin.py +1 -0
- angr/storage/memory_mixins/top_merger_mixin.py +2 -2
- angr/storage/memory_mixins/underconstrained_mixin.py +12 -14
- angr/storage/memory_mixins/unwrapper_mixin.py +1 -0
- angr/storage/memory_object.py +35 -35
- angr/storage/pcap.py +3 -3
- angr/tablespecs.py +1 -0
- angr/utils/__init__.py +1 -0
- angr/utils/ail.py +30 -0
- angr/utils/algo.py +1 -0
- angr/utils/bits.py +12 -0
- angr/utils/constants.py +2 -0
- angr/utils/cowdict.py +3 -4
- angr/utils/dynamic_dictlist.py +4 -7
- angr/utils/endness.py +1 -0
- angr/utils/enums_conv.py +1 -0
- angr/utils/env.py +1 -0
- angr/utils/formatting.py +1 -0
- angr/utils/funcid.py +15 -14
- angr/utils/graph.py +52 -19
- angr/utils/lazy_import.py +1 -0
- angr/utils/library.py +10 -13
- angr/utils/loader.py +6 -6
- angr/utils/mp.py +4 -3
- angr/utils/orderedset.py +1 -0
- angr/utils/segment_list.py +7 -9
- angr/utils/ssa/__init__.py +198 -0
- angr/utils/ssa/tmp_uses_collector.py +23 -0
- angr/utils/ssa/vvar_uses_collector.py +37 -0
- angr/utils/timing.py +32 -20
- angr/utils/typing.py +1 -0
- angr/vaults.py +7 -8
- {angr-9.2.117.dist-info → angr-9.2.119.dist-info}/METADATA +9 -8
- angr-9.2.119.dist-info/RECORD +1345 -0
- {angr-9.2.117.dist-info → angr-9.2.119.dist-info}/WHEEL +1 -1
- angr/analyses/decompiler/optimization_passes/spilled_register_finder.py +0 -18
- angr/analyses/decompiler/seq_cf_structure_counter.py +0 -37
- angr/service.py +0 -35
- angr-9.2.117.dist-info/RECORD +0 -1310
- {angr-9.2.117.dist-info → angr-9.2.119.dist-info}/LICENSE +0 -0
- {angr-9.2.117.dist-info → angr-9.2.119.dist-info}/entry_points.txt +0 -0
- {angr-9.2.117.dist-info → angr-9.2.119.dist-info}/top_level.txt +0 -0
angr/analyses/cfg/cfg_fast.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# pylint:disable=superfluous-parens,too-many-boolean-expressions,line-too-long
|
|
2
|
+
from __future__ import annotations
|
|
2
3
|
import itertools
|
|
3
4
|
import logging
|
|
4
5
|
import math
|
|
5
6
|
import re
|
|
6
7
|
import string
|
|
7
|
-
from typing import DefaultDict
|
|
8
8
|
from collections import defaultdict, OrderedDict
|
|
9
9
|
from enum import Enum, unique
|
|
10
10
|
|
|
@@ -293,7 +293,7 @@ class FunctionEdge:
|
|
|
293
293
|
)
|
|
294
294
|
|
|
295
295
|
def apply(self, cfg):
|
|
296
|
-
raise NotImplementedError
|
|
296
|
+
raise NotImplementedError
|
|
297
297
|
|
|
298
298
|
|
|
299
299
|
class FunctionTransitionEdge(FunctionEdge):
|
|
@@ -499,10 +499,7 @@ class CFGJob:
|
|
|
499
499
|
def __repr__(self):
|
|
500
500
|
if isinstance(self.addr, SootAddressDescriptor):
|
|
501
501
|
return f"<CFGJob {self.addr}>"
|
|
502
|
-
else
|
|
503
|
-
return "<CFGJob{} {:#08x} @ func {:#08x}>".format(
|
|
504
|
-
" syscall" if self.syscall else "", self.addr, self.func_addr
|
|
505
|
-
)
|
|
502
|
+
return "<CFGJob{} {:#08x} @ func {:#08x}>".format(" syscall" if self.syscall else "", self.addr, self.func_addr)
|
|
506
503
|
|
|
507
504
|
def __eq__(self, other):
|
|
508
505
|
return (
|
|
@@ -872,10 +869,10 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
872
869
|
size = len(data)
|
|
873
870
|
|
|
874
871
|
data = bytes(pyvex.ffi.buffer(data, size))
|
|
875
|
-
for x in range(
|
|
872
|
+
for x in range(256):
|
|
876
873
|
p_x = float(data.count(x)) / size
|
|
877
874
|
if p_x > 0:
|
|
878
|
-
entropy += -p_x * math.
|
|
875
|
+
entropy += -p_x * math.log2(p_x)
|
|
879
876
|
return entropy
|
|
880
877
|
|
|
881
878
|
#
|
|
@@ -937,9 +934,8 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
937
934
|
if self._seg_list.has_blocks:
|
|
938
935
|
curr_addr = self._seg_list.next_free_pos(curr_addr)
|
|
939
936
|
|
|
940
|
-
if alignment is not None:
|
|
941
|
-
|
|
942
|
-
curr_addr = curr_addr - (curr_addr % alignment) + alignment
|
|
937
|
+
if alignment is not None and curr_addr % alignment > 0:
|
|
938
|
+
curr_addr = curr_addr - (curr_addr % alignment) + alignment
|
|
943
939
|
|
|
944
940
|
# Make sure curr_addr exists in binary
|
|
945
941
|
accepted = False
|
|
@@ -1010,15 +1006,12 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1010
1006
|
if is_arm_arch(self.project.arch):
|
|
1011
1007
|
# little endian
|
|
1012
1008
|
sz_bytes = bytes(sz)
|
|
1013
|
-
if self.project.arch.memory_endness == Endness.LE:
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
if b"\x47\x70" in sz_bytes: # bx lr
|
|
1018
|
-
return 0
|
|
1009
|
+
if self.project.arch.memory_endness == Endness.LE and b"\x70\x47" in sz_bytes: # bx lr
|
|
1010
|
+
return 0
|
|
1011
|
+
if self.project.arch.memory_endness == Endness.BE and b"\x47\x70" in sz_bytes: # bx lr
|
|
1012
|
+
return 0
|
|
1019
1013
|
l.debug("Got a string of %d chars", len(sz))
|
|
1020
|
-
|
|
1021
|
-
return string_length
|
|
1014
|
+
return len(sz) + 1
|
|
1022
1015
|
|
|
1023
1016
|
# no string is found
|
|
1024
1017
|
return 0
|
|
@@ -1051,21 +1044,19 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1051
1044
|
|
|
1052
1045
|
if sz and is_sz:
|
|
1053
1046
|
l.debug("Got a wide-string of %d wide chars", len(sz))
|
|
1054
|
-
|
|
1055
|
-
return string_length
|
|
1047
|
+
return len(sz) + 2
|
|
1056
1048
|
|
|
1057
1049
|
# no wide string is found
|
|
1058
1050
|
return 0
|
|
1059
1051
|
|
|
1060
|
-
def _scan_for_repeating_bytes(self, start_addr, repeating_byte, threshold=2):
|
|
1052
|
+
def _scan_for_repeating_bytes(self, start_addr: int, repeating_byte: int, threshold: int = 2) -> int:
|
|
1061
1053
|
"""
|
|
1062
1054
|
Scan from a given address and determine the occurrences of a given byte.
|
|
1063
1055
|
|
|
1064
|
-
:param
|
|
1065
|
-
:param
|
|
1066
|
-
:param
|
|
1067
|
-
:return:
|
|
1068
|
-
:rtype: int
|
|
1056
|
+
:param start_addr: The address in memory to start scanning.
|
|
1057
|
+
:param repeating_byte: The repeating byte to scan for.
|
|
1058
|
+
:param threshold: The minimum occurrences.
|
|
1059
|
+
:return: The occurrences of a given byte.
|
|
1069
1060
|
"""
|
|
1070
1061
|
|
|
1071
1062
|
addr = start_addr
|
|
@@ -1084,8 +1075,71 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1084
1075
|
|
|
1085
1076
|
if repeating_length >= threshold:
|
|
1086
1077
|
return repeating_length
|
|
1087
|
-
|
|
1088
|
-
|
|
1078
|
+
return 0
|
|
1079
|
+
|
|
1080
|
+
def _scan_for_consecutive_pointers(self, start_addr: int, threshold: int = 2) -> int:
|
|
1081
|
+
"""
|
|
1082
|
+
Scan from a given address and determine if there are at least `threshold` of pointers.
|
|
1083
|
+
|
|
1084
|
+
This function will yield high numbers of false positives if the mapped memory regions are too low (for example,
|
|
1085
|
+
<= 0x100000). It is recommended to set `threshold` to a higher value in such cases.
|
|
1086
|
+
|
|
1087
|
+
:param start_addr: The address to start scanning from.
|
|
1088
|
+
:param threshold: The minimum number of pointers to be found.
|
|
1089
|
+
:return: The number of pointers found.
|
|
1090
|
+
"""
|
|
1091
|
+
|
|
1092
|
+
current_object = self.project.loader.find_object_containing(start_addr)
|
|
1093
|
+
addr = start_addr
|
|
1094
|
+
pointer_count = 0
|
|
1095
|
+
pointer_size = self.project.arch.bytes
|
|
1096
|
+
|
|
1097
|
+
while self._inside_regions(addr):
|
|
1098
|
+
val = self._fast_memory_load_pointer(addr)
|
|
1099
|
+
if val is None:
|
|
1100
|
+
break
|
|
1101
|
+
obj = self.project.loader.find_object_containing(val)
|
|
1102
|
+
if obj is not None and obj is current_object:
|
|
1103
|
+
pointer_count += 1
|
|
1104
|
+
else:
|
|
1105
|
+
break
|
|
1106
|
+
addr += pointer_size
|
|
1107
|
+
|
|
1108
|
+
if pointer_count >= threshold:
|
|
1109
|
+
return pointer_count
|
|
1110
|
+
return 0
|
|
1111
|
+
|
|
1112
|
+
def _scan_for_mixed_pointers(self, start_addr: int, threshold: int = 3, window: int = 6) -> int:
|
|
1113
|
+
"""
|
|
1114
|
+
Scan from a given address and determine if there are at least `threshold` of pointers within a given window of pointers.
|
|
1115
|
+
|
|
1116
|
+
This function will yield high numbers of false positives if the mapped memory regions are too low (for example,
|
|
1117
|
+
<= 0x100000). It is recommended to set `threshold` to a higher value in such cases.
|
|
1118
|
+
|
|
1119
|
+
:param start_addr: The address to start scanning from.
|
|
1120
|
+
:param threshold: The minimum number of pointers to be found.
|
|
1121
|
+
:return: The number of pointers found.
|
|
1122
|
+
"""
|
|
1123
|
+
|
|
1124
|
+
current_object = self.project.loader.find_object_containing(start_addr)
|
|
1125
|
+
addr = start_addr
|
|
1126
|
+
ctr = 0
|
|
1127
|
+
pointer_count = 0
|
|
1128
|
+
pointer_size = self.project.arch.bytes
|
|
1129
|
+
|
|
1130
|
+
while self._inside_regions(addr) and ctr < window:
|
|
1131
|
+
ctr += 1
|
|
1132
|
+
val = self._fast_memory_load_pointer(addr)
|
|
1133
|
+
if val is None:
|
|
1134
|
+
break
|
|
1135
|
+
obj = self.project.loader.find_object_containing(val)
|
|
1136
|
+
if obj is not None and obj is current_object:
|
|
1137
|
+
pointer_count += 1
|
|
1138
|
+
addr += pointer_size
|
|
1139
|
+
|
|
1140
|
+
if pointer_count >= threshold:
|
|
1141
|
+
return ctr
|
|
1142
|
+
return 0
|
|
1089
1143
|
|
|
1090
1144
|
def _next_code_addr_core(self):
|
|
1091
1145
|
"""
|
|
@@ -1100,39 +1154,87 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1100
1154
|
start_addr = next_addr
|
|
1101
1155
|
|
|
1102
1156
|
while True:
|
|
1103
|
-
string_length =
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
start_addr
|
|
1157
|
+
pointer_length, string_length, cc_length = 0, 0, 0
|
|
1158
|
+
matched_something = False
|
|
1159
|
+
|
|
1160
|
+
if start_addr % self.project.arch.bytes == 0:
|
|
1161
|
+
# find potential pointer array
|
|
1162
|
+
threshold = 6 if start_addr <= 0x100000 else 1
|
|
1163
|
+
pointer_count = self._scan_for_consecutive_pointers(start_addr, threshold=threshold)
|
|
1164
|
+
pointer_length = pointer_count * self.project.arch.bytes
|
|
1165
|
+
|
|
1166
|
+
if pointer_length:
|
|
1167
|
+
matched_something = True
|
|
1168
|
+
self._seg_list.occupy(start_addr, pointer_length, "pointer-array")
|
|
1169
|
+
self.model.memory_data[start_addr] = MemoryData(
|
|
1170
|
+
start_addr, pointer_length, MemoryDataSort.PointerArray
|
|
1171
|
+
)
|
|
1172
|
+
start_addr += pointer_length
|
|
1173
|
+
|
|
1174
|
+
elif start_addr <= 0x100000:
|
|
1175
|
+
# for high addresses, all pointers have been found in _scan_for_consecutive_pointers() because we
|
|
1176
|
+
# set threshold there to 1
|
|
1177
|
+
threshold = 4
|
|
1178
|
+
pointer_count = self._scan_for_mixed_pointers(start_addr, threshold=threshold, window=6)
|
|
1179
|
+
pointer_length = pointer_count * self.project.arch.bytes
|
|
1180
|
+
|
|
1181
|
+
if pointer_length:
|
|
1182
|
+
matched_something = True
|
|
1183
|
+
self._seg_list.occupy(start_addr, pointer_length, "pointer-array")
|
|
1184
|
+
self.model.memory_data[start_addr] = MemoryData(
|
|
1185
|
+
start_addr, pointer_length, MemoryDataSort.PointerArray
|
|
1186
|
+
)
|
|
1187
|
+
start_addr += pointer_length
|
|
1188
|
+
|
|
1189
|
+
if not matched_something:
|
|
1190
|
+
# find strings
|
|
1191
|
+
is_widestring = False
|
|
1192
|
+
string_length = self._scan_for_printable_strings(start_addr)
|
|
1193
|
+
if string_length == 0:
|
|
1194
|
+
is_widestring = True
|
|
1195
|
+
string_length = self._scan_for_printable_widestrings(start_addr)
|
|
1196
|
+
|
|
1197
|
+
if string_length:
|
|
1198
|
+
matched_something = True
|
|
1199
|
+
self._seg_list.occupy(start_addr, string_length, "string")
|
|
1200
|
+
md = MemoryData(
|
|
1201
|
+
start_addr,
|
|
1202
|
+
string_length,
|
|
1203
|
+
MemoryDataSort.String if not is_widestring else MemoryDataSort.UnicodeString,
|
|
1204
|
+
)
|
|
1205
|
+
md.fill_content(self.project.loader)
|
|
1206
|
+
self.model.memory_data[start_addr] = md
|
|
1207
|
+
start_addr += string_length
|
|
1110
1208
|
|
|
1111
|
-
if self.project.arch.name in
|
|
1209
|
+
if not matched_something and self.project.arch.name in {"X86", "AMD64"}:
|
|
1112
1210
|
cc_length = self._scan_for_repeating_bytes(start_addr, 0xCC, threshold=1)
|
|
1113
1211
|
if cc_length:
|
|
1212
|
+
matched_something = True
|
|
1114
1213
|
self._seg_list.occupy(start_addr, cc_length, "alignment")
|
|
1214
|
+
self.model.memory_data[start_addr] = MemoryData(start_addr, cc_length, MemoryDataSort.Alignment)
|
|
1115
1215
|
start_addr += cc_length
|
|
1116
|
-
else:
|
|
1117
|
-
cc_length = 0
|
|
1118
1216
|
|
|
1119
1217
|
zeros_length = self._scan_for_repeating_bytes(start_addr, 0x00)
|
|
1120
1218
|
if zeros_length:
|
|
1219
|
+
matched_something = True
|
|
1121
1220
|
self._seg_list.occupy(start_addr, zeros_length, "alignment")
|
|
1221
|
+
self.model.memory_data[start_addr] = MemoryData(start_addr, zeros_length, MemoryDataSort.Alignment)
|
|
1122
1222
|
start_addr += zeros_length
|
|
1123
1223
|
|
|
1124
|
-
if
|
|
1224
|
+
if not matched_something:
|
|
1125
1225
|
# umm now it's probably code
|
|
1126
1226
|
break
|
|
1127
1227
|
|
|
1128
1228
|
instr_alignment = self._initial_state.arch.instruction_alignment
|
|
1129
1229
|
if start_addr % instr_alignment > 0:
|
|
1130
1230
|
# occupy those few bytes
|
|
1131
|
-
|
|
1231
|
+
size = instr_alignment - (start_addr % instr_alignment)
|
|
1232
|
+
self._seg_list.occupy(start_addr, size, "alignment")
|
|
1233
|
+
self.model.memory_data[start_addr] = MemoryData(start_addr, size, MemoryDataSort.Unknown)
|
|
1132
1234
|
start_addr = start_addr - start_addr % instr_alignment + instr_alignment
|
|
1133
1235
|
# trickiness: aligning the start_addr may create a new address that is outside any mapped region.
|
|
1134
1236
|
if not self._inside_regions(start_addr):
|
|
1135
|
-
raise ContinueScanningNotification
|
|
1237
|
+
raise ContinueScanningNotification
|
|
1136
1238
|
|
|
1137
1239
|
return start_addr
|
|
1138
1240
|
|
|
@@ -1230,7 +1332,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1230
1332
|
# should record all exits from a single function, and then add
|
|
1231
1333
|
# necessary calling edges in our call map during the post-processing
|
|
1232
1334
|
# phase.
|
|
1233
|
-
self._function_exits:
|
|
1335
|
+
self._function_exits: defaultdict[int, set[int]] = defaultdict(set)
|
|
1234
1336
|
|
|
1235
1337
|
# Create an initial state. Store it to self so we can use it globally.
|
|
1236
1338
|
self._initial_state = self.project.factory.blank_state(
|
|
@@ -1257,16 +1359,16 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1257
1359
|
starting_points |= set(self._extra_function_starts)
|
|
1258
1360
|
|
|
1259
1361
|
# Sort it
|
|
1260
|
-
sorted_starting_points: list[int] = sorted(
|
|
1362
|
+
sorted_starting_points: list[int] = sorted(starting_points, reverse=False)
|
|
1261
1363
|
|
|
1262
1364
|
if self._start_at_entry and self.project.entry is not None and self._inside_regions(self.project.entry):
|
|
1263
1365
|
if self.project.entry not in starting_points:
|
|
1264
1366
|
# make sure self.project.entry is inserted
|
|
1265
|
-
sorted_starting_points = [self.project.entry
|
|
1367
|
+
sorted_starting_points = [self.project.entry, *sorted_starting_points]
|
|
1266
1368
|
else:
|
|
1267
1369
|
# make sure project.entry is the first item
|
|
1268
1370
|
sorted_starting_points.remove(self.project.entry)
|
|
1269
|
-
sorted_starting_points = [self.project.entry
|
|
1371
|
+
sorted_starting_points = [self.project.entry, *sorted_starting_points]
|
|
1270
1372
|
|
|
1271
1373
|
# Create jobs for all starting points
|
|
1272
1374
|
for sp in sorted_starting_points:
|
|
@@ -1316,7 +1418,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1316
1418
|
if cfg_node is not None:
|
|
1317
1419
|
self._graph_add_edge(cfg_node, job.src_node, job.jumpkind, job.src_ins_addr, job.src_stmt_idx)
|
|
1318
1420
|
job.apply_function_edges(self, clear=True)
|
|
1319
|
-
raise AngrSkipJobNotice
|
|
1421
|
+
raise AngrSkipJobNotice
|
|
1320
1422
|
|
|
1321
1423
|
# Do not calculate progress if the user doesn't care about the progress at all
|
|
1322
1424
|
if self._show_progressbar or self._progress_callback:
|
|
@@ -1382,12 +1484,8 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1382
1484
|
# do nothing
|
|
1383
1485
|
filtered_successors.append(successor)
|
|
1384
1486
|
continue
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
addr_to_test = addr - 1
|
|
1388
|
-
else:
|
|
1389
|
-
# ARM mode - test if there is an existing THUMB function
|
|
1390
|
-
addr_to_test = addr + 1
|
|
1487
|
+
# THUMB mode?
|
|
1488
|
+
addr_to_test = addr - 1 if addr % 2 == 1 else addr + 1
|
|
1391
1489
|
if self.functions.contains_addr(addr_to_test):
|
|
1392
1490
|
# oops. skip it
|
|
1393
1491
|
continue
|
|
@@ -1486,10 +1584,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1486
1584
|
return
|
|
1487
1585
|
|
|
1488
1586
|
if self._force_complete_scan or self._force_smart_scan:
|
|
1489
|
-
if self._force_smart_scan
|
|
1490
|
-
addr = self._next_code_addr_smart()
|
|
1491
|
-
else:
|
|
1492
|
-
addr = self._next_code_addr()
|
|
1587
|
+
addr = self._next_code_addr_smart() if self._force_smart_scan else self._next_code_addr()
|
|
1493
1588
|
|
|
1494
1589
|
if addr is None:
|
|
1495
1590
|
l.debug("Force-scan jumping failed")
|
|
@@ -1574,24 +1669,22 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1574
1669
|
callsites_to_functions = defaultdict(list) # callsites to functions mapping
|
|
1575
1670
|
|
|
1576
1671
|
for src, dst, data in all_edges:
|
|
1577
|
-
if "type" in data:
|
|
1578
|
-
|
|
1579
|
-
callsites_to_functions[src.addr].append(dst.addr)
|
|
1672
|
+
if "type" in data and data["type"] == "call":
|
|
1673
|
+
callsites_to_functions[src.addr].append(dst.addr)
|
|
1580
1674
|
|
|
1581
1675
|
edges_to_remove = []
|
|
1582
1676
|
for src, dst, data in all_edges:
|
|
1583
|
-
if "type" in data:
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
f._confirm_fakeret(src, dst)
|
|
1677
|
+
if "type" in data and data["type"] == "fake_return" and data.get("confirmed", False) is False:
|
|
1678
|
+
# Get all possible functions being called here
|
|
1679
|
+
target_funcs = [
|
|
1680
|
+
self.functions.function(addr=func_addr) for func_addr in callsites_to_functions[src.addr]
|
|
1681
|
+
]
|
|
1682
|
+
if target_funcs and all(t is not None and t.returning is False for t in target_funcs):
|
|
1683
|
+
# Remove this edge
|
|
1684
|
+
edges_to_remove.append((src, dst))
|
|
1685
|
+
else:
|
|
1686
|
+
# Mark this edge as confirmed
|
|
1687
|
+
f._confirm_fakeret(src, dst)
|
|
1595
1688
|
|
|
1596
1689
|
for edge in edges_to_remove:
|
|
1597
1690
|
f.transition_graph.remove_edge(*edge)
|
|
@@ -1614,20 +1707,19 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1614
1707
|
# make return edges
|
|
1615
1708
|
self._make_return_edges()
|
|
1616
1709
|
|
|
1617
|
-
if self.project.arch.name != "Soot":
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
continue
|
|
1710
|
+
if self.project.arch.name != "Soot" and self.project.loader.main_object.sections:
|
|
1711
|
+
# this binary has sections
|
|
1712
|
+
# make sure we have data entries assigned at the beginning of each data section
|
|
1713
|
+
for sec in self.project.loader.main_object.sections:
|
|
1714
|
+
if sec.memsize > 0 and not sec.is_executable and sec.is_readable:
|
|
1715
|
+
for seg in self.project.loader.main_object.segments:
|
|
1716
|
+
if seg.vaddr <= sec.vaddr < seg.vaddr + seg.memsize:
|
|
1717
|
+
break
|
|
1718
|
+
else:
|
|
1719
|
+
continue
|
|
1628
1720
|
|
|
1629
|
-
|
|
1630
|
-
|
|
1721
|
+
if sec.vaddr not in self.model.memory_data:
|
|
1722
|
+
self.model.memory_data[sec.vaddr] = MemoryData(sec.vaddr, 0, MemoryDataSort.Unknown)
|
|
1631
1723
|
|
|
1632
1724
|
# If they asked for it, give it to them. All of it.
|
|
1633
1725
|
if self._cross_references:
|
|
@@ -1717,14 +1809,11 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1717
1809
|
security_check_cookie_found = True
|
|
1718
1810
|
func.is_default_name = False
|
|
1719
1811
|
func.name = "_security_check_cookie"
|
|
1720
|
-
elif
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
func.
|
|
1725
|
-
func.name = "_security_init_cookie"
|
|
1726
|
-
elif not security_init_cookie_found and is_function_security_init_cookie_win8(
|
|
1727
|
-
func, self.project, security_cookie_addr
|
|
1812
|
+
elif (
|
|
1813
|
+
not security_init_cookie_found
|
|
1814
|
+
and is_function_security_init_cookie(func, self.project, security_cookie_addr)
|
|
1815
|
+
or not security_init_cookie_found
|
|
1816
|
+
and is_function_security_init_cookie_win8(func, self.project, security_cookie_addr)
|
|
1728
1817
|
):
|
|
1729
1818
|
security_init_cookie_found = True
|
|
1730
1819
|
func.is_default_name = False
|
|
@@ -1739,12 +1828,15 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1739
1828
|
start_func = self.functions.get_by_addr(self.project.entry)
|
|
1740
1829
|
if start_func is not None:
|
|
1741
1830
|
for callee in start_func.transition_graph:
|
|
1742
|
-
if
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1831
|
+
if (
|
|
1832
|
+
isinstance(callee, Function)
|
|
1833
|
+
and not security_init_cookie_found
|
|
1834
|
+
and is_function_likely_security_init_cookie(callee)
|
|
1835
|
+
):
|
|
1836
|
+
security_init_cookie_found = True
|
|
1837
|
+
callee.is_default_name = False
|
|
1838
|
+
callee.name = "_security_init_cookie"
|
|
1839
|
+
break
|
|
1748
1840
|
|
|
1749
1841
|
def _post_process_string_references(self) -> None:
|
|
1750
1842
|
"""
|
|
@@ -1758,11 +1850,11 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1758
1850
|
MAX_STRING_SIZE = 256
|
|
1759
1851
|
UPDATE_RATIO = 0.5
|
|
1760
1852
|
|
|
1761
|
-
all_memory_data = sorted(
|
|
1853
|
+
all_memory_data = sorted(self.model.memory_data.items(), key=lambda x: x[0]) # sorted by addr
|
|
1762
1854
|
to_update: dict[int, bytes] = {}
|
|
1763
1855
|
total_string_refs: int = 0
|
|
1764
1856
|
for i, (addr, md) in enumerate(all_memory_data):
|
|
1765
|
-
if
|
|
1857
|
+
if md.sort != MemoryDataSort.String:
|
|
1766
1858
|
continue
|
|
1767
1859
|
total_string_refs += 1
|
|
1768
1860
|
if md.content is None:
|
|
@@ -1941,9 +2033,8 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1941
2033
|
# If we have traced it before, don't trace it anymore
|
|
1942
2034
|
if addr in self._traced_addresses:
|
|
1943
2035
|
return []
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
self._traced_addresses.add(addr)
|
|
2036
|
+
# Mark the address as traced
|
|
2037
|
+
self._traced_addresses.add(addr)
|
|
1947
2038
|
|
|
1948
2039
|
entries: list[CFGJob] = []
|
|
1949
2040
|
|
|
@@ -1992,20 +2083,20 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
1992
2083
|
None,
|
|
1993
2084
|
None,
|
|
1994
2085
|
)
|
|
1995
|
-
if namehint
|
|
1996
|
-
|
|
2086
|
+
if namehint and (
|
|
2087
|
+
addr_ not in self.kb.labels
|
|
2088
|
+
or self.kb.labels[addr_]
|
|
2089
|
+
in {
|
|
1997
2090
|
"_ftext",
|
|
1998
|
-
}
|
|
1999
|
-
|
|
2000
|
-
|
|
2091
|
+
}
|
|
2092
|
+
):
|
|
2093
|
+
unique_label = self.kb.labels.get_unique_label(namehint)
|
|
2094
|
+
self.kb.labels[addr_] = unique_label
|
|
2001
2095
|
|
|
2002
2096
|
# determine if this procedure returns
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
proc_returns = True
|
|
2007
|
-
else:
|
|
2008
|
-
proc_returns = not procedure.NO_RET
|
|
2097
|
+
# whether this procedure returns or not depends on the context
|
|
2098
|
+
# the procedure may return, but we will determine if we are inserting a fake_ret edge at each call site
|
|
2099
|
+
proc_returns = procedure.DYNAMIC_RET or not procedure.NO_RET
|
|
2009
2100
|
|
|
2010
2101
|
if proc_returns:
|
|
2011
2102
|
# it returns
|
|
@@ -2048,34 +2139,34 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
2048
2139
|
if self.functions.get_by_addr(function_addr).returning is not True:
|
|
2049
2140
|
self._updated_nonreturning_functions.add(function_addr)
|
|
2050
2141
|
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
)
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2142
|
+
# the function address is updated by _generate_cfgnode() because the CFG node has been assigned to a
|
|
2143
|
+
# different function (`function_addr`) before. this can happen when the beginning block of a function is
|
|
2144
|
+
# first reached through a direct jump (as the result of tail-call optimization) and then reached through a
|
|
2145
|
+
# call.
|
|
2146
|
+
# this is very likely to be fixed during the second phase of CFG traversal, so we can just let it be.
|
|
2147
|
+
# however, extra call edges pointing to the expected function address (`current_func_addr`) will lead to
|
|
2148
|
+
# the creation of an empty function in function manager, and because the function is empty, we cannot
|
|
2149
|
+
# determine if the function will return or not!
|
|
2150
|
+
# assuming tail-call optimization is what is causing this situation, and if the original function has been
|
|
2151
|
+
# determined to be returning, we update the newly created function's returning status here.
|
|
2152
|
+
# this is still a hack. the complete solution is to record this situation and account for it when CFGBase
|
|
2153
|
+
# analyzes the returning status of each function. we will cross that bridge when we encounter such cases.
|
|
2154
|
+
if (
|
|
2155
|
+
current_func_addr != function_addr
|
|
2156
|
+
and self.kb.functions[function_addr].returning is not None
|
|
2157
|
+
and self.kb.functions.contains_addr(current_func_addr)
|
|
2158
|
+
):
|
|
2159
|
+
self.kb.functions[current_func_addr].returning = self.kb.functions[function_addr].returning
|
|
2160
|
+
if self.kb.functions[current_func_addr].returning:
|
|
2161
|
+
self._pending_jobs.add_returning_function(current_func_addr)
|
|
2070
2162
|
|
|
2071
2163
|
# If we have traced it before, don't trace it anymore
|
|
2072
2164
|
real_addr = get_real_address_if_arm(self.project.arch, addr)
|
|
2073
2165
|
if real_addr in self._traced_addresses:
|
|
2074
2166
|
# the address has been traced before
|
|
2075
2167
|
return []
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
self._traced_addresses.add(real_addr)
|
|
2168
|
+
# Mark the address as traced
|
|
2169
|
+
self._traced_addresses.add(real_addr)
|
|
2079
2170
|
|
|
2080
2171
|
# irsb cannot be None here, but we add a check for resilience
|
|
2081
2172
|
if irsb is None:
|
|
@@ -2466,10 +2557,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
2466
2557
|
except AngrUnsupportedSyscallError:
|
|
2467
2558
|
target_addr = self._unresolvable_call_target_addr
|
|
2468
2559
|
|
|
2469
|
-
if isinstance(target_addr, SootAddressDescriptor)
|
|
2470
|
-
new_function_addr = target_addr.method
|
|
2471
|
-
else:
|
|
2472
|
-
new_function_addr = target_addr
|
|
2560
|
+
new_function_addr = target_addr.method if isinstance(target_addr, SootAddressDescriptor) else target_addr
|
|
2473
2561
|
|
|
2474
2562
|
if irsb is None:
|
|
2475
2563
|
return_site = None
|
|
@@ -2642,7 +2730,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
2642
2730
|
if target_func_addr is None:
|
|
2643
2731
|
target_func_addr = current_function_addr
|
|
2644
2732
|
|
|
2645
|
-
to_outside =
|
|
2733
|
+
to_outside = target_func_addr != current_function_addr
|
|
2646
2734
|
|
|
2647
2735
|
return to_outside, target_func_addr
|
|
2648
2736
|
|
|
@@ -2674,12 +2762,11 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
2674
2762
|
data_type_str = ref.data_type_str
|
|
2675
2763
|
is_store = False
|
|
2676
2764
|
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
assumption.add_data_seg(ref.data_addr, ref.data_size)
|
|
2765
|
+
# special logic: we do not call occupy for storing attempts in executable memory regions
|
|
2766
|
+
if ref.data_size and (not is_store or not self._addr_in_exec_memory_regions(ref.data_addr)):
|
|
2767
|
+
self._seg_list.occupy(ref.data_addr, ref.data_size, "unknown")
|
|
2768
|
+
if assumption is not None:
|
|
2769
|
+
assumption.add_data_seg(ref.data_addr, ref.data_size)
|
|
2683
2770
|
|
|
2684
2771
|
self._add_data_reference(
|
|
2685
2772
|
irsb_addr,
|
|
@@ -2714,17 +2801,20 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
2714
2801
|
data_type=MemoryDataSort.Unknown,
|
|
2715
2802
|
)
|
|
2716
2803
|
|
|
2717
|
-
if
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2804
|
+
if (
|
|
2805
|
+
sec_2nd.is_executable
|
|
2806
|
+
and not self._seg_list.is_occupied(v)
|
|
2807
|
+
and v % self.project.arch.instruction_alignment == 0
|
|
2808
|
+
):
|
|
2809
|
+
# create a new CFG job
|
|
2810
|
+
ce = CFGJob(
|
|
2811
|
+
v,
|
|
2812
|
+
v,
|
|
2813
|
+
"Ijk_Boring",
|
|
2814
|
+
job_type=CFGJobType.DATAREF_HINTS,
|
|
2815
|
+
)
|
|
2816
|
+
self._pending_jobs.add_job(ce)
|
|
2817
|
+
self._register_analysis_job(v, ce)
|
|
2728
2818
|
|
|
2729
2819
|
return
|
|
2730
2820
|
|
|
@@ -2945,11 +3035,10 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
2945
3035
|
)
|
|
2946
3036
|
self.kb.xrefs.add_xref(cr)
|
|
2947
3037
|
|
|
2948
|
-
if is_arm_arch(self.project.arch)
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
return
|
|
3038
|
+
if is_arm_arch(self.project.arch) and (
|
|
3039
|
+
(irsb_addr & 1) == 1 and data_addr == (insn_addr & 0xFFFF_FFFF_FFFF_FFFE) + 4 or data_addr == insn_addr + 8
|
|
3040
|
+
):
|
|
3041
|
+
return
|
|
2953
3042
|
self.insn_addr_to_memory_data[insn_addr] = self.model.memory_data[data_addr]
|
|
2954
3043
|
|
|
2955
3044
|
# Indirect jumps processing
|
|
@@ -2968,10 +3057,11 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
2968
3057
|
"""
|
|
2969
3058
|
|
|
2970
3059
|
# is the address identified by CLE as a PLT stub?
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
3060
|
+
# restrict this heuristics to ELF files only
|
|
3061
|
+
if self.project.loader.all_elf_objects and not any(
|
|
3062
|
+
addr in obj.reverse_plt for obj in self.project.loader.all_elf_objects
|
|
3063
|
+
):
|
|
3064
|
+
return False
|
|
2975
3065
|
|
|
2976
3066
|
# Make sure the IRSB has statements
|
|
2977
3067
|
if not irsb.has_statements:
|
|
@@ -2981,7 +3071,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
2981
3071
|
simsucc = self.project.factory.default_engine.process(self._initial_state, irsb, force_addr=addr)
|
|
2982
3072
|
if len(simsucc.successors) == 1:
|
|
2983
3073
|
ip = simsucc.successors[0].ip
|
|
2984
|
-
if claripy.
|
|
3074
|
+
if isinstance(ip, claripy.ast.Base):
|
|
2985
3075
|
target_addr = ip.concrete_value
|
|
2986
3076
|
obj = self.project.loader.find_object_containing(target_addr, membership_check=False)
|
|
2987
3077
|
if (obj is not None and obj is not self.project.loader.main_object) or self.project.is_hooked(
|
|
@@ -3473,7 +3563,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
3473
3563
|
self._model.add_node(new_node.addr, new_node)
|
|
3474
3564
|
|
|
3475
3565
|
# the function starting at this point is probably totally incorrect
|
|
3476
|
-
#
|
|
3566
|
+
# hopefully, a future call to `make_functions()` will correct everything
|
|
3477
3567
|
if node.addr in self.kb.functions:
|
|
3478
3568
|
del self.kb.functions[node.addr]
|
|
3479
3569
|
|
|
@@ -3481,11 +3571,14 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
3481
3571
|
# add functions back
|
|
3482
3572
|
self._function_add_node(node, node.addr)
|
|
3483
3573
|
successor_node = self.model.get_any_node(successor_node_addr)
|
|
3484
|
-
if
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3574
|
+
# if there is absolutely no predecessors to successor_node, we'd like to add it as a new function
|
|
3575
|
+
# so that it will not be left behind
|
|
3576
|
+
if (
|
|
3577
|
+
successor_node
|
|
3578
|
+
and successor_node.function_address == node.addr
|
|
3579
|
+
and not list(self.graph.predecessors(successor_node))
|
|
3580
|
+
):
|
|
3581
|
+
self._function_add_node(successor_node, successor_node_addr)
|
|
3489
3582
|
|
|
3490
3583
|
# if node.addr in self.kb.functions.callgraph:
|
|
3491
3584
|
# self.kb.functions.callgraph.remove_node(node.addr)
|
|
@@ -3946,30 +4039,29 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
3946
4039
|
tmps[stmt.tmp] = initial_sp
|
|
3947
4040
|
elif data.offset == lr_offset:
|
|
3948
4041
|
tmps[stmt.tmp] = initial_lr
|
|
3949
|
-
elif isinstance(data, pyvex.IRExpr.Binop):
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
4042
|
+
elif isinstance(data, pyvex.IRExpr.Binop) and data.op == "Iop_Sub32":
|
|
4043
|
+
arg0, arg1 = data.args
|
|
4044
|
+
if (
|
|
4045
|
+
isinstance(arg0, pyvex.IRExpr.RdTmp)
|
|
4046
|
+
and isinstance(arg1, pyvex.IRExpr.Const)
|
|
4047
|
+
and arg0.tmp in tmps
|
|
4048
|
+
):
|
|
4049
|
+
tmps[stmt.tmp] = tmps[arg0.tmp] - arg1.con.value
|
|
3955
4050
|
|
|
3956
4051
|
elif isinstance(stmt, (pyvex.IRStmt.Store, pyvex.IRStmt.StoreG)):
|
|
3957
4052
|
data = stmt.data
|
|
3958
4053
|
storing_lr = False
|
|
3959
|
-
if isinstance(data, pyvex.IRExpr.RdTmp):
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
function.info["lr_saved_on_stack"] = True
|
|
3971
|
-
function.info["lr_on_stack_offset"] = storing_addr - initial_sp
|
|
3972
|
-
break
|
|
4054
|
+
if isinstance(data, pyvex.IRExpr.RdTmp) and data.tmp in tmps:
|
|
4055
|
+
val = tmps[data.tmp]
|
|
4056
|
+
if val == initial_lr:
|
|
4057
|
+
# we are storing LR to somewhere
|
|
4058
|
+
storing_lr = True
|
|
4059
|
+
if storing_lr and isinstance(stmt.addr, pyvex.IRExpr.RdTmp) and stmt.addr.tmp in tmps:
|
|
4060
|
+
storing_addr = tmps[stmt.addr.tmp]
|
|
4061
|
+
|
|
4062
|
+
function.info["lr_saved_on_stack"] = True
|
|
4063
|
+
function.info["lr_on_stack_offset"] = storing_addr - initial_sp
|
|
4064
|
+
break
|
|
3973
4065
|
|
|
3974
4066
|
if "lr_saved_on_stack" not in function.info:
|
|
3975
4067
|
function.info["lr_saved_on_stack"] = False
|
|
@@ -4004,18 +4096,22 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
4004
4096
|
# only support Add
|
|
4005
4097
|
if data.op == "Iop_Add32":
|
|
4006
4098
|
arg0, arg1 = data.args
|
|
4007
|
-
if
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4099
|
+
if (
|
|
4100
|
+
isinstance(arg0, pyvex.IRExpr.RdTmp)
|
|
4101
|
+
and isinstance(arg1, pyvex.IRExpr.Const)
|
|
4102
|
+
and arg0.tmp in tmps
|
|
4103
|
+
):
|
|
4104
|
+
tmps[stmt.tmp] = tmps[arg0.tmp] + arg1.con.value
|
|
4105
|
+
elif (
|
|
4106
|
+
isinstance(data, pyvex.IRExpr.Load)
|
|
4107
|
+
and isinstance(data.addr, pyvex.IRExpr.RdTmp)
|
|
4108
|
+
and data.addr.tmp in tmps
|
|
4109
|
+
):
|
|
4110
|
+
tmps[stmt.tmp] = ("load", tmps[data.addr.tmp])
|
|
4014
4111
|
elif isinstance(stmt, pyvex.IRStmt.Put):
|
|
4015
|
-
if stmt.offset == sp_offset and isinstance(stmt.data, pyvex.IRExpr.RdTmp):
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
last_sp = tmps[stmt.data.tmp]
|
|
4112
|
+
if stmt.offset == sp_offset and isinstance(stmt.data, pyvex.IRExpr.RdTmp) and stmt.data.tmp in tmps:
|
|
4113
|
+
# loading things into sp
|
|
4114
|
+
last_sp = tmps[stmt.data.tmp]
|
|
4019
4115
|
|
|
4020
4116
|
if last_sp is not None and isinstance(tmp_irsb.next, pyvex.IRExpr.RdTmp):
|
|
4021
4117
|
val = tmps.get(tmp_irsb.next.tmp, None)
|
|
@@ -4023,10 +4119,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
4023
4119
|
if isinstance(val, tuple) and val[0] == "load":
|
|
4024
4120
|
# the value comes from memory
|
|
4025
4121
|
memory_addr = val[1]
|
|
4026
|
-
if isinstance(last_sp, int)
|
|
4027
|
-
lr_on_stack_offset = memory_addr - last_sp
|
|
4028
|
-
else:
|
|
4029
|
-
lr_on_stack_offset = memory_addr - last_sp[1]
|
|
4122
|
+
lr_on_stack_offset = memory_addr - last_sp if isinstance(last_sp, int) else memory_addr - last_sp[1]
|
|
4030
4123
|
|
|
4031
4124
|
if lr_on_stack_offset == function.info["lr_on_stack_offset"]:
|
|
4032
4125
|
# the jumpkind should be Ret instead of boring
|
|
@@ -4093,7 +4186,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
4093
4186
|
func = self.kb.functions.get_by_addr(current_function_addr)
|
|
4094
4187
|
pc_reg = return_from_func.info["get_pc"]
|
|
4095
4188
|
# the crazy thing is that GCC-generated code may adjust the register value accordingly after
|
|
4096
|
-
# returning! we must take into account the added offset (in the
|
|
4189
|
+
# returning! we must take into account the added offset (in the following example, 0x8d36)
|
|
4097
4190
|
#
|
|
4098
4191
|
# e.g.
|
|
4099
4192
|
# 000011A1 call __x86_get_pc_thunk_bx
|
|
@@ -4172,10 +4265,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
4172
4265
|
|
|
4173
4266
|
is_x86_x64_arch = self.project.arch.name in ("X86", "AMD64")
|
|
4174
4267
|
|
|
4175
|
-
if is_arm_arch(self.project.arch)
|
|
4176
|
-
real_addr = addr & (~1)
|
|
4177
|
-
else:
|
|
4178
|
-
real_addr = addr
|
|
4268
|
+
real_addr = addr & ~1 if is_arm_arch(self.project.arch) else addr
|
|
4179
4269
|
|
|
4180
4270
|
# extra check for ARM
|
|
4181
4271
|
if is_arm_arch(self.project.arch) and self._seg_list.occupied_by_sort(addr) == "code":
|
|
@@ -4231,10 +4321,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
4231
4321
|
next_func.addr & (~1) if is_arm_arch(self.project.arch) else next_func.addr
|
|
4232
4322
|
) - real_addr
|
|
4233
4323
|
if distance_to_func != 0:
|
|
4234
|
-
if distance is None
|
|
4235
|
-
distance = distance_to_func
|
|
4236
|
-
else:
|
|
4237
|
-
distance = min(distance, distance_to_func)
|
|
4324
|
+
distance = distance_to_func if distance is None else min(distance, distance_to_func)
|
|
4238
4325
|
|
|
4239
4326
|
# in the end, check the distance between `addr` and the closest occupied region in segment list
|
|
4240
4327
|
next_noncode_addr = self._seg_list.next_pos_with_sort_not_in(addr, {"code"}, max_distance=distance)
|
|
@@ -4296,7 +4383,6 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
4296
4383
|
# Let's try to create the pyvex IRSB directly, since it's much faster
|
|
4297
4384
|
nodecode = False
|
|
4298
4385
|
irsb = None
|
|
4299
|
-
irsb_string = None
|
|
4300
4386
|
lifted_block = None
|
|
4301
4387
|
try:
|
|
4302
4388
|
lifted_block = self._lift(
|
|
@@ -4307,58 +4393,58 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
4307
4393
|
load_from_ro_regions=True,
|
|
4308
4394
|
initial_regs=initial_regs,
|
|
4309
4395
|
)
|
|
4310
|
-
irsb = lifted_block.vex_nostmt
|
|
4311
|
-
irsb_string = lifted_block.bytes[: irsb.size]
|
|
4396
|
+
irsb = lifted_block.vex_nostmt # may raise SimTranslationError
|
|
4312
4397
|
except SimTranslationError:
|
|
4313
4398
|
nodecode = True
|
|
4314
4399
|
|
|
4315
|
-
|
|
4316
|
-
# special logic during the complete scanning phase
|
|
4400
|
+
irsb_string: bytes = lifted_block.bytes[: irsb.size] if irsb is not None else lifted_block.bytes
|
|
4317
4401
|
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4402
|
+
# special logic during the complete scanning phase
|
|
4403
|
+
if cfg_job.job_type == CFGJobType.COMPLETE_SCANNING and is_arm_arch(self.project.arch):
|
|
4404
|
+
# it's way too easy to incorrectly disassemble THUMB code contains 0x4f as ARM code svc?? #????
|
|
4405
|
+
# if we get a single block that getting decoded to svc?? under ARM mode, we treat it as nodecode
|
|
4406
|
+
if (
|
|
4407
|
+
addr % 4 == 0
|
|
4408
|
+
and irsb.jumpkind == "Ijk_Sys_syscall"
|
|
4409
|
+
and (
|
|
4410
|
+
lifted_block.capstone.insns
|
|
4411
|
+
and lifted_block.capstone.insns[-1].mnemonic.startswith("svc")
|
|
4412
|
+
and lifted_block.capstone.insns[-1].operands[0].imm > 255
|
|
4413
|
+
)
|
|
4414
|
+
):
|
|
4415
|
+
nodecode = True
|
|
4328
4416
|
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
addr_0 = addr + 1
|
|
4334
|
-
else:
|
|
4335
|
-
addr_0 = addr - 1
|
|
4417
|
+
if (nodecode or irsb.size == 0 or irsb.jumpkind == "Ijk_NoDecode") and switch_mode_on_nodecode:
|
|
4418
|
+
# maybe the current mode is wrong?
|
|
4419
|
+
nodecode = False
|
|
4420
|
+
addr_0 = addr + 1 if addr % 2 == 0 else addr - 1
|
|
4336
4421
|
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4422
|
+
if addr_0 in self._nodes:
|
|
4423
|
+
# it has been analyzed before
|
|
4424
|
+
cfg_node = self._nodes[addr_0]
|
|
4425
|
+
irsb = cfg_node.irsb
|
|
4426
|
+
return addr_0, cfg_node.function_address, cfg_node, irsb
|
|
4342
4427
|
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
nodecode = True
|
|
4428
|
+
try:
|
|
4429
|
+
lifted_block = self._lift(
|
|
4430
|
+
addr_0,
|
|
4431
|
+
size=distance,
|
|
4432
|
+
collect_data_refs=True,
|
|
4433
|
+
strict_block_end=True,
|
|
4434
|
+
load_from_ro_regions=True,
|
|
4435
|
+
initial_regs=initial_regs,
|
|
4436
|
+
)
|
|
4437
|
+
irsb = lifted_block.vex_nostmt
|
|
4438
|
+
except SimTranslationError:
|
|
4439
|
+
nodecode = True
|
|
4356
4440
|
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4441
|
+
irsb_string: bytes = lifted_block.bytes[: irsb.size] if irsb is not None else lifted_block.bytes
|
|
4442
|
+
|
|
4443
|
+
if not (nodecode or irsb.size == 0 or irsb.jumpkind == "Ijk_NoDecode"):
|
|
4444
|
+
# it is decodeable
|
|
4445
|
+
if current_function_addr == addr:
|
|
4446
|
+
current_function_addr = addr_0
|
|
4447
|
+
addr = addr_0
|
|
4362
4448
|
|
|
4363
4449
|
is_thumb = False
|
|
4364
4450
|
if is_arm_arch(self.project.arch) and addr % 2 == 1:
|
|
@@ -4416,17 +4502,14 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
4416
4502
|
return None, None, None, None
|
|
4417
4503
|
|
|
4418
4504
|
# we still occupy that location since it cannot be decoded anyways
|
|
4419
|
-
if irsb is None
|
|
4420
|
-
irsb_size = 0
|
|
4421
|
-
else:
|
|
4422
|
-
irsb_size = irsb.size
|
|
4505
|
+
irsb_size = 0 if irsb is None else irsb.size
|
|
4423
4506
|
|
|
4424
4507
|
# the default case
|
|
4425
4508
|
valid_ins = False
|
|
4426
4509
|
nodecode_size = 1
|
|
4427
4510
|
|
|
4428
4511
|
# special handling for ud, ud1, and ud2 on x86 and x86-64
|
|
4429
|
-
if irsb_string[-2:] == b"\x0f\x0b"
|
|
4512
|
+
if self.project.arch.name == "AMD64" and irsb_string[-2:] == b"\x0f\x0b":
|
|
4430
4513
|
# VEX supports ud2 and make it part of the block size, only in AMD64.
|
|
4431
4514
|
valid_ins = True
|
|
4432
4515
|
nodecode_size = 0
|
|
@@ -4544,7 +4627,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
4544
4627
|
For MIPS32 simulates a new state where the global pointer is 0xffffffff
|
|
4545
4628
|
from current address after three steps if the first successor does not
|
|
4546
4629
|
adjust this value updates this function address (in function manager)
|
|
4547
|
-
to use a
|
|
4630
|
+
to use a concrete global pointer
|
|
4548
4631
|
|
|
4549
4632
|
:param addr: irsb address
|
|
4550
4633
|
:param cfg_node: The corresponding CFG node object.
|
|
@@ -4567,38 +4650,35 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
4567
4650
|
# do a bunch of checks to avoid unnecessary simulation from happening
|
|
4568
4651
|
self._arm_track_read_lr_from_stack(irsb, self.functions[func_addr])
|
|
4569
4652
|
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
)
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
)
|
|
4600
|
-
self._insert_job(job)
|
|
4601
|
-
added_addrs.add(ref.data_addr)
|
|
4653
|
+
# e.g.
|
|
4654
|
+
# memcpy_ifunc:
|
|
4655
|
+
# tst.w r0, #0x1000
|
|
4656
|
+
# movw r3, #0xe80
|
|
4657
|
+
# movt r3, #0x10 -> 0x100e80
|
|
4658
|
+
# movw r0, #0x1380
|
|
4659
|
+
# movt r0, #0x10 -> 0x101380
|
|
4660
|
+
# it ne
|
|
4661
|
+
# movne r0, r3
|
|
4662
|
+
# bx lr
|
|
4663
|
+
if (
|
|
4664
|
+
self._arch_options.pattern_match_ifuncs
|
|
4665
|
+
and addr % 2 == 1
|
|
4666
|
+
and len(cfg_node.byte_string) == 26
|
|
4667
|
+
and irsb.instructions == 8
|
|
4668
|
+
and irsb.jumpkind == "Ijk_Ret"
|
|
4669
|
+
):
|
|
4670
|
+
block = self.project.factory.block(addr, opt_level=1, cross_insn_opt=True, collect_data_refs=True)
|
|
4671
|
+
insn_mnemonics = [insn.mnemonic for insn in block.capstone.insns]
|
|
4672
|
+
if insn_mnemonics == ["tst.w", "movw", "movt", "movw", "movt", "it", "movne", "bx"]:
|
|
4673
|
+
# extract data refs with vex-optimization enabled
|
|
4674
|
+
added_addrs = set()
|
|
4675
|
+
for ref in block.vex_nostmt.data_refs:
|
|
4676
|
+
if ref.data_addr not in added_addrs:
|
|
4677
|
+
sec = self.project.loader.find_section_containing(ref.data_addr)
|
|
4678
|
+
if sec is not None and sec.is_executable:
|
|
4679
|
+
job = CFGJob(ref.data_addr, ref.data_addr, "Ijk_Call", job_type=CFGJobType.IFUNC_HINTS)
|
|
4680
|
+
self._insert_job(job)
|
|
4681
|
+
added_addrs.add(ref.data_addr)
|
|
4602
4682
|
|
|
4603
4683
|
# detect if there are instructions that set r4 as a constant value
|
|
4604
4684
|
if (addr & 1) == 0 and addr == func_addr and irsb.size > 0:
|
|
@@ -4694,13 +4774,12 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
4694
4774
|
and len(insn.operands) == 2
|
|
4695
4775
|
and insn.operands[0].type == capstone.x86.X86_OP_REG
|
|
4696
4776
|
and insn.operands[1].type == capstone.x86.X86_OP_MEM
|
|
4777
|
+
) and (
|
|
4778
|
+
insn.operands[0].reg == capstone.x86.X86_REG_RBP
|
|
4779
|
+
and insn.operands[1].mem.base == capstone.x86.X86_REG_RSP
|
|
4697
4780
|
):
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
and insn.operands[1].mem.base == capstone.x86.X86_REG_RSP
|
|
4701
|
-
):
|
|
4702
|
-
rbp_as_gpr = False
|
|
4703
|
-
break
|
|
4781
|
+
rbp_as_gpr = False
|
|
4782
|
+
break
|
|
4704
4783
|
func = self.kb.functions.get_by_addr(func_addr)
|
|
4705
4784
|
func.info["bp_as_gpr"] = rbp_as_gpr
|
|
4706
4785
|
|
|
@@ -4763,16 +4842,14 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
4763
4842
|
Statement 5 should not introduce a new exit in the CFG.
|
|
4764
4843
|
"""
|
|
4765
4844
|
|
|
4766
|
-
|
|
4845
|
+
return bool(
|
|
4767
4846
|
not self.project.arch.branch_delay_slot
|
|
4768
4847
|
and irsb.instruction_addresses
|
|
4769
4848
|
and branch_ins_addr != irsb.instruction_addresses[-1]
|
|
4770
4849
|
and isinstance(exit_stmt.dst, pyvex.const.IRConst)
|
|
4771
4850
|
and exit_stmt.dst.value == branch_ins_addr
|
|
4772
4851
|
and exit_stmt.jumpkind == "Ijk_Boring"
|
|
4773
|
-
)
|
|
4774
|
-
return True
|
|
4775
|
-
return False
|
|
4852
|
+
)
|
|
4776
4853
|
|
|
4777
4854
|
def _remove_jobs_by_source_node_addr(self, addr: int):
|
|
4778
4855
|
self._remove_job(lambda j: j.src_node is not None and j.src_node.addr == addr)
|
|
@@ -4981,25 +5058,23 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
4981
5058
|
edges = list(callee_func.transition_graph.edges())
|
|
4982
5059
|
if len(edges) == 1:
|
|
4983
5060
|
target_func = edges[0][1]
|
|
4984
|
-
if isinstance(target_func, (HookNode, Function)):
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
return self._is_call_returning(callsite_cfgnode, target_func.addr)
|
|
5061
|
+
if isinstance(target_func, (HookNode, Function)) and self.project.is_hooked(target_func.addr):
|
|
5062
|
+
hooker = self.project.hooked_by(target_func.addr)
|
|
5063
|
+
if hooker.DYNAMIC_RET:
|
|
5064
|
+
return self._is_call_returning(callsite_cfgnode, target_func.addr)
|
|
4989
5065
|
|
|
4990
5066
|
if self.project.is_hooked(callee_func_addr):
|
|
4991
5067
|
hooker = self.project.hooked_by(callee_func_addr)
|
|
4992
|
-
if hooker is not None:
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
return hooker.dynamic_returns(blocks_ahead)
|
|
5068
|
+
if hooker is not None and hooker.DYNAMIC_RET:
|
|
5069
|
+
parent_nodes = list(self.graph.predecessors(callsite_cfgnode))
|
|
5070
|
+
parent_node = parent_nodes[0] if parent_nodes else None
|
|
5071
|
+
blocks_ahead = []
|
|
5072
|
+
if parent_node is not None:
|
|
5073
|
+
blocks_ahead.append(self._lift(parent_node.addr).vex)
|
|
5074
|
+
blocks_ahead.append(self._lift(callsite_cfgnode.addr).vex)
|
|
5075
|
+
hooker.project = self.project
|
|
5076
|
+
hooker.arch = self.project.arch
|
|
5077
|
+
return hooker.dynamic_returns(blocks_ahead)
|
|
5003
5078
|
|
|
5004
5079
|
if callee_func is not None:
|
|
5005
5080
|
return callee_func.returning
|
|
@@ -5007,8 +5082,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
5007
5082
|
|
|
5008
5083
|
def _lift(self, addr, *args, opt_level=1, cross_insn_opt=False, **kwargs): # pylint:disable=arguments-differ
|
|
5009
5084
|
kwargs["extra_stop_points"] = set(self._known_thunks)
|
|
5010
|
-
|
|
5011
|
-
return b
|
|
5085
|
+
return super()._lift(addr, *args, opt_level=opt_level, cross_insn_opt=cross_insn_opt, **kwargs)
|
|
5012
5086
|
|
|
5013
5087
|
#
|
|
5014
5088
|
# Public methods
|
|
@@ -5031,9 +5105,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
5031
5105
|
return n
|
|
5032
5106
|
|
|
5033
5107
|
def output(self):
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
return s
|
|
5108
|
+
return f"{self._graph.edges(data=True)}"
|
|
5037
5109
|
|
|
5038
5110
|
@deprecated(replacement="angr.analyses.CFB")
|
|
5039
5111
|
def generate_code_cover(self):
|
|
@@ -5046,8 +5118,7 @@ class CFGFast(ForwardAnalysis[CFGNode, CFGNode, CFGJob, int], CFGBase): # pylin
|
|
|
5046
5118
|
size = cfg_node.size
|
|
5047
5119
|
lst.append((cfg_node.addr, size))
|
|
5048
5120
|
|
|
5049
|
-
|
|
5050
|
-
return lst
|
|
5121
|
+
return sorted(lst, key=lambda x: x[0])
|
|
5051
5122
|
|
|
5052
5123
|
|
|
5053
5124
|
AnalysesHub.register_default("CFGFast", CFGFast)
|