angr 9.2.117__py3-none-manylinux2014_aarch64.whl → 9.2.118__py3-none-manylinux2014_aarch64.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 +45 -45
- 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 +273 -314
- 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 +348 -172
- angr/analyses/decompiler/condition_processor.py +86 -100
- 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 +47 -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 +1 -0
- 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 +500 -0
- angr/analyses/decompiler/optimization_passes/duplication_reverter/duplication_reverter.py +1211 -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 +88 -23
- 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 +163 -158
- 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 +19 -36
- angr/analyses/decompiler/structuring/phoenix.py +199 -199
- 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 +159 -165
- 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 +32 -33
- 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 +83 -93
- 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 +7 -14
- angr/analyses/typehoon/typeconsts.py +14 -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 +10 -11
- 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 +79 -124
- 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 +2 -1
- 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 +1 -0
- 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 +66 -74
- 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 +5 -3
- 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 +41 -47
- 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 +1 -0
- 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 +1 -0
- angr/engines/soot/statements/identity.py +1 -0
- angr/engines/soot/statements/if_.py +1 -0
- 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 +1 -0
- 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 +20 -23
- angr/engines/syscall.py +9 -9
- angr/engines/unicorn.py +12 -7
- 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 +13 -12
- 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 +2 -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 +2 -5
- 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 +3 -2
- 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 +25 -42
- 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 +3 -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/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 +3 -2
- angr/procedures/java_io/read.py +1 -0
- angr/procedures/java_io/write.py +1 -0
- angr/procedures/java_jni/__init__.py +4 -5
- 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 +1 -0
- 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 +2 -2
- 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 +1 -0
- 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 +1 -0
- 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 +2 -1
- 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 +1 -0
- 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 +11 -15
- 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 +11 -10
- angr/sim_state.py +40 -54
- angr/sim_state_options.py +9 -15
- angr/sim_type.py +93 -123
- angr/sim_variable.py +23 -38
- angr/simos/__init__.py +3 -1
- angr/simos/cgc.py +2 -1
- angr/simos/javavm.py +77 -83
- angr/simos/linux.py +53 -63
- angr/simos/simos.py +13 -22
- angr/simos/snimmuc_nxp.py +3 -6
- angr/simos/userland.py +6 -6
- angr/simos/windows.py +13 -10
- angr/slicer.py +13 -11
- angr/state_hierarchy.py +3 -3
- 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 +2 -1
- angr/state_plugins/scratch.py +5 -4
- 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 +64 -92
- angr/state_plugins/symbolizer.py +5 -6
- angr/state_plugins/trace_additions.py +24 -34
- 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 +19 -21
- angr/storage/memory_mixins/__init__.py +12 -15
- angr/storage/memory_mixins/__init__.pyi +13 -14
- angr/storage/memory_mixins/actions_mixin.py +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +37 -41
- 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 +4 -3
- angr/storage/memory_mixins/slotted_memory.py +3 -3
- angr/storage/memory_mixins/smart_find_mixin.py +1 -0
- 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 +30 -28
- 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 +2 -2
- angr/utils/typing.py +1 -0
- angr/vaults.py +7 -8
- {angr-9.2.117.dist-info → angr-9.2.118.dist-info}/METADATA +7 -8
- angr-9.2.118.dist-info/RECORD +1344 -0
- {angr-9.2.117.dist-info → angr-9.2.118.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.118.dist-info}/LICENSE +0 -0
- {angr-9.2.117.dist-info → angr-9.2.118.dist-info}/entry_points.txt +0 -0
- {angr-9.2.117.dist-info → angr-9.2.118.dist-info}/top_level.txt +0 -0
angr/analyses/reassembler.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
from typing import TYPE_CHECKING
|
|
2
3
|
import logging
|
|
3
4
|
import re
|
|
@@ -89,9 +90,7 @@ def string_escape(s):
|
|
|
89
90
|
s = s.encode("unicode_escape").decode("utf-8")
|
|
90
91
|
|
|
91
92
|
s = s.replace("\\'", "'")
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return s
|
|
93
|
+
return s.replace('"', '\\"')
|
|
95
94
|
|
|
96
95
|
|
|
97
96
|
def fill_reg_map():
|
|
@@ -112,13 +111,13 @@ def fill_reg_map():
|
|
|
112
111
|
def split_operands(s):
|
|
113
112
|
operands = []
|
|
114
113
|
operand = ""
|
|
115
|
-
|
|
114
|
+
in_parenthesis = False
|
|
116
115
|
for i, c in enumerate(s):
|
|
117
|
-
if
|
|
118
|
-
|
|
116
|
+
if in_parenthesis and c == ")":
|
|
117
|
+
in_parenthesis = False
|
|
119
118
|
if c == "(":
|
|
120
|
-
|
|
121
|
-
if not
|
|
119
|
+
in_parenthesis = True
|
|
120
|
+
if not in_parenthesis and c == "," and (i == len(s) - 1 or s[i + 1] == " "):
|
|
122
121
|
operands.append(operand)
|
|
123
122
|
operand = ""
|
|
124
123
|
continue
|
|
@@ -171,8 +170,7 @@ class Label:
|
|
|
171
170
|
# if self.var_size is not None:
|
|
172
171
|
# s = ".type {name},@object\n.comm {name},{size},{size}".format(name=self.name, size=self.var_size)
|
|
173
172
|
# else:
|
|
174
|
-
|
|
175
|
-
return s
|
|
173
|
+
return f".{self.name}:"
|
|
176
174
|
|
|
177
175
|
def __hash__(self):
|
|
178
176
|
return hash(self.name)
|
|
@@ -187,12 +185,11 @@ class Label:
|
|
|
187
185
|
@property
|
|
188
186
|
def operand_str(self):
|
|
189
187
|
if self.base_addr is None:
|
|
190
|
-
return "
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return ".%s%s%d" % (self.name, sign, offset)
|
|
188
|
+
return f".{self.name}"
|
|
189
|
+
offset = self.offset
|
|
190
|
+
sign = "+" if offset >= 0 else "-"
|
|
191
|
+
offset = abs(offset)
|
|
192
|
+
return ".%s%s%d" % (self.name, sign, offset)
|
|
196
193
|
|
|
197
194
|
@property
|
|
198
195
|
def offset(self):
|
|
@@ -208,10 +205,9 @@ class Label:
|
|
|
208
205
|
def new_label(binary, name=None, function_name=None, original_addr=None, data_label=False):
|
|
209
206
|
if function_name is not None:
|
|
210
207
|
return FunctionLabel(binary, function_name, original_addr)
|
|
211
|
-
|
|
208
|
+
if data_label:
|
|
212
209
|
return DataLabel(binary, original_addr)
|
|
213
|
-
|
|
214
|
-
return Label(binary, name, original_addr=original_addr)
|
|
210
|
+
return Label(binary, name, original_addr=original_addr)
|
|
215
211
|
|
|
216
212
|
|
|
217
213
|
class DataLabel(Label):
|
|
@@ -222,18 +218,16 @@ class DataLabel(Label):
|
|
|
222
218
|
def operand_str(self):
|
|
223
219
|
if self.base_addr is None:
|
|
224
220
|
return self.name
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
return f"({self.name}{sign}{offset})"
|
|
221
|
+
offset = self.offset
|
|
222
|
+
sign = "+" if offset >= 0 else "-"
|
|
223
|
+
offset = abs(offset)
|
|
224
|
+
return f"({self.name}{sign}{offset})"
|
|
230
225
|
|
|
231
226
|
def __str__(self):
|
|
232
227
|
# if self.var_size is not None:
|
|
233
228
|
# s = ".comm {name},{size},{size}".format(name=self.name, size=self.var_size)
|
|
234
229
|
# else:
|
|
235
|
-
|
|
236
|
-
return s
|
|
230
|
+
return f"{self.name}:"
|
|
237
231
|
|
|
238
232
|
|
|
239
233
|
class FunctionLabel(Label):
|
|
@@ -377,12 +371,12 @@ class SymbolManager:
|
|
|
377
371
|
name = None
|
|
378
372
|
label = Label.new_label(self.binary, name=name, original_addr=addr)
|
|
379
373
|
else:
|
|
380
|
-
raise Exception("Unsupported symbol type
|
|
374
|
+
raise Exception(f"Unsupported symbol type {symbol.type}. Bug Fish about it!")
|
|
381
375
|
|
|
382
376
|
else:
|
|
383
377
|
raise Exception(
|
|
384
|
-
"the symbol
|
|
385
|
-
'"auto_load_libs=False". If that does not solve the issue, please report to GitHub.'
|
|
378
|
+
f"the symbol {symbol.name} is not owned by the main object. Try reload the project with"
|
|
379
|
+
'"auto_load_libs=False". If that does not solve the issue, please report to GitHub.'
|
|
386
380
|
)
|
|
387
381
|
|
|
388
382
|
elif (addr is not None and addr in self.cfg.functions) or is_function:
|
|
@@ -480,12 +474,11 @@ class Operand:
|
|
|
480
474
|
if self.type == OP_TYPE_IMM and self.label:
|
|
481
475
|
if self.label_offset > 0:
|
|
482
476
|
return "%s + %d" % (self.label.operand_str, self.label_offset)
|
|
483
|
-
|
|
477
|
+
if self.label_offset < 0:
|
|
484
478
|
return "%s - %d" % (self.label.operand_str, abs(self.label_offset))
|
|
485
|
-
|
|
486
|
-
return self.label.operand_str
|
|
479
|
+
return self.label.operand_str
|
|
487
480
|
|
|
488
|
-
|
|
481
|
+
if self.type == OP_TYPE_MEM:
|
|
489
482
|
disp = ""
|
|
490
483
|
if self.disp:
|
|
491
484
|
if self.disp_label:
|
|
@@ -504,7 +497,7 @@ class Operand:
|
|
|
504
497
|
|
|
505
498
|
if self.syntax == "at&t":
|
|
506
499
|
# displacement(base, index, scale)
|
|
507
|
-
base = "
|
|
500
|
+
base = f"%{base}" if base else ""
|
|
508
501
|
|
|
509
502
|
if "*" in self.operand_str and disp:
|
|
510
503
|
# absolute memory address
|
|
@@ -524,51 +517,49 @@ class Operand:
|
|
|
524
517
|
|
|
525
518
|
return s
|
|
526
519
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
520
|
+
s = []
|
|
521
|
+
if base:
|
|
522
|
+
s.append(base)
|
|
523
|
+
|
|
524
|
+
if self.index and self.scale:
|
|
525
|
+
if s:
|
|
526
|
+
s.append("+")
|
|
527
|
+
s.append("(%s * %d)" % (CAPSTONE_REG_MAP[self.project.arch.name][self.index], self.scale))
|
|
531
528
|
|
|
532
|
-
|
|
529
|
+
if disp:
|
|
530
|
+
if disp.startswith("-"):
|
|
531
|
+
s.append("-")
|
|
532
|
+
s.append(disp[1:])
|
|
533
|
+
else:
|
|
533
534
|
if s:
|
|
534
535
|
s.append("+")
|
|
535
|
-
s.append(
|
|
536
|
+
s.append(disp)
|
|
536
537
|
|
|
537
|
-
|
|
538
|
-
if disp.startswith("-"):
|
|
539
|
-
s.append("-")
|
|
540
|
-
s.append(disp[1:])
|
|
541
|
-
else:
|
|
542
|
-
if s:
|
|
543
|
-
s.append("+")
|
|
544
|
-
s.append(disp)
|
|
545
|
-
|
|
546
|
-
asm = " ".join(s)
|
|
547
|
-
|
|
548
|
-
# we need to specify the size here
|
|
549
|
-
if self.size == 16:
|
|
550
|
-
asm = "xmmword ptr [%s]" % asm
|
|
551
|
-
elif self.size == 10:
|
|
552
|
-
asm = "xword ptr [%s]" % asm
|
|
553
|
-
elif self.size == 8:
|
|
554
|
-
asm = "qword ptr [%s]" % asm
|
|
555
|
-
elif self.size == 4:
|
|
556
|
-
asm = "dword ptr [%s]" % asm
|
|
557
|
-
elif self.size == 2:
|
|
558
|
-
asm = "word ptr [%s]" % asm
|
|
559
|
-
elif self.size == 1:
|
|
560
|
-
asm = "byte ptr [%s]" % asm
|
|
561
|
-
else:
|
|
562
|
-
raise BinaryError('Unsupported memory operand size for operand "%s"' % self.operand_str)
|
|
538
|
+
asm = " ".join(s)
|
|
563
539
|
|
|
564
|
-
|
|
540
|
+
# we need to specify the size here
|
|
541
|
+
if self.size == 16:
|
|
542
|
+
asm = f"xmmword ptr [{asm}]"
|
|
543
|
+
elif self.size == 10:
|
|
544
|
+
asm = f"xword ptr [{asm}]"
|
|
545
|
+
elif self.size == 8:
|
|
546
|
+
asm = f"qword ptr [{asm}]"
|
|
547
|
+
elif self.size == 4:
|
|
548
|
+
asm = f"dword ptr [{asm}]"
|
|
549
|
+
elif self.size == 2:
|
|
550
|
+
asm = f"word ptr [{asm}]"
|
|
551
|
+
elif self.size == 1:
|
|
552
|
+
asm = f"byte ptr [{asm}]"
|
|
553
|
+
else:
|
|
554
|
+
raise BinaryError(f'Unsupported memory operand size for operand "{self.operand_str}"')
|
|
565
555
|
|
|
566
|
-
|
|
556
|
+
return asm
|
|
557
|
+
|
|
558
|
+
if self.type == OP_TYPE_RAW:
|
|
567
559
|
return self.raw_asm
|
|
568
560
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
return None
|
|
561
|
+
# Nothing special
|
|
562
|
+
return None
|
|
572
563
|
|
|
573
564
|
#
|
|
574
565
|
# Overridden predefined methods
|
|
@@ -590,8 +581,7 @@ class Operand:
|
|
|
590
581
|
|
|
591
582
|
if ref_type:
|
|
592
583
|
return f"{op_type} <{ref_type}>"
|
|
593
|
-
|
|
594
|
-
return op_type
|
|
584
|
+
return op_type
|
|
595
585
|
|
|
596
586
|
#
|
|
597
587
|
# Properties
|
|
@@ -663,17 +653,19 @@ class Operand:
|
|
|
663
653
|
is_coderef, is_dataref = False, False
|
|
664
654
|
baseaddr = None
|
|
665
655
|
|
|
666
|
-
if
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
656
|
+
if (
|
|
657
|
+
not is_coderef
|
|
658
|
+
and not is_dataref
|
|
659
|
+
and self.binary.main_executable_regions_contain(imm)
|
|
660
|
+
# does it point to the beginning of an instruction?
|
|
661
|
+
and imm in self.binary.all_insn_addrs
|
|
662
|
+
):
|
|
663
|
+
is_coderef = True
|
|
664
|
+
baseaddr = imm
|
|
672
665
|
|
|
673
|
-
if not is_coderef and not is_dataref:
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
baseaddr = imm
|
|
666
|
+
if not is_coderef and not is_dataref and self.binary.main_nonexecutable_regions_contain(imm):
|
|
667
|
+
is_dataref = True
|
|
668
|
+
baseaddr = imm
|
|
677
669
|
|
|
678
670
|
if not is_coderef and not is_dataref:
|
|
679
671
|
tolerance_before = 1024 if operand_type == OP_TYPE_MEM else 64
|
|
@@ -744,8 +736,7 @@ class Instruction:
|
|
|
744
736
|
:return:
|
|
745
737
|
"""
|
|
746
738
|
|
|
747
|
-
|
|
748
|
-
return assembly
|
|
739
|
+
return self.assembly(comments=True, symbolized=False)
|
|
749
740
|
|
|
750
741
|
#
|
|
751
742
|
# Public methods
|
|
@@ -761,9 +752,7 @@ class Instruction:
|
|
|
761
752
|
def dbg_comments(self):
|
|
762
753
|
operands = ", ".join([str(operand) for operand in self.operands])
|
|
763
754
|
capstone_str = f"{self.addr:#08x}:\t{self.mnemonic}\t{self.op_str}"
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
return comments
|
|
755
|
+
return f"\t# {capstone_str} [{operands}]"
|
|
767
756
|
|
|
768
757
|
def assembly(self, comments=False, symbolized=True):
|
|
769
758
|
"""
|
|
@@ -771,10 +760,7 @@ class Instruction:
|
|
|
771
760
|
:return:
|
|
772
761
|
"""
|
|
773
762
|
|
|
774
|
-
if comments
|
|
775
|
-
dbg_comments = self.dbg_comments()
|
|
776
|
-
else:
|
|
777
|
-
dbg_comments = ""
|
|
763
|
+
dbg_comments = self.dbg_comments() if comments else ""
|
|
778
764
|
|
|
779
765
|
labels = "\n".join([str(lbl) for lbl in self.labels])
|
|
780
766
|
|
|
@@ -798,7 +784,7 @@ class Instruction:
|
|
|
798
784
|
if not symbolized:
|
|
799
785
|
asm = not_symbolized
|
|
800
786
|
|
|
801
|
-
elif not any(
|
|
787
|
+
elif not any((operand.symbolized or operand.type == OP_TYPE_RAW) for operand in self.operands):
|
|
802
788
|
# No label is involved
|
|
803
789
|
asm = not_symbolized
|
|
804
790
|
|
|
@@ -824,7 +810,7 @@ class Instruction:
|
|
|
824
810
|
raise BinaryError("Unsupported operand type %d." % op.type)
|
|
825
811
|
|
|
826
812
|
if op.type != OP_TYPE_RAW and self.capstone_operand_types[i] == capstone.CS_OP_IMM:
|
|
827
|
-
if mnemonic.startswith("j"
|
|
813
|
+
if mnemonic.startswith(("j", "call", "loop")):
|
|
828
814
|
pass
|
|
829
815
|
else:
|
|
830
816
|
# mark the size of the variable
|
|
@@ -918,7 +904,7 @@ class BasicBlock:
|
|
|
918
904
|
return self.assembly(symbolized=False)
|
|
919
905
|
|
|
920
906
|
def __repr__(self):
|
|
921
|
-
return "<BasicBlock
|
|
907
|
+
return f"<BasicBlock {self.addr:#08x}>"
|
|
922
908
|
|
|
923
909
|
#
|
|
924
910
|
# Public methods
|
|
@@ -929,9 +915,7 @@ class BasicBlock:
|
|
|
929
915
|
ins.assign_labels()
|
|
930
916
|
|
|
931
917
|
def assembly(self, comments=False, symbolized=True):
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
return s
|
|
918
|
+
return "\n".join([ins.assembly(comments=comments, symbolized=symbolized) for ins in self.instructions])
|
|
935
919
|
|
|
936
920
|
def instruction_addresses(self):
|
|
937
921
|
return sorted([(ins.addr, ins.size) for ins in self.instructions], key=lambda x: x[0])
|
|
@@ -970,7 +954,7 @@ class BasicBlock:
|
|
|
970
954
|
and instr.operands[0].type == capstone.CS_OP_REG
|
|
971
955
|
and instr.operands[1].type == capstone.CS_OP_IMM
|
|
972
956
|
):
|
|
973
|
-
instruction.operands[1].type
|
|
957
|
+
instruction.operands[1].type = OP_TYPE_RAW
|
|
974
958
|
instruction.operands[1].raw_asm = "OFFSET FLAG:_GLOBAL_OFFSET_TABLE_"
|
|
975
959
|
|
|
976
960
|
self.instructions.append(instruction)
|
|
@@ -1112,14 +1096,9 @@ class Procedure:
|
|
|
1112
1096
|
|
|
1113
1097
|
assembly = []
|
|
1114
1098
|
|
|
1115
|
-
header = "\t.section\t{section}\n\t.align\t{
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
if self.addr is not None:
|
|
1119
|
-
procedure_name = "%#x" % self.addr
|
|
1120
|
-
else:
|
|
1121
|
-
procedure_name = self._name
|
|
1122
|
-
header += "\t#Procedure %s\n" % procedure_name
|
|
1099
|
+
header = f"\t.section\t{self.section}\n\t.align\t{self.binary.section_alignment(self.section)}\n"
|
|
1100
|
+
procedure_name = f"{self.addr:#x}" if self.addr is not None else self._name
|
|
1101
|
+
header += f"\t#Procedure {procedure_name}\n"
|
|
1123
1102
|
|
|
1124
1103
|
if self._output_function_label:
|
|
1125
1104
|
if self.addr:
|
|
@@ -1170,16 +1149,14 @@ class Procedure:
|
|
|
1170
1149
|
|
|
1171
1150
|
else:
|
|
1172
1151
|
x86_getpc_retsites = set()
|
|
1173
|
-
if self.project.arch.name == "X86":
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
# found it!
|
|
1182
|
-
x86_getpc_retsites.add(src.addr + src.size)
|
|
1152
|
+
if self.project.arch.name == "X86" and "pc_reg" in self.function.info:
|
|
1153
|
+
# this is an x86-PIC function that calls a get_pc thunk
|
|
1154
|
+
# we need to fix the "add e{a,b,c}x, offset" instruction right after the get_pc call
|
|
1155
|
+
# first let's identify which function is the get_pc function
|
|
1156
|
+
for src, dst, _data in self.function.transition_graph.edges(data=True):
|
|
1157
|
+
if isinstance(src, CodeNode) and isinstance(dst, Function) and "get_pc" in dst.info:
|
|
1158
|
+
# found it!
|
|
1159
|
+
x86_getpc_retsites.add(src.addr + src.size)
|
|
1183
1160
|
for block_addr in self.function.block_addrs:
|
|
1184
1161
|
b = BasicBlock(
|
|
1185
1162
|
self.binary,
|
|
@@ -1211,9 +1188,7 @@ class Procedure:
|
|
|
1211
1188
|
return True
|
|
1212
1189
|
if not the_block.instructions:
|
|
1213
1190
|
return True
|
|
1214
|
-
|
|
1215
|
-
return True
|
|
1216
|
-
return False
|
|
1191
|
+
return bool(not the_block.instructions[0].labels)
|
|
1217
1192
|
|
|
1218
1193
|
|
|
1219
1194
|
class ProcedureChunk(Procedure):
|
|
@@ -1355,9 +1330,9 @@ class Data:
|
|
|
1355
1330
|
|
|
1356
1331
|
if comments:
|
|
1357
1332
|
if self.addr is not None:
|
|
1358
|
-
s += "\t# data @
|
|
1333
|
+
s += f"\t# data @ {self.addr:#08x}\n"
|
|
1359
1334
|
else:
|
|
1360
|
-
s += "\t# data (
|
|
1335
|
+
s += f"\t# data ({self.name})\n"
|
|
1361
1336
|
|
|
1362
1337
|
if self.skip:
|
|
1363
1338
|
return s
|
|
@@ -1376,37 +1351,22 @@ class Data:
|
|
|
1376
1351
|
|
|
1377
1352
|
last_pos = pos
|
|
1378
1353
|
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
else:
|
|
1382
|
-
directive = ".ascii"
|
|
1354
|
+
# null at the end in true case
|
|
1355
|
+
directive = ".asciz" if i == len(self.labels) - 1 and pos == self.size else ".ascii"
|
|
1383
1356
|
|
|
1384
1357
|
if string_piece:
|
|
1385
|
-
ss.append(
|
|
1386
|
-
|
|
1387
|
-
str=string_escape(string_piece),
|
|
1388
|
-
directive=directive,
|
|
1389
|
-
)
|
|
1390
|
-
)
|
|
1391
|
-
ss.append("%s" % str(lbl))
|
|
1358
|
+
ss.append(f'\t{directive} "{string_escape(string_piece)}"')
|
|
1359
|
+
ss.append(f"{lbl!s}")
|
|
1392
1360
|
|
|
1393
1361
|
if last_pos <= self.size - 1:
|
|
1394
1362
|
string_piece = self.content[0][last_pos:]
|
|
1395
1363
|
directive = ".ascii" if self.null_terminated is False else ".asciz"
|
|
1396
1364
|
|
|
1397
|
-
ss.append(
|
|
1398
|
-
'\t{directive} "{str}"'.format(
|
|
1399
|
-
str=string_escape(string_piece),
|
|
1400
|
-
directive=directive,
|
|
1401
|
-
)
|
|
1402
|
-
)
|
|
1365
|
+
ss.append(f'\t{directive} "{string_escape(string_piece)}"')
|
|
1403
1366
|
|
|
1404
1367
|
s += "\n".join(ss)
|
|
1405
1368
|
else:
|
|
1406
|
-
if self.null_terminated is False
|
|
1407
|
-
directive = ".ascii"
|
|
1408
|
-
else:
|
|
1409
|
-
directive = ".asciz"
|
|
1369
|
+
directive = ".ascii" if self.null_terminated is False else ".asciz"
|
|
1410
1370
|
s += f'\t.{directive} "{string_escape(self.content[0])}"'
|
|
1411
1371
|
s += "\n"
|
|
1412
1372
|
|
|
@@ -1427,15 +1387,15 @@ class Data:
|
|
|
1427
1387
|
|
|
1428
1388
|
i = 0
|
|
1429
1389
|
if self.name is not None:
|
|
1430
|
-
s += "
|
|
1390
|
+
s += f"{self.name}:\n"
|
|
1431
1391
|
for symbolized_label in self.content:
|
|
1432
1392
|
if self.addr is not None and (self.addr + i) in addr_to_labels:
|
|
1433
1393
|
for label in addr_to_labels[self.addr + i]:
|
|
1434
|
-
s += "
|
|
1394
|
+
s += f"{label!s}\n"
|
|
1435
1395
|
elif self.addr is not None and (self.addr + i) in self.binary.symbol_manager.addr_to_label:
|
|
1436
1396
|
labels = self.binary.symbol_manager.addr_to_label[self.addr + i]
|
|
1437
1397
|
for label in labels:
|
|
1438
|
-
s += "
|
|
1398
|
+
s += f"{label!s}\n"
|
|
1439
1399
|
i += self.project.arch.bytes
|
|
1440
1400
|
|
|
1441
1401
|
if isinstance(symbolized_label, int):
|
|
@@ -1450,7 +1410,7 @@ class Data:
|
|
|
1450
1410
|
elif self.sort == MemoryDataSort.SegmentBoundary:
|
|
1451
1411
|
if symbolized:
|
|
1452
1412
|
for _, label in self.labels:
|
|
1453
|
-
s += "\t
|
|
1413
|
+
s += f"\t{label!s}\n"
|
|
1454
1414
|
|
|
1455
1415
|
elif self.sort == MemoryDataSort.Integer:
|
|
1456
1416
|
# display it as bytes only when there are references pointing to the middle
|
|
@@ -1481,25 +1441,26 @@ class Data:
|
|
|
1481
1441
|
addr_to_labels[k].append(v)
|
|
1482
1442
|
|
|
1483
1443
|
show_integer = False
|
|
1484
|
-
if len(addr_to_labels) == 0
|
|
1444
|
+
if len(addr_to_labels) == 0 or (
|
|
1445
|
+
len(addr_to_labels) == 1
|
|
1446
|
+
and self.addr is not None
|
|
1447
|
+
and next(iter(addr_to_labels.keys())) == self.addr
|
|
1448
|
+
or self.addr is None
|
|
1449
|
+
and next(iter(addr_to_labels.keys())) == 0
|
|
1450
|
+
):
|
|
1485
1451
|
show_integer = True
|
|
1486
|
-
elif len(addr_to_labels) == 1:
|
|
1487
|
-
if self.addr is not None and next(iter(addr_to_labels.keys())) == self.addr:
|
|
1488
|
-
show_integer = True
|
|
1489
|
-
elif self.addr is None and next(iter(addr_to_labels.keys())) == 0:
|
|
1490
|
-
show_integer = True
|
|
1491
1452
|
|
|
1492
1453
|
if directive is not None and show_integer:
|
|
1493
1454
|
# nice, we should display it as an integer
|
|
1494
1455
|
if addr_to_labels:
|
|
1495
1456
|
for label in next(iter(addr_to_labels.values())):
|
|
1496
|
-
content += ["
|
|
1457
|
+
content += [f"{label!s}"]
|
|
1497
1458
|
|
|
1498
1459
|
integer = struct.unpack(fmt_str, self.content[0])[0]
|
|
1499
1460
|
content += [
|
|
1500
1461
|
"\t{directive} {integer}".format(
|
|
1501
1462
|
directive=directive,
|
|
1502
|
-
integer="
|
|
1463
|
+
integer=f"{integer:#x}",
|
|
1503
1464
|
)
|
|
1504
1465
|
]
|
|
1505
1466
|
|
|
@@ -1510,7 +1471,7 @@ class Data:
|
|
|
1510
1471
|
for c in piece:
|
|
1511
1472
|
if addr in addr_to_labels:
|
|
1512
1473
|
for label in addr_to_labels[addr]:
|
|
1513
|
-
content += ["
|
|
1474
|
+
content += [f"{label!s}"]
|
|
1514
1475
|
addr += 1
|
|
1515
1476
|
|
|
1516
1477
|
content += ["\t.byte %d" % c]
|
|
@@ -1520,7 +1481,7 @@ class Data:
|
|
|
1520
1481
|
content += [
|
|
1521
1482
|
"\t{directive} {integer}".format(
|
|
1522
1483
|
directive=directive,
|
|
1523
|
-
integer="
|
|
1484
|
+
integer=f"{integer:#x}",
|
|
1524
1485
|
)
|
|
1525
1486
|
]
|
|
1526
1487
|
|
|
@@ -1544,7 +1505,7 @@ class Data:
|
|
|
1544
1505
|
for c in piece:
|
|
1545
1506
|
if addr in addr_to_labels:
|
|
1546
1507
|
for label in addr_to_labels[addr]:
|
|
1547
|
-
content += ["
|
|
1508
|
+
content += [f"{label!s}"]
|
|
1548
1509
|
addr += 1
|
|
1549
1510
|
|
|
1550
1511
|
content += ["\t.byte %d" % c]
|
|
@@ -1570,7 +1531,7 @@ class Data:
|
|
|
1570
1531
|
for c in piece:
|
|
1571
1532
|
if addr in addr_to_labels:
|
|
1572
1533
|
for label in addr_to_labels[addr]:
|
|
1573
|
-
content += ["
|
|
1534
|
+
content += [f"{label!s}"]
|
|
1574
1535
|
addr += 1
|
|
1575
1536
|
|
|
1576
1537
|
content += ["\t.byte %d" % c]
|
|
@@ -1583,7 +1544,7 @@ class Data:
|
|
|
1583
1544
|
|
|
1584
1545
|
if self.end_labels:
|
|
1585
1546
|
for label in self.end_labels:
|
|
1586
|
-
s += "
|
|
1547
|
+
s += f"{label}\n"
|
|
1587
1548
|
|
|
1588
1549
|
return s.strip("\n")
|
|
1589
1550
|
|
|
@@ -1646,7 +1607,7 @@ class Data:
|
|
|
1646
1607
|
self._content = []
|
|
1647
1608
|
|
|
1648
1609
|
else:
|
|
1649
|
-
raise BinaryError('Unsupported data sort "
|
|
1610
|
+
raise BinaryError(f'Unsupported data sort "{self.sort}"')
|
|
1650
1611
|
|
|
1651
1612
|
else:
|
|
1652
1613
|
self.addr = self.memory_data.address
|
|
@@ -1727,8 +1688,7 @@ class Relocation:
|
|
|
1727
1688
|
self.sort = sort
|
|
1728
1689
|
|
|
1729
1690
|
def __repr__(self):
|
|
1730
|
-
|
|
1731
|
-
return s
|
|
1691
|
+
return f"<Reloc {self.sort} {self.addr:#x} ({self.ref_addr:#x})>"
|
|
1732
1692
|
|
|
1733
1693
|
|
|
1734
1694
|
class Reassembler(Analysis):
|
|
@@ -1738,7 +1698,7 @@ class Reassembler(Analysis):
|
|
|
1738
1698
|
|
|
1739
1699
|
Tested on CGC, x86 and x86-64 binaries.
|
|
1740
1700
|
|
|
1741
|
-
|
|
1701
|
+
Disclaimer: The reassembler is an empirical solution. Don't be surprised if it does not work on some binaries.
|
|
1742
1702
|
"""
|
|
1743
1703
|
|
|
1744
1704
|
def __init__(self, syntax="intel", remove_cgc_attachments=True, log_relocations=True):
|
|
@@ -1786,9 +1746,7 @@ class Reassembler(Analysis):
|
|
|
1786
1746
|
:return:
|
|
1787
1747
|
"""
|
|
1788
1748
|
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
return s
|
|
1749
|
+
return "\n".join([str(proc) for proc in self.procedures])
|
|
1792
1750
|
|
|
1793
1751
|
#
|
|
1794
1752
|
# Properties
|
|
@@ -1802,7 +1760,7 @@ class Reassembler(Analysis):
|
|
|
1802
1760
|
:rtype: tuple
|
|
1803
1761
|
"""
|
|
1804
1762
|
|
|
1805
|
-
raise NotImplementedError
|
|
1763
|
+
raise NotImplementedError
|
|
1806
1764
|
|
|
1807
1765
|
@property
|
|
1808
1766
|
def relocations(self):
|
|
@@ -1900,10 +1858,7 @@ class Reassembler(Analysis):
|
|
|
1900
1858
|
:param addr:
|
|
1901
1859
|
:return:
|
|
1902
1860
|
"""
|
|
1903
|
-
for start, end in self.main_executable_regions
|
|
1904
|
-
if start <= addr < end:
|
|
1905
|
-
return True
|
|
1906
|
-
return False
|
|
1861
|
+
return any(start <= addr < end for start, end in self.main_executable_regions)
|
|
1907
1862
|
|
|
1908
1863
|
def main_executable_region_limbos_contain(self, addr):
|
|
1909
1864
|
"""
|
|
@@ -1921,14 +1876,12 @@ class Reassembler(Analysis):
|
|
|
1921
1876
|
least_limbo = None
|
|
1922
1877
|
|
|
1923
1878
|
for start, end in self.main_executable_regions:
|
|
1924
|
-
if start - TOLERANCE <= addr < start:
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
closest_region = (True, end)
|
|
1931
|
-
least_limbo = addr - end
|
|
1879
|
+
if start - TOLERANCE <= addr < start and (least_limbo is None or start - addr < least_limbo):
|
|
1880
|
+
closest_region = (True, start)
|
|
1881
|
+
least_limbo = start - addr
|
|
1882
|
+
if end <= addr < end + TOLERANCE and (least_limbo is None or addr - end < least_limbo):
|
|
1883
|
+
closest_region = (True, end)
|
|
1884
|
+
least_limbo = addr - end
|
|
1932
1885
|
|
|
1933
1886
|
if closest_region is not None:
|
|
1934
1887
|
return closest_region
|
|
@@ -1941,10 +1894,7 @@ class Reassembler(Analysis):
|
|
|
1941
1894
|
:return: True if the address is inside a non-executable region, False otherwise.
|
|
1942
1895
|
:rtype: bool
|
|
1943
1896
|
"""
|
|
1944
|
-
for start, end in self.main_nonexecutable_regions
|
|
1945
|
-
if start <= addr < end:
|
|
1946
|
-
return True
|
|
1947
|
-
return False
|
|
1897
|
+
return any(start <= addr < end for start, end in self.main_nonexecutable_regions)
|
|
1948
1898
|
|
|
1949
1899
|
def main_nonexecutable_region_limbos_contain(self, addr, tolerance_before=64, tolerance_after=64):
|
|
1950
1900
|
"""
|
|
@@ -1960,14 +1910,12 @@ class Reassembler(Analysis):
|
|
|
1960
1910
|
least_limbo = None
|
|
1961
1911
|
|
|
1962
1912
|
for start, end in self.main_nonexecutable_regions:
|
|
1963
|
-
if start - tolerance_before <= addr < start:
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
closest_region = (True, end)
|
|
1970
|
-
least_limbo = addr - end
|
|
1913
|
+
if (start - tolerance_before <= addr < start) and (least_limbo is None or start - addr < least_limbo):
|
|
1914
|
+
closest_region = (True, start)
|
|
1915
|
+
least_limbo = start - addr
|
|
1916
|
+
if (end <= addr < end + tolerance_after) and (least_limbo is None or addr - end < least_limbo):
|
|
1917
|
+
closest_region = (True, end)
|
|
1918
|
+
least_limbo = addr - end
|
|
1971
1919
|
|
|
1972
1920
|
if closest_region is not None:
|
|
1973
1921
|
return closest_region
|
|
@@ -2044,10 +1992,7 @@ class Reassembler(Analysis):
|
|
|
2044
1992
|
:return: None
|
|
2045
1993
|
"""
|
|
2046
1994
|
|
|
2047
|
-
if readonly
|
|
2048
|
-
section_name = ".rodata"
|
|
2049
|
-
else:
|
|
2050
|
-
section_name = ".data"
|
|
1995
|
+
section_name = ".rodata" if readonly else ".data"
|
|
2051
1996
|
|
|
2052
1997
|
if initial_content is None:
|
|
2053
1998
|
initial_content = b""
|
|
@@ -2082,7 +2027,7 @@ class Reassembler(Analysis):
|
|
|
2082
2027
|
:return:
|
|
2083
2028
|
"""
|
|
2084
2029
|
|
|
2085
|
-
raise NotImplementedError
|
|
2030
|
+
raise NotImplementedError
|
|
2086
2031
|
|
|
2087
2032
|
def symbolize(self):
|
|
2088
2033
|
# clear the flag
|
|
@@ -2389,20 +2334,18 @@ class Reassembler(Analysis):
|
|
|
2389
2334
|
ptr = d.content[i]
|
|
2390
2335
|
if isinstance(ptr, Label) and ptr.name in glibc_references_blacklist:
|
|
2391
2336
|
d.content[i] = 0
|
|
2392
|
-
elif d.sort == MemoryDataSort.SegmentBoundary:
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
new_labels.append((rebased_addr, label))
|
|
2405
|
-
d.labels = new_labels
|
|
2337
|
+
elif d.sort == MemoryDataSort.SegmentBoundary and d.labels:
|
|
2338
|
+
new_labels = []
|
|
2339
|
+
for rebased_addr, label in d.labels:
|
|
2340
|
+
# check if this label belongs to a removed function
|
|
2341
|
+
if (
|
|
2342
|
+
self.cfg.functions.contains_addr(rebased_addr)
|
|
2343
|
+
and self.cfg.functions[rebased_addr].name in glibc_functions_blacklist
|
|
2344
|
+
):
|
|
2345
|
+
# we need to remove this label...
|
|
2346
|
+
continue
|
|
2347
|
+
new_labels.append((rebased_addr, label))
|
|
2348
|
+
d.labels = new_labels
|
|
2406
2349
|
|
|
2407
2350
|
#
|
|
2408
2351
|
# Private methods
|
|
@@ -2478,9 +2421,7 @@ class Reassembler(Analysis):
|
|
|
2478
2421
|
l.debug("Creating functions...")
|
|
2479
2422
|
for f in cfg.kb.functions.values():
|
|
2480
2423
|
# Skip all SimProcedures
|
|
2481
|
-
if self.project.is_hooked(f.addr):
|
|
2482
|
-
continue
|
|
2483
|
-
elif self.project.simos.is_syscall_addr(f.addr):
|
|
2424
|
+
if self.project.is_hooked(f.addr) or self.project.simos.is_syscall_addr(f.addr):
|
|
2484
2425
|
continue
|
|
2485
2426
|
|
|
2486
2427
|
# Check which section the start address belongs to
|
|
@@ -2634,35 +2575,34 @@ class Reassembler(Analysis):
|
|
|
2634
2575
|
continue
|
|
2635
2576
|
|
|
2636
2577
|
# process the overlapping ones
|
|
2637
|
-
if i < len(self.data) - 1:
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
original_data.desymbolize()
|
|
2578
|
+
if i < len(self.data) - 1 and data.addr + data.size > self.data[i + 1].addr:
|
|
2579
|
+
# they are overlapping :-(
|
|
2580
|
+
|
|
2581
|
+
# TODO: make sure new_size makes sense
|
|
2582
|
+
new_size = self.data[i + 1].addr - data.addr
|
|
2583
|
+
|
|
2584
|
+
# there are cases that legit data is misclassified as pointers
|
|
2585
|
+
# we are able to detect some of them here
|
|
2586
|
+
if data.sort == "pointer-array":
|
|
2587
|
+
pointer_size = self.project.arch.bytes
|
|
2588
|
+
if new_size % pointer_size != 0:
|
|
2589
|
+
# the self.data[i+1] cannot be pointed to by a pointer
|
|
2590
|
+
# remove that guy later
|
|
2591
|
+
data_indices_to_remove.add(i + 1)
|
|
2592
|
+
# mark the source as a non-pointer
|
|
2593
|
+
# apparently the original Reassembleable Disassembler paper cannot get this case
|
|
2594
|
+
source_addr = self.data[i + 1].memory_data.pointer_addr
|
|
2595
|
+
if source_addr is not None:
|
|
2596
|
+
# find the original data
|
|
2597
|
+
original_data = next(
|
|
2598
|
+
(d for d in self.data if d.addr <= source_addr < d.addr + d.size), None
|
|
2599
|
+
)
|
|
2600
|
+
if original_data is not None:
|
|
2601
|
+
original_data.desymbolize()
|
|
2662
2602
|
|
|
2663
|
-
|
|
2603
|
+
continue
|
|
2664
2604
|
|
|
2665
|
-
|
|
2605
|
+
data.shrink(new_size)
|
|
2666
2606
|
|
|
2667
2607
|
# process those ones whose type is unknown
|
|
2668
2608
|
if data.sort == "unknown" and data.size == 0:
|
|
@@ -2692,7 +2632,7 @@ class Reassembler(Analysis):
|
|
|
2692
2632
|
data = self.fast_memory_load(addr, size, bytes)
|
|
2693
2633
|
if data is None:
|
|
2694
2634
|
return False
|
|
2695
|
-
ints =
|
|
2635
|
+
ints = list(data)
|
|
2696
2636
|
if len({(i - j) for i, j in zip(ints, ints[1:])}) == 1:
|
|
2697
2637
|
# arithmetic progression
|
|
2698
2638
|
# backoff: it should not be ending with a pointer
|
|
@@ -2700,19 +2640,16 @@ class Reassembler(Analysis):
|
|
|
2700
2640
|
ptr = self.fast_memory_load(closest_aligned_addr, 4, int, endness=self.project.arch.memory_endness)
|
|
2701
2641
|
if ptr is None:
|
|
2702
2642
|
return False
|
|
2703
|
-
|
|
2704
|
-
return False
|
|
2705
|
-
return True
|
|
2643
|
+
return not self._is_pointer(cfg, ptr)
|
|
2706
2644
|
return False
|
|
2707
2645
|
|
|
2708
2646
|
def _is_pointer(self, cfg, ptr):
|
|
2709
|
-
|
|
2647
|
+
return bool(
|
|
2710
2648
|
cfg.project.loader.find_section_containing(ptr) is not None
|
|
2711
2649
|
or cfg.project.loader.find_segment_containing(ptr) is not None
|
|
2712
|
-
or
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
return False
|
|
2650
|
+
or self._extra_memory_regions
|
|
2651
|
+
and next((a < ptr < b for a, b in self._extra_memory_regions), None)
|
|
2652
|
+
)
|
|
2716
2653
|
|
|
2717
2654
|
def _sequence_handler(self, cfg, irsb, irsb_addr, stmt_idx, data_addr, max_size): # pylint:disable=unused-argument
|
|
2718
2655
|
"""
|
|
@@ -2852,10 +2789,9 @@ class Reassembler(Analysis):
|
|
|
2852
2789
|
|
|
2853
2790
|
if size is not None:
|
|
2854
2791
|
return "unknown", size
|
|
2855
|
-
|
|
2792
|
+
if sequence_offset is not None:
|
|
2856
2793
|
return "unknown", sequence_offset
|
|
2857
|
-
|
|
2858
|
-
return None, None
|
|
2794
|
+
return None, None
|
|
2859
2795
|
|
|
2860
2796
|
def _has_integer_used_as_pointers(self):
|
|
2861
2797
|
"""
|