angr 9.2.117__py3-none-win_amd64.whl → 9.2.119__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of angr might be problematic. Click here for more details.
- angr/__init__.py +2 -1
- angr/__main__.py +21 -1
- angr/analyses/__init__.py +4 -0
- angr/analyses/analysis.py +88 -46
- angr/analyses/backward_slice.py +15 -18
- angr/analyses/binary_optimizer.py +29 -34
- angr/analyses/bindiff.py +35 -44
- angr/analyses/boyscout.py +1 -0
- angr/analyses/callee_cleanup_finder.py +3 -4
- angr/analyses/calling_convention.py +98 -98
- angr/analyses/cdg.py +5 -12
- angr/analyses/cfg/__init__.py +1 -0
- angr/analyses/cfg/cfb.py +14 -20
- angr/analyses/cfg/cfg.py +2 -1
- angr/analyses/cfg/cfg_arch_options.py +4 -1
- angr/analyses/cfg/cfg_base.py +122 -165
- angr/analyses/cfg/cfg_emulated.py +60 -92
- angr/analyses/cfg/cfg_fast.py +406 -335
- angr/analyses/cfg/cfg_fast_soot.py +10 -17
- angr/analyses/cfg/cfg_job_base.py +6 -7
- angr/analyses/cfg/indirect_jump_resolvers/__init__.py +1 -0
- angr/analyses/cfg/indirect_jump_resolvers/amd64_elf_got.py +2 -3
- angr/analyses/cfg/indirect_jump_resolvers/amd64_pe_iat.py +2 -3
- angr/analyses/cfg/indirect_jump_resolvers/arm_elf_fast.py +6 -8
- angr/analyses/cfg/indirect_jump_resolvers/const_resolver.py +3 -5
- angr/analyses/cfg/indirect_jump_resolvers/default_resolvers.py +1 -0
- angr/analyses/cfg/indirect_jump_resolvers/jumptable.py +97 -112
- angr/analyses/cfg/indirect_jump_resolvers/mips_elf_fast.py +26 -32
- angr/analyses/cfg/indirect_jump_resolvers/propagator_utils.py +1 -0
- angr/analyses/cfg/indirect_jump_resolvers/resolver.py +7 -7
- angr/analyses/cfg/indirect_jump_resolvers/x86_elf_pic_plt.py +3 -8
- angr/analyses/cfg/indirect_jump_resolvers/x86_pe_iat.py +2 -3
- angr/analyses/cfg_slice_to_sink/__init__.py +1 -0
- angr/analyses/cfg_slice_to_sink/cfg_slice_to_sink.py +4 -4
- angr/analyses/cfg_slice_to_sink/graph.py +4 -1
- angr/analyses/cfg_slice_to_sink/transitions.py +4 -2
- angr/analyses/class_identifier.py +1 -0
- angr/analyses/code_tagging.py +9 -9
- angr/analyses/complete_calling_conventions.py +28 -36
- angr/analyses/congruency_check.py +6 -11
- angr/analyses/data_dep/__init__.py +1 -0
- angr/analyses/data_dep/data_dependency_analysis.py +38 -48
- angr/analyses/data_dep/dep_nodes.py +13 -12
- angr/analyses/data_dep/sim_act_location.py +3 -0
- angr/analyses/datagraph_meta.py +7 -7
- angr/analyses/ddg.py +48 -69
- angr/analyses/decompiler/__init__.py +3 -0
- angr/analyses/decompiler/ail_simplifier.py +929 -400
- angr/analyses/decompiler/ailgraph_walker.py +1 -0
- angr/analyses/decompiler/block_io_finder.py +13 -4
- angr/analyses/decompiler/block_similarity.py +28 -18
- angr/analyses/decompiler/block_simplifier.py +40 -104
- angr/analyses/decompiler/callsite_maker.py +124 -82
- angr/analyses/decompiler/ccall_rewriters/__init__.py +1 -0
- angr/analyses/decompiler/ccall_rewriters/amd64_ccalls.py +115 -105
- angr/analyses/decompiler/ccall_rewriters/rewriter_base.py +2 -1
- angr/analyses/decompiler/clinic.py +371 -184
- angr/analyses/decompiler/condition_processor.py +127 -116
- angr/analyses/decompiler/counters/__init__.py +5 -0
- angr/analyses/decompiler/counters/boolean_counter.py +27 -0
- angr/analyses/decompiler/{call_counter.py → counters/call_counter.py} +5 -4
- angr/analyses/decompiler/{expression_counters.py → counters/expression_counters.py} +5 -4
- angr/analyses/decompiler/counters/seq_cf_structure_counter.py +63 -0
- angr/analyses/decompiler/decompilation_cache.py +2 -1
- angr/analyses/decompiler/decompilation_options.py +1 -0
- angr/analyses/decompiler/decompiler.py +50 -27
- angr/analyses/decompiler/dephication/__init__.py +6 -0
- angr/analyses/decompiler/dephication/dephication_base.py +87 -0
- angr/analyses/decompiler/dephication/graph_dephication.py +63 -0
- angr/analyses/decompiler/dephication/graph_rewriting.py +116 -0
- angr/analyses/decompiler/dephication/graph_vvar_mapping.py +313 -0
- angr/analyses/decompiler/dephication/rewriting_engine.py +247 -0
- angr/analyses/decompiler/dephication/seqnode_dephication.py +106 -0
- angr/analyses/decompiler/empty_node_remover.py +1 -0
- angr/analyses/decompiler/expression_narrower.py +12 -17
- angr/analyses/decompiler/goto_manager.py +43 -4
- angr/analyses/decompiler/graph_region.py +19 -31
- angr/analyses/decompiler/jump_target_collector.py +1 -0
- angr/analyses/decompiler/jumptable_entry_condition_rewriter.py +2 -1
- angr/analyses/decompiler/optimization_passes/__init__.py +7 -3
- angr/analyses/decompiler/optimization_passes/base_ptr_save_simplifier.py +23 -18
- angr/analyses/decompiler/optimization_passes/call_stmt_rewriter.py +46 -0
- angr/analyses/decompiler/optimization_passes/code_motion.py +4 -2
- angr/analyses/decompiler/optimization_passes/const_derefs.py +36 -36
- angr/analyses/decompiler/optimization_passes/const_prop_reverter.py +6 -9
- angr/analyses/decompiler/optimization_passes/cross_jump_reverter.py +4 -3
- angr/analyses/decompiler/optimization_passes/deadblock_remover.py +1 -0
- angr/analyses/decompiler/optimization_passes/div_simplifier.py +78 -72
- angr/analyses/decompiler/optimization_passes/duplication_reverter/__init__.py +2 -0
- angr/analyses/decompiler/optimization_passes/duplication_reverter/ail_merge_graph.py +503 -0
- angr/analyses/decompiler/optimization_passes/duplication_reverter/duplication_reverter.py +1215 -0
- angr/analyses/decompiler/optimization_passes/duplication_reverter/errors.py +16 -0
- angr/analyses/decompiler/optimization_passes/duplication_reverter/similarity.py +126 -0
- angr/analyses/decompiler/optimization_passes/duplication_reverter/utils.py +169 -0
- angr/analyses/decompiler/optimization_passes/engine_base.py +60 -63
- angr/analyses/decompiler/optimization_passes/expr_op_swapper.py +6 -7
- angr/analyses/decompiler/optimization_passes/flip_boolean_cmp.py +1 -0
- angr/analyses/decompiler/optimization_passes/inlined_string_transformation_simplifier.py +102 -37
- angr/analyses/decompiler/optimization_passes/ite_expr_converter.py +8 -10
- angr/analyses/decompiler/optimization_passes/ite_region_converter.py +128 -18
- angr/analyses/decompiler/optimization_passes/lowered_switch_simplifier.py +142 -145
- angr/analyses/decompiler/optimization_passes/mod_simplifier.py +27 -23
- angr/analyses/decompiler/optimization_passes/multi_simplifier.py +30 -34
- angr/analyses/decompiler/optimization_passes/optimization_pass.py +108 -47
- angr/analyses/decompiler/optimization_passes/register_save_area_simplifier.py +10 -3
- angr/analyses/decompiler/optimization_passes/ret_addr_save_simplifier.py +5 -6
- angr/analyses/decompiler/optimization_passes/ret_deduplicator.py +3 -2
- angr/analyses/decompiler/optimization_passes/return_duplicator_base.py +125 -13
- angr/analyses/decompiler/optimization_passes/return_duplicator_high.py +1 -0
- angr/analyses/decompiler/optimization_passes/return_duplicator_low.py +3 -2
- angr/analyses/decompiler/optimization_passes/stack_canary_simplifier.py +52 -21
- angr/analyses/decompiler/optimization_passes/switch_default_case_duplicator.py +3 -2
- angr/analyses/decompiler/optimization_passes/win_stack_canary_simplifier.py +47 -36
- angr/analyses/decompiler/optimization_passes/x86_gcc_getpc_simplifier.py +2 -1
- angr/analyses/decompiler/peephole_optimizations/__init__.py +2 -0
- angr/analyses/decompiler/peephole_optimizations/a_div_const_add_a_mul_n_div_const.py +26 -22
- angr/analyses/decompiler/peephole_optimizations/a_mul_const_div_shr_const.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/a_shl_const_sub_a.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/a_sub_a_div.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/a_sub_a_div_const_mul_const.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/a_sub_a_sub_n.py +8 -4
- angr/analyses/decompiler/peephole_optimizations/arm_cmpf.py +28 -27
- angr/analyses/decompiler/peephole_optimizations/base.py +17 -20
- angr/analyses/decompiler/peephole_optimizations/basepointeroffset_add_n.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/basepointeroffset_and_mask.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/bitwise_or_to_logical_or.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/bool_expr_xor_1.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/bswap.py +29 -22
- angr/analyses/decompiler/peephole_optimizations/cmpord_rewriter.py +3 -4
- angr/analyses/decompiler/peephole_optimizations/coalesce_adjacent_shrs.py +39 -0
- angr/analyses/decompiler/peephole_optimizations/coalesce_same_cascading_ifs.py +2 -1
- angr/analyses/decompiler/peephole_optimizations/const_mull_a_shift.py +94 -29
- angr/analyses/decompiler/peephole_optimizations/constant_derefs.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/conv_a_sub0_shr_and.py +48 -49
- angr/analyses/decompiler/peephole_optimizations/conv_shl_shr.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/eager_eval.py +41 -34
- angr/analyses/decompiler/peephole_optimizations/extended_byte_and_mask.py +2 -1
- angr/analyses/decompiler/peephole_optimizations/inlined_strcpy.py +28 -18
- angr/analyses/decompiler/peephole_optimizations/inlined_strcpy_consolidation.py +8 -4
- angr/analyses/decompiler/peephole_optimizations/inlined_wstrcpy.py +28 -18
- angr/analyses/decompiler/peephole_optimizations/invert_negated_logical_conjuction_disjunction.py +32 -32
- angr/analyses/decompiler/peephole_optimizations/one_sub_bool.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/remove_cascading_conversions.py +23 -3
- angr/analyses/decompiler/peephole_optimizations/remove_empty_if_body.py +2 -1
- angr/analyses/decompiler/peephole_optimizations/remove_noop_conversions.py +4 -0
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_bitmasks.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_conversions.py +4 -6
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_ite_branch.py +14 -13
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_ite_comparisons.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_nots.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_reinterprets.py +3 -2
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_shifts.py +2 -2
- angr/analyses/decompiler/peephole_optimizations/remove_redundant_shifts_around_comparators.py +20 -16
- angr/analyses/decompiler/peephole_optimizations/rewrite_bit_extractions.py +3 -3
- angr/analyses/decompiler/peephole_optimizations/rewrite_mips_gp_loads.py +4 -2
- angr/analyses/decompiler/peephole_optimizations/rol_ror.py +66 -40
- angr/analyses/decompiler/peephole_optimizations/sar_to_signed_div.py +64 -57
- angr/analyses/decompiler/peephole_optimizations/simplify_pc_relative_loads.py +14 -14
- angr/analyses/decompiler/peephole_optimizations/single_bit_cond_to_boolexpr.py +1 -0
- angr/analyses/decompiler/peephole_optimizations/single_bit_xor.py +8 -5
- angr/analyses/decompiler/peephole_optimizations/tidy_stack_addr.py +4 -6
- angr/analyses/decompiler/redundant_label_remover.py +20 -19
- angr/analyses/decompiler/region_identifier.py +64 -77
- angr/analyses/decompiler/region_simplifiers/__init__.py +1 -0
- angr/analyses/decompiler/region_simplifiers/cascading_cond_transformer.py +2 -1
- angr/analyses/decompiler/region_simplifiers/cascading_ifs.py +1 -0
- angr/analyses/decompiler/region_simplifiers/expr_folding.py +43 -29
- angr/analyses/decompiler/region_simplifiers/goto.py +1 -0
- angr/analyses/decompiler/region_simplifiers/if_.py +29 -36
- angr/analyses/decompiler/region_simplifiers/ifelse.py +1 -0
- angr/analyses/decompiler/region_simplifiers/loop.py +27 -13
- angr/analyses/decompiler/region_simplifiers/node_address_finder.py +1 -0
- angr/analyses/decompiler/region_simplifiers/region_simplifier.py +1 -0
- angr/analyses/decompiler/region_simplifiers/switch_cluster_simplifier.py +12 -16
- angr/analyses/decompiler/region_simplifiers/switch_expr_simplifier.py +36 -32
- angr/analyses/decompiler/region_walker.py +1 -0
- angr/analyses/decompiler/return_maker.py +1 -0
- angr/analyses/decompiler/seq_to_blocks.py +1 -0
- angr/analyses/decompiler/sequence_walker.py +5 -10
- angr/analyses/decompiler/ssailification/__init__.py +4 -0
- angr/analyses/decompiler/ssailification/rewriting.py +325 -0
- angr/analyses/decompiler/ssailification/rewriting_engine.py +601 -0
- angr/analyses/decompiler/ssailification/rewriting_state.py +60 -0
- angr/analyses/decompiler/ssailification/ssailification.py +213 -0
- angr/analyses/decompiler/ssailification/traversal.py +97 -0
- angr/analyses/decompiler/ssailification/traversal_engine.py +131 -0
- angr/analyses/decompiler/ssailification/traversal_state.py +42 -0
- angr/analyses/decompiler/structured_codegen/__init__.py +1 -0
- angr/analyses/decompiler/structured_codegen/base.py +2 -2
- angr/analyses/decompiler/structured_codegen/c.py +172 -160
- angr/analyses/decompiler/structured_codegen/dummy.py +1 -0
- angr/analyses/decompiler/structured_codegen/dwarf_import.py +1 -0
- angr/analyses/decompiler/structuring/__init__.py +1 -0
- angr/analyses/decompiler/structuring/dream.py +27 -43
- angr/analyses/decompiler/structuring/phoenix.py +201 -201
- angr/analyses/decompiler/structuring/recursive_structurer.py +4 -3
- angr/analyses/decompiler/structuring/sailr.py +5 -4
- angr/analyses/decompiler/structuring/structurer_base.py +26 -23
- angr/analyses/decompiler/structuring/structurer_nodes.py +14 -24
- angr/analyses/decompiler/utils.py +112 -52
- angr/analyses/disassembly.py +75 -77
- angr/analyses/disassembly_utils.py +10 -13
- angr/analyses/dominance_frontier.py +25 -7
- angr/analyses/find_objects_static.py +3 -2
- angr/analyses/flirt.py +7 -10
- angr/analyses/forward_analysis/__init__.py +1 -0
- angr/analyses/forward_analysis/forward_analysis.py +9 -6
- angr/analyses/forward_analysis/job_info.py +3 -3
- angr/analyses/forward_analysis/visitors/__init__.py +1 -0
- angr/analyses/forward_analysis/visitors/call_graph.py +1 -0
- angr/analyses/forward_analysis/visitors/function_graph.py +3 -2
- angr/analyses/forward_analysis/visitors/graph.py +9 -9
- angr/analyses/forward_analysis/visitors/loop.py +1 -0
- angr/analyses/forward_analysis/visitors/single_node_graph.py +2 -2
- angr/analyses/identifier/__init__.py +1 -0
- angr/analyses/identifier/custom_callable.py +2 -2
- angr/analyses/identifier/errors.py +1 -0
- angr/analyses/identifier/func.py +6 -3
- angr/analyses/identifier/functions/__init__.py +2 -1
- angr/analyses/identifier/functions/atoi.py +2 -4
- angr/analyses/identifier/functions/based_atoi.py +3 -6
- angr/analyses/identifier/functions/fdprintf.py +1 -0
- angr/analyses/identifier/functions/free.py +3 -5
- angr/analyses/identifier/functions/int2str.py +11 -26
- angr/analyses/identifier/functions/malloc.py +4 -6
- angr/analyses/identifier/functions/memcmp.py +2 -4
- angr/analyses/identifier/functions/memcpy.py +2 -2
- angr/analyses/identifier/functions/memset.py +2 -2
- angr/analyses/identifier/functions/printf.py +1 -0
- angr/analyses/identifier/functions/recv_until.py +3 -6
- angr/analyses/identifier/functions/skip_calloc.py +2 -1
- angr/analyses/identifier/functions/skip_realloc.py +4 -6
- angr/analyses/identifier/functions/skip_recv_n.py +4 -6
- angr/analyses/identifier/functions/snprintf.py +2 -4
- angr/analyses/identifier/functions/sprintf.py +1 -0
- angr/analyses/identifier/functions/strcasecmp.py +1 -0
- angr/analyses/identifier/functions/strcmp.py +2 -1
- angr/analyses/identifier/functions/strcpy.py +2 -2
- angr/analyses/identifier/functions/strlen.py +1 -0
- angr/analyses/identifier/functions/strncmp.py +2 -1
- angr/analyses/identifier/functions/strncpy.py +2 -2
- angr/analyses/identifier/functions/strtol.py +2 -4
- angr/analyses/identifier/identify.py +35 -54
- angr/analyses/identifier/runner.py +6 -5
- angr/analyses/init_finder.py +17 -17
- angr/analyses/loop_analysis.py +10 -14
- angr/analyses/loopfinder.py +9 -13
- angr/analyses/propagator/__init__.py +1 -0
- angr/analyses/propagator/engine_ail.py +161 -166
- angr/analyses/propagator/engine_base.py +3 -2
- angr/analyses/propagator/engine_vex.py +47 -48
- angr/analyses/propagator/outdated_definition_walker.py +18 -23
- angr/analyses/propagator/propagator.py +8 -12
- angr/analyses/propagator/tmpvar_finder.py +1 -0
- angr/analyses/propagator/top_checker_mixin.py +2 -4
- angr/analyses/propagator/values.py +1 -0
- angr/analyses/propagator/vex_vars.py +3 -2
- angr/analyses/proximity_graph.py +12 -20
- angr/analyses/reaching_definitions/__init__.py +5 -4
- angr/analyses/reaching_definitions/call_trace.py +7 -6
- angr/analyses/reaching_definitions/dep_graph.py +18 -23
- angr/analyses/reaching_definitions/engine_ail.py +89 -121
- angr/analyses/reaching_definitions/engine_vex.py +20 -32
- angr/analyses/reaching_definitions/function_handler.py +38 -35
- angr/analyses/reaching_definitions/function_handler_library/__init__.py +1 -0
- angr/analyses/reaching_definitions/function_handler_library/stdio.py +4 -6
- angr/analyses/reaching_definitions/function_handler_library/stdlib.py +1 -2
- angr/analyses/reaching_definitions/function_handler_library/string.py +2 -4
- angr/analyses/reaching_definitions/function_handler_library/unistd.py +1 -0
- angr/analyses/reaching_definitions/heap_allocator.py +7 -6
- angr/analyses/reaching_definitions/rd_initializer.py +27 -25
- angr/analyses/reaching_definitions/rd_state.py +14 -16
- angr/analyses/reaching_definitions/reaching_definitions.py +27 -36
- angr/analyses/reaching_definitions/subject.py +3 -2
- angr/analyses/reassembler.py +189 -253
- angr/analyses/s_liveness/__init__.py +2 -0
- angr/analyses/s_liveness/s_liveness.py +153 -0
- angr/analyses/s_propagator/__init__.py +2 -0
- angr/analyses/s_propagator/s_propagator.py +250 -0
- angr/analyses/s_reaching_definitions/__init__.py +2 -0
- angr/analyses/s_reaching_definitions/s_rda.py +479 -0
- angr/analyses/soot_class_hierarchy.py +15 -24
- angr/analyses/stack_pointer_tracker.py +106 -98
- angr/analyses/static_hooker.py +3 -2
- angr/analyses/typehoon/__init__.py +1 -0
- angr/analyses/typehoon/dfa.py +5 -5
- angr/analyses/typehoon/lifter.py +5 -4
- angr/analyses/typehoon/simple_solver.py +80 -64
- angr/analyses/typehoon/translator.py +26 -16
- angr/analyses/typehoon/typeconsts.py +22 -12
- angr/analyses/typehoon/typehoon.py +8 -10
- angr/analyses/typehoon/typevars.py +37 -49
- angr/analyses/typehoon/variance.py +1 -0
- angr/analyses/variable_recovery/__init__.py +1 -0
- angr/analyses/variable_recovery/annotations.py +1 -0
- angr/analyses/variable_recovery/engine_ail.py +78 -32
- angr/analyses/variable_recovery/engine_base.py +233 -59
- angr/analyses/variable_recovery/engine_vex.py +17 -21
- angr/analyses/variable_recovery/irsb_scanner.py +1 -0
- angr/analyses/variable_recovery/variable_recovery.py +14 -16
- angr/analyses/variable_recovery/variable_recovery_base.py +12 -14
- angr/analyses/variable_recovery/variable_recovery_fast.py +67 -47
- angr/analyses/veritesting.py +10 -16
- angr/analyses/vfg.py +102 -148
- angr/analyses/vsa_ddg.py +3 -5
- angr/analyses/vtable.py +6 -6
- angr/analyses/xrefs.py +9 -13
- angr/angrdb/__init__.py +4 -2
- angr/angrdb/db.py +51 -53
- angr/angrdb/models.py +1 -0
- angr/angrdb/serializers/__init__.py +1 -0
- angr/angrdb/serializers/cfg_model.py +2 -2
- angr/angrdb/serializers/comments.py +1 -0
- angr/angrdb/serializers/funcs.py +4 -3
- angr/angrdb/serializers/kb.py +3 -2
- angr/angrdb/serializers/labels.py +1 -0
- angr/angrdb/serializers/structured_code.py +5 -10
- angr/angrdb/serializers/variables.py +6 -6
- angr/angrdb/serializers/xrefs.py +2 -2
- angr/annocfg.py +17 -25
- angr/blade.py +19 -23
- angr/block.py +11 -13
- angr/callable.py +4 -3
- angr/calling_conventions.py +147 -147
- angr/code_location.py +12 -13
- angr/codenode.py +2 -1
- angr/concretization_strategies/__init__.py +6 -6
- angr/concretization_strategies/any.py +5 -4
- angr/concretization_strategies/any_named.py +1 -0
- angr/concretization_strategies/controlled_data.py +1 -0
- angr/concretization_strategies/eval.py +2 -2
- angr/concretization_strategies/logging.py +1 -0
- angr/concretization_strategies/max.py +6 -6
- angr/concretization_strategies/nonzero.py +1 -0
- angr/concretization_strategies/nonzero_range.py +4 -3
- angr/concretization_strategies/norepeats.py +5 -4
- angr/concretization_strategies/norepeats_range.py +1 -0
- angr/concretization_strategies/range.py +1 -0
- angr/concretization_strategies/signed_add.py +13 -9
- angr/concretization_strategies/single.py +2 -0
- angr/concretization_strategies/solutions.py +1 -0
- angr/concretization_strategies/unlimited_range.py +1 -0
- angr/distributed/__init__.py +1 -0
- angr/distributed/server.py +2 -2
- angr/distributed/worker.py +3 -3
- angr/engines/__init__.py +1 -0
- angr/engines/concrete.py +2 -1
- angr/engines/engine.py +4 -6
- angr/engines/failure.py +2 -1
- angr/engines/hook.py +1 -0
- angr/engines/light/__init__.py +1 -0
- angr/engines/light/data.py +221 -255
- angr/engines/light/engine.py +72 -85
- angr/engines/pcode/__init__.py +1 -0
- angr/engines/pcode/behavior.py +3 -3
- angr/engines/pcode/cc.py +1 -0
- angr/engines/pcode/emulate.py +13 -16
- angr/engines/pcode/engine.py +7 -5
- angr/engines/pcode/lifter.py +62 -79
- angr/engines/procedure.py +1 -0
- angr/engines/soot/__init__.py +1 -0
- angr/engines/soot/engine.py +46 -52
- angr/engines/soot/exceptions.py +3 -0
- angr/engines/soot/expressions/__init__.py +1 -0
- angr/engines/soot/expressions/arrayref.py +1 -0
- angr/engines/soot/expressions/base.py +4 -5
- angr/engines/soot/expressions/binop.py +1 -0
- angr/engines/soot/expressions/cast.py +1 -0
- angr/engines/soot/expressions/condition.py +2 -1
- angr/engines/soot/expressions/constants.py +1 -0
- angr/engines/soot/expressions/instanceOf.py +1 -0
- angr/engines/soot/expressions/instancefieldref.py +1 -0
- angr/engines/soot/expressions/invoke.py +7 -9
- angr/engines/soot/expressions/length.py +1 -0
- angr/engines/soot/expressions/local.py +1 -0
- angr/engines/soot/expressions/new.py +1 -0
- angr/engines/soot/expressions/newArray.py +1 -0
- angr/engines/soot/expressions/newMultiArray.py +3 -3
- angr/engines/soot/expressions/paramref.py +1 -0
- angr/engines/soot/expressions/phi.py +1 -0
- angr/engines/soot/expressions/staticfieldref.py +1 -0
- angr/engines/soot/expressions/thisref.py +1 -0
- angr/engines/soot/expressions/unsupported.py +1 -0
- angr/engines/soot/field_dispatcher.py +5 -8
- angr/engines/soot/method_dispatcher.py +4 -7
- angr/engines/soot/statements/__init__.py +4 -4
- angr/engines/soot/statements/assign.py +1 -0
- angr/engines/soot/statements/base.py +6 -7
- angr/engines/soot/statements/goto.py +2 -1
- angr/engines/soot/statements/identity.py +1 -0
- angr/engines/soot/statements/if_.py +2 -1
- angr/engines/soot/statements/invoke.py +1 -0
- angr/engines/soot/statements/return_.py +1 -0
- angr/engines/soot/statements/switch.py +1 -0
- angr/engines/soot/statements/throw.py +2 -1
- angr/engines/soot/values/__init__.py +4 -2
- angr/engines/soot/values/arrayref.py +8 -10
- angr/engines/soot/values/base.py +4 -1
- angr/engines/soot/values/constants.py +1 -0
- angr/engines/soot/values/instancefieldref.py +1 -0
- angr/engines/soot/values/local.py +1 -0
- angr/engines/soot/values/paramref.py +1 -0
- angr/engines/soot/values/staticfieldref.py +1 -0
- angr/engines/soot/values/strref.py +3 -2
- angr/engines/soot/values/thisref.py +1 -0
- angr/engines/successors.py +21 -24
- angr/engines/syscall.py +9 -9
- angr/engines/unicorn.py +14 -9
- angr/engines/vex/__init__.py +1 -0
- angr/engines/vex/claripy/__init__.py +1 -0
- angr/engines/vex/claripy/ccall.py +86 -112
- angr/engines/vex/claripy/datalayer.py +12 -16
- angr/engines/vex/claripy/irop.py +85 -104
- angr/engines/vex/heavy/__init__.py +1 -0
- angr/engines/vex/heavy/actions.py +1 -0
- angr/engines/vex/heavy/concretizers.py +8 -9
- angr/engines/vex/heavy/dirty.py +6 -5
- angr/engines/vex/heavy/heavy.py +15 -14
- angr/engines/vex/heavy/inspect.py +1 -0
- angr/engines/vex/heavy/resilience.py +2 -2
- angr/engines/vex/heavy/super_fastpath.py +2 -2
- angr/engines/vex/lifter.py +28 -35
- angr/engines/vex/light/__init__.py +1 -0
- angr/engines/vex/light/light.py +2 -4
- angr/engines/vex/light/resilience.py +1 -0
- angr/engines/vex/light/slicing.py +1 -0
- angr/errors.py +6 -1
- angr/exploration_techniques/__init__.py +3 -2
- angr/exploration_techniques/bucketizer.py +2 -3
- angr/exploration_techniques/common.py +3 -3
- angr/exploration_techniques/dfs.py +1 -0
- angr/exploration_techniques/director.py +17 -19
- angr/exploration_techniques/driller_core.py +3 -7
- angr/exploration_techniques/explorer.py +7 -3
- angr/exploration_techniques/lengthlimiter.py +1 -0
- angr/exploration_techniques/local_loop_seer.py +2 -2
- angr/exploration_techniques/loop_seer.py +11 -14
- angr/exploration_techniques/manual_mergepoint.py +3 -2
- angr/exploration_techniques/memory_watcher.py +1 -0
- angr/exploration_techniques/oppologist.py +4 -4
- angr/exploration_techniques/slicecutor.py +1 -0
- angr/exploration_techniques/spiller.py +8 -8
- angr/exploration_techniques/spiller_db.py +1 -0
- angr/exploration_techniques/stochastic.py +3 -4
- angr/exploration_techniques/stub_stasher.py +1 -0
- angr/exploration_techniques/suggestions.py +5 -4
- angr/exploration_techniques/symbion.py +1 -0
- angr/exploration_techniques/tech_builder.py +1 -0
- angr/exploration_techniques/threading.py +1 -0
- angr/exploration_techniques/timeout.py +1 -0
- angr/exploration_techniques/tracer.py +34 -39
- angr/exploration_techniques/unique.py +1 -0
- angr/exploration_techniques/veritesting.py +1 -0
- angr/factory.py +9 -9
- angr/flirt/__init__.py +1 -0
- angr/flirt/build_sig.py +8 -12
- angr/keyed_region.py +10 -17
- angr/knowledge_base/__init__.py +1 -0
- angr/knowledge_base/knowledge_base.py +17 -17
- angr/knowledge_plugins/__init__.py +1 -0
- angr/knowledge_plugins/callsite_prototypes.py +1 -0
- angr/knowledge_plugins/cfg/__init__.py +2 -0
- angr/knowledge_plugins/cfg/cfg_manager.py +2 -1
- angr/knowledge_plugins/cfg/cfg_model.py +27 -43
- angr/knowledge_plugins/cfg/cfg_node.py +8 -19
- angr/knowledge_plugins/cfg/indirect_jump.py +3 -5
- angr/knowledge_plugins/cfg/memory_data.py +4 -3
- angr/knowledge_plugins/comments.py +1 -0
- angr/knowledge_plugins/custom_strings.py +1 -0
- angr/knowledge_plugins/data.py +1 -0
- angr/knowledge_plugins/debug_variables.py +18 -23
- angr/knowledge_plugins/functions/__init__.py +1 -0
- angr/knowledge_plugins/functions/function.py +49 -53
- angr/knowledge_plugins/functions/function_manager.py +14 -14
- angr/knowledge_plugins/functions/function_parser.py +38 -42
- angr/knowledge_plugins/functions/soot_function.py +5 -6
- angr/knowledge_plugins/indirect_jumps.py +1 -0
- angr/knowledge_plugins/key_definitions/__init__.py +1 -0
- angr/knowledge_plugins/key_definitions/atoms.py +65 -17
- angr/knowledge_plugins/key_definitions/constants.py +6 -0
- angr/knowledge_plugins/key_definitions/definition.py +22 -25
- angr/knowledge_plugins/key_definitions/environment.py +18 -14
- angr/knowledge_plugins/key_definitions/heap_address.py +4 -3
- angr/knowledge_plugins/key_definitions/key_definition_manager.py +5 -4
- angr/knowledge_plugins/key_definitions/live_definitions.py +36 -45
- angr/knowledge_plugins/key_definitions/liveness.py +18 -23
- angr/knowledge_plugins/key_definitions/rd_model.py +29 -34
- angr/knowledge_plugins/key_definitions/tag.py +7 -6
- angr/knowledge_plugins/key_definitions/undefined.py +3 -0
- angr/knowledge_plugins/key_definitions/unknown_size.py +3 -0
- angr/knowledge_plugins/key_definitions/uses.py +21 -23
- angr/knowledge_plugins/labels.py +3 -2
- angr/knowledge_plugins/patches.py +2 -1
- angr/knowledge_plugins/plugin.py +2 -1
- angr/knowledge_plugins/propagations/__init__.py +1 -0
- angr/knowledge_plugins/propagations/prop_value.py +25 -27
- angr/knowledge_plugins/propagations/propagation_manager.py +2 -2
- angr/knowledge_plugins/propagations/propagation_model.py +5 -4
- angr/knowledge_plugins/propagations/states.py +71 -81
- angr/knowledge_plugins/structured_code/__init__.py +1 -0
- angr/knowledge_plugins/structured_code/manager.py +5 -4
- angr/knowledge_plugins/sync/__init__.py +1 -0
- angr/knowledge_plugins/sync/sync_controller.py +10 -15
- angr/knowledge_plugins/types.py +1 -0
- angr/knowledge_plugins/variables/__init__.py +1 -0
- angr/knowledge_plugins/variables/variable_access.py +9 -10
- angr/knowledge_plugins/variables/variable_manager.py +84 -55
- angr/knowledge_plugins/xrefs/__init__.py +1 -0
- angr/knowledge_plugins/xrefs/xref.py +7 -11
- angr/knowledge_plugins/xrefs/xref_manager.py +1 -0
- angr/knowledge_plugins/xrefs/xref_types.py +3 -0
- angr/lib/angr_native.dll +0 -0
- angr/misc/__init__.py +1 -0
- angr/misc/ansi.py +1 -0
- angr/misc/autoimport.py +3 -2
- angr/misc/bug_report.py +6 -5
- angr/misc/hookset.py +3 -2
- angr/misc/loggers.py +2 -2
- angr/misc/picklable_lock.py +1 -0
- angr/misc/plugins.py +11 -13
- angr/misc/range.py +3 -0
- angr/misc/telemetry.py +54 -0
- angr/misc/testing.py +2 -1
- angr/misc/ux.py +5 -5
- angr/misc/weakpatch.py +1 -0
- angr/procedures/__init__.py +1 -0
- angr/procedures/cgc/_terminate.py +1 -0
- angr/procedures/cgc/allocate.py +1 -0
- angr/procedures/cgc/deallocate.py +1 -0
- angr/procedures/cgc/fdwait.py +1 -0
- angr/procedures/cgc/random.py +1 -0
- angr/procedures/cgc/receive.py +26 -26
- angr/procedures/cgc/transmit.py +1 -0
- angr/procedures/definitions/__init__.py +9 -10
- angr/procedures/definitions/cgc.py +1 -0
- angr/procedures/definitions/glibc.py +1 -0
- angr/procedures/definitions/gnulib.py +1 -0
- angr/procedures/definitions/libstdcpp.py +1 -0
- angr/procedures/definitions/linux_kernel.py +1 -0
- angr/procedures/definitions/linux_loader.py +1 -0
- angr/procedures/definitions/msvcr.py +1 -0
- angr/procedures/definitions/parse_syscalls_from_local_system.py +2 -1
- angr/procedures/definitions/parse_win32json.py +27 -30
- angr/procedures/definitions/types_win32.py +1 -0
- angr/procedures/definitions/wdk_api-ms-win-dx-d3dkmt-l1-1-4.py +1 -0
- angr/procedures/definitions/wdk_api-ms-win-dx-d3dkmt-l1-1-6.py +1 -0
- angr/procedures/definitions/wdk_clfs.py +1 -0
- angr/procedures/definitions/wdk_fltmgr.py +1 -0
- angr/procedures/definitions/wdk_fwpkclnt.py +1 -0
- angr/procedures/definitions/wdk_fwpuclnt.py +1 -0
- angr/procedures/definitions/wdk_gdi32.py +1 -0
- angr/procedures/definitions/wdk_hal.py +1 -0
- angr/procedures/definitions/wdk_ksecdd.py +1 -0
- angr/procedures/definitions/wdk_ndis.py +1 -0
- angr/procedures/definitions/wdk_ntoskrnl.py +1 -0
- angr/procedures/definitions/wdk_offreg.py +1 -0
- angr/procedures/definitions/wdk_pshed.py +1 -0
- angr/procedures/definitions/wdk_secur32.py +1 -0
- angr/procedures/definitions/wdk_vhfum.py +1 -0
- angr/procedures/definitions/win32_aclui.py +1 -0
- angr/procedures/definitions/win32_activeds.py +1 -0
- angr/procedures/definitions/win32_advapi32.py +1 -0
- angr/procedures/definitions/win32_advpack.py +1 -0
- angr/procedures/definitions/win32_amsi.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-appmodel-runtime-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-appmodel-runtime-l1-1-3.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-appmodel-runtime-l1-1-6.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-apiquery-l2-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-backgroundtask-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-comm-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-comm-l1-1-2.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-enclave-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-errorhandling-l1-1-3.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-featurestaging-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-featurestaging-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-file-fromapp-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-handle-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-ioring-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-marshal-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-memory-l1-1-3.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-memory-l1-1-4.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-memory-l1-1-5.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-memory-l1-1-6.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-memory-l1-1-7.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-memory-l1-1-8.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-path-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-psm-appnotify-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-psm-appnotify-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-realtime-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-realtime-l1-1-2.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-slapi-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-state-helpers-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-synch-l1-2-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-sysinfo-l1-2-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-sysinfo-l1-2-3.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-sysinfo-l1-2-4.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-sysinfo-l1-2-6.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-util-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-error-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-error-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-registration-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-robuffer-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-roparameterizediid-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-string-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-winrt-string-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-core-wow64-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-devices-query-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-devices-query-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-dx-d3dkmt-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-deviceinformation-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-expandedresources-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-tcui-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-tcui-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-tcui-l1-1-2.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-tcui-l1-1-3.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-gaming-tcui-l1-1-4.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-mm-misc-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-net-isolation-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-security-base-l1-2-2.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-security-isolatedcontainer-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-security-isolatedcontainer-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-service-core-l1-1-3.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-service-core-l1-1-4.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-service-core-l1-1-5.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-shcore-scaling-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-shcore-scaling-l1-1-1.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-shcore-scaling-l1-1-2.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-shcore-stream-winrt-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_api-ms-win-wsl-api-l1-1-0.py +1 -0
- angr/procedures/definitions/win32_apphelp.py +1 -0
- angr/procedures/definitions/win32_authz.py +1 -0
- angr/procedures/definitions/win32_avicap32.py +1 -0
- angr/procedures/definitions/win32_avifil32.py +1 -0
- angr/procedures/definitions/win32_avrt.py +1 -0
- angr/procedures/definitions/win32_bcp47mrm.py +1 -0
- angr/procedures/definitions/win32_bcrypt.py +1 -0
- angr/procedures/definitions/win32_bcryptprimitives.py +1 -0
- angr/procedures/definitions/win32_bluetoothapis.py +1 -0
- angr/procedures/definitions/win32_bthprops.py +1 -0
- angr/procedures/definitions/win32_bthprops_cpl.py +1 -0
- angr/procedures/definitions/win32_cabinet.py +1 -0
- angr/procedures/definitions/win32_certadm.py +1 -0
- angr/procedures/definitions/win32_certpoleng.py +1 -0
- angr/procedures/definitions/win32_cfgmgr32.py +1 -0
- angr/procedures/definitions/win32_chakra.py +1 -0
- angr/procedures/definitions/win32_cldapi.py +1 -0
- angr/procedures/definitions/win32_clfsw32.py +1 -0
- angr/procedures/definitions/win32_clusapi.py +1 -0
- angr/procedures/definitions/win32_comctl32.py +1 -0
- angr/procedures/definitions/win32_comdlg32.py +1 -0
- angr/procedures/definitions/win32_compstui.py +1 -0
- angr/procedures/definitions/win32_computecore.py +1 -0
- angr/procedures/definitions/win32_computenetwork.py +1 -0
- angr/procedures/definitions/win32_computestorage.py +1 -0
- angr/procedures/definitions/win32_comsvcs.py +1 -0
- angr/procedures/definitions/win32_coremessaging.py +1 -0
- angr/procedures/definitions/win32_credui.py +1 -0
- angr/procedures/definitions/win32_crypt32.py +1 -0
- angr/procedures/definitions/win32_cryptnet.py +1 -0
- angr/procedures/definitions/win32_cryptui.py +1 -0
- angr/procedures/definitions/win32_cryptxml.py +1 -0
- angr/procedures/definitions/win32_cscapi.py +1 -0
- angr/procedures/definitions/win32_d2d1.py +1 -0
- angr/procedures/definitions/win32_d3d10.py +1 -0
- angr/procedures/definitions/win32_d3d10_1.py +1 -0
- angr/procedures/definitions/win32_d3d11.py +1 -0
- angr/procedures/definitions/win32_d3d12.py +1 -0
- angr/procedures/definitions/win32_d3d9.py +1 -0
- angr/procedures/definitions/win32_d3dcompiler_47.py +1 -0
- angr/procedures/definitions/win32_d3dcsx.py +1 -0
- angr/procedures/definitions/win32_davclnt.py +1 -0
- angr/procedures/definitions/win32_dbgeng.py +1 -0
- angr/procedures/definitions/win32_dbghelp.py +1 -0
- angr/procedures/definitions/win32_dbgmodel.py +1 -0
- angr/procedures/definitions/win32_dciman32.py +1 -0
- angr/procedures/definitions/win32_dcomp.py +1 -0
- angr/procedures/definitions/win32_ddraw.py +1 -0
- angr/procedures/definitions/win32_deviceaccess.py +1 -0
- angr/procedures/definitions/win32_dflayout.py +1 -0
- angr/procedures/definitions/win32_dhcpcsvc.py +1 -0
- angr/procedures/definitions/win32_dhcpcsvc6.py +1 -0
- angr/procedures/definitions/win32_dhcpsapi.py +1 -0
- angr/procedures/definitions/win32_diagnosticdataquery.py +1 -0
- angr/procedures/definitions/win32_dinput8.py +1 -0
- angr/procedures/definitions/win32_directml.py +1 -0
- angr/procedures/definitions/win32_dmprocessxmlfiltered.py +1 -0
- angr/procedures/definitions/win32_dnsapi.py +1 -0
- angr/procedures/definitions/win32_drt.py +1 -0
- angr/procedures/definitions/win32_drtprov.py +1 -0
- angr/procedures/definitions/win32_drttransport.py +1 -0
- angr/procedures/definitions/win32_dsound.py +1 -0
- angr/procedures/definitions/win32_dsparse.py +1 -0
- angr/procedures/definitions/win32_dsprop.py +1 -0
- angr/procedures/definitions/win32_dssec.py +1 -0
- angr/procedures/definitions/win32_dsuiext.py +1 -0
- angr/procedures/definitions/win32_dwmapi.py +1 -0
- angr/procedures/definitions/win32_dwrite.py +1 -0
- angr/procedures/definitions/win32_dxcompiler.py +1 -0
- angr/procedures/definitions/win32_dxcore.py +1 -0
- angr/procedures/definitions/win32_dxgi.py +1 -0
- angr/procedures/definitions/win32_dxva2.py +1 -0
- angr/procedures/definitions/win32_eappcfg.py +1 -0
- angr/procedures/definitions/win32_eappprxy.py +1 -0
- angr/procedures/definitions/win32_efswrt.py +1 -0
- angr/procedures/definitions/win32_elscore.py +1 -0
- angr/procedures/definitions/win32_esent.py +1 -0
- angr/procedures/definitions/win32_evr.py +1 -0
- angr/procedures/definitions/win32_faultrep.py +1 -0
- angr/procedures/definitions/win32_fhsvcctl.py +1 -0
- angr/procedures/definitions/win32_firewallapi.py +1 -0
- angr/procedures/definitions/win32_fltlib.py +1 -0
- angr/procedures/definitions/win32_fontsub.py +1 -0
- angr/procedures/definitions/win32_forceinline.py +1 -0
- angr/procedures/definitions/win32_fwpuclnt.py +1 -0
- angr/procedures/definitions/win32_fxsutility.py +1 -0
- angr/procedures/definitions/win32_gdi32.py +1 -0
- angr/procedures/definitions/win32_gdiplus.py +1 -0
- angr/procedures/definitions/win32_glu32.py +1 -0
- angr/procedures/definitions/win32_gpedit.py +1 -0
- angr/procedures/definitions/win32_hhctrl_ocx.py +1 -0
- angr/procedures/definitions/win32_hid.py +1 -0
- angr/procedures/definitions/win32_hlink.py +1 -0
- angr/procedures/definitions/win32_hrtfapo.py +1 -0
- angr/procedures/definitions/win32_httpapi.py +1 -0
- angr/procedures/definitions/win32_icm32.py +1 -0
- angr/procedures/definitions/win32_icmui.py +1 -0
- angr/procedures/definitions/win32_icu.py +1 -0
- angr/procedures/definitions/win32_ieframe.py +1 -0
- angr/procedures/definitions/win32_imagehlp.py +1 -0
- angr/procedures/definitions/win32_imgutil.py +1 -0
- angr/procedures/definitions/win32_imm32.py +1 -0
- angr/procedures/definitions/win32_infocardapi.py +1 -0
- angr/procedures/definitions/win32_inkobjcore.py +1 -0
- angr/procedures/definitions/win32_iphlpapi.py +1 -0
- angr/procedures/definitions/win32_iscsidsc.py +1 -0
- angr/procedures/definitions/win32_isolatedwindowsenvironmentutils.py +1 -0
- angr/procedures/definitions/win32_kernel32.py +1 -0
- angr/procedures/definitions/win32_kernelbase.py +1 -0
- angr/procedures/definitions/win32_keycredmgr.py +1 -0
- angr/procedures/definitions/win32_ksproxy_ax.py +1 -0
- angr/procedures/definitions/win32_ksuser.py +1 -0
- angr/procedures/definitions/win32_ktmw32.py +1 -0
- angr/procedures/definitions/win32_licenseprotection.py +1 -0
- angr/procedures/definitions/win32_loadperf.py +1 -0
- angr/procedures/definitions/win32_magnification.py +1 -0
- angr/procedures/definitions/win32_mapi32.py +1 -0
- angr/procedures/definitions/win32_mdmlocalmanagement.py +1 -0
- angr/procedures/definitions/win32_mdmregistration.py +1 -0
- angr/procedures/definitions/win32_mf.py +1 -0
- angr/procedures/definitions/win32_mfcore.py +1 -0
- angr/procedures/definitions/win32_mfplat.py +1 -0
- angr/procedures/definitions/win32_mfplay.py +1 -0
- angr/procedures/definitions/win32_mfreadwrite.py +1 -0
- angr/procedures/definitions/win32_mfsensorgroup.py +1 -0
- angr/procedures/definitions/win32_mfsrcsnk.py +1 -0
- angr/procedures/definitions/win32_mgmtapi.py +1 -0
- angr/procedures/definitions/win32_mi.py +1 -0
- angr/procedures/definitions/win32_mmdevapi.py +1 -0
- angr/procedures/definitions/win32_mpr.py +1 -0
- angr/procedures/definitions/win32_mprapi.py +1 -0
- angr/procedures/definitions/win32_mqrt.py +1 -0
- angr/procedures/definitions/win32_mrmsupport.py +1 -0
- angr/procedures/definitions/win32_msacm32.py +1 -0
- angr/procedures/definitions/win32_msajapi.py +1 -0
- angr/procedures/definitions/win32_mscms.py +1 -0
- angr/procedures/definitions/win32_mscoree.py +1 -0
- angr/procedures/definitions/win32_msctfmonitor.py +1 -0
- angr/procedures/definitions/win32_msdelta.py +1 -0
- angr/procedures/definitions/win32_msdmo.py +1 -0
- angr/procedures/definitions/win32_msdrm.py +1 -0
- angr/procedures/definitions/win32_msi.py +1 -0
- angr/procedures/definitions/win32_msimg32.py +1 -0
- angr/procedures/definitions/win32_mspatcha.py +1 -0
- angr/procedures/definitions/win32_mspatchc.py +1 -0
- angr/procedures/definitions/win32_msports.py +1 -0
- angr/procedures/definitions/win32_msrating.py +1 -0
- angr/procedures/definitions/win32_mssign32.py +1 -0
- angr/procedures/definitions/win32_mstask.py +1 -0
- angr/procedures/definitions/win32_msvfw32.py +1 -0
- angr/procedures/definitions/win32_mswsock.py +1 -0
- angr/procedures/definitions/win32_mtxdm.py +1 -0
- angr/procedures/definitions/win32_ncrypt.py +1 -0
- angr/procedures/definitions/win32_ndfapi.py +1 -0
- angr/procedures/definitions/win32_netapi32.py +1 -0
- angr/procedures/definitions/win32_netsh.py +1 -0
- angr/procedures/definitions/win32_netshell.py +1 -0
- angr/procedures/definitions/win32_newdev.py +1 -0
- angr/procedures/definitions/win32_ninput.py +1 -0
- angr/procedures/definitions/win32_normaliz.py +1 -0
- angr/procedures/definitions/win32_ntdll.py +1 -0
- angr/procedures/definitions/win32_ntdllk.py +1 -0
- angr/procedures/definitions/win32_ntdsapi.py +1 -0
- angr/procedures/definitions/win32_ntlanman.py +1 -0
- angr/procedures/definitions/win32_odbc32.py +1 -0
- angr/procedures/definitions/win32_odbcbcp.py +1 -0
- angr/procedures/definitions/win32_ole32.py +1 -0
- angr/procedures/definitions/win32_oleacc.py +1 -0
- angr/procedures/definitions/win32_oleaut32.py +1 -0
- angr/procedures/definitions/win32_oledlg.py +1 -0
- angr/procedures/definitions/win32_ondemandconnroutehelper.py +1 -0
- angr/procedures/definitions/win32_opengl32.py +1 -0
- angr/procedures/definitions/win32_opmxbox.py +1 -0
- angr/procedures/definitions/win32_p2p.py +1 -0
- angr/procedures/definitions/win32_p2pgraph.py +1 -0
- angr/procedures/definitions/win32_pdh.py +1 -0
- angr/procedures/definitions/win32_peerdist.py +1 -0
- angr/procedures/definitions/win32_powrprof.py +1 -0
- angr/procedures/definitions/win32_prntvpt.py +1 -0
- angr/procedures/definitions/win32_projectedfslib.py +1 -0
- angr/procedures/definitions/win32_propsys.py +1 -0
- angr/procedures/definitions/win32_psapi.py +1 -0
- angr/procedures/definitions/win32_quartz.py +1 -0
- angr/procedures/definitions/win32_query.py +1 -0
- angr/procedures/definitions/win32_qwave.py +1 -0
- angr/procedures/definitions/win32_rasapi32.py +1 -0
- angr/procedures/definitions/win32_rasdlg.py +1 -0
- angr/procedures/definitions/win32_resutils.py +1 -0
- angr/procedures/definitions/win32_rometadata.py +1 -0
- angr/procedures/definitions/win32_rpcns4.py +1 -0
- angr/procedures/definitions/win32_rpcproxy.py +1 -0
- angr/procedures/definitions/win32_rpcrt4.py +1 -0
- angr/procedures/definitions/win32_rstrtmgr.py +1 -0
- angr/procedures/definitions/win32_rtm.py +1 -0
- angr/procedures/definitions/win32_rtutils.py +1 -0
- angr/procedures/definitions/win32_rtworkq.py +1 -0
- angr/procedures/definitions/win32_sas.py +1 -0
- angr/procedures/definitions/win32_scarddlg.py +1 -0
- angr/procedures/definitions/win32_schannel.py +1 -0
- angr/procedures/definitions/win32_sechost.py +1 -0
- angr/procedures/definitions/win32_secur32.py +1 -0
- angr/procedures/definitions/win32_sensapi.py +1 -0
- angr/procedures/definitions/win32_sensorsutilsv2.py +1 -0
- angr/procedures/definitions/win32_setupapi.py +1 -0
- angr/procedures/definitions/win32_sfc.py +1 -0
- angr/procedures/definitions/win32_shdocvw.py +1 -0
- angr/procedures/definitions/win32_shell32.py +1 -0
- angr/procedures/definitions/win32_shlwapi.py +1 -0
- angr/procedures/definitions/win32_slc.py +1 -0
- angr/procedures/definitions/win32_slcext.py +1 -0
- angr/procedures/definitions/win32_slwga.py +1 -0
- angr/procedures/definitions/win32_snmpapi.py +1 -0
- angr/procedures/definitions/win32_spoolss.py +1 -0
- angr/procedures/definitions/win32_srclient.py +1 -0
- angr/procedures/definitions/win32_srpapi.py +1 -0
- angr/procedures/definitions/win32_sspicli.py +1 -0
- angr/procedures/definitions/win32_sti.py +1 -0
- angr/procedures/definitions/win32_t2embed.py +1 -0
- angr/procedures/definitions/win32_tapi32.py +1 -0
- angr/procedures/definitions/win32_tbs.py +1 -0
- angr/procedures/definitions/win32_tdh.py +1 -0
- angr/procedures/definitions/win32_tokenbinding.py +1 -0
- angr/procedures/definitions/win32_traffic.py +1 -0
- angr/procedures/definitions/win32_txfw32.py +1 -0
- angr/procedures/definitions/win32_ualapi.py +1 -0
- angr/procedures/definitions/win32_uiautomationcore.py +1 -0
- angr/procedures/definitions/win32_urlmon.py +1 -0
- angr/procedures/definitions/win32_user32.py +1 -0
- angr/procedures/definitions/win32_userenv.py +1 -0
- angr/procedures/definitions/win32_usp10.py +1 -0
- angr/procedures/definitions/win32_uxtheme.py +1 -0
- angr/procedures/definitions/win32_verifier.py +1 -0
- angr/procedures/definitions/win32_version.py +1 -0
- angr/procedures/definitions/win32_vertdll.py +1 -0
- angr/procedures/definitions/win32_virtdisk.py +1 -0
- angr/procedures/definitions/win32_vmdevicehost.py +1 -0
- angr/procedures/definitions/win32_vmsavedstatedumpprovider.py +1 -0
- angr/procedures/definitions/win32_vssapi.py +1 -0
- angr/procedures/definitions/win32_wcmapi.py +1 -0
- angr/procedures/definitions/win32_wdsbp.py +1 -0
- angr/procedures/definitions/win32_wdsclientapi.py +1 -0
- angr/procedures/definitions/win32_wdsmc.py +1 -0
- angr/procedures/definitions/win32_wdspxe.py +1 -0
- angr/procedures/definitions/win32_wdstptc.py +1 -0
- angr/procedures/definitions/win32_webauthn.py +1 -0
- angr/procedures/definitions/win32_webservices.py +1 -0
- angr/procedures/definitions/win32_websocket.py +1 -0
- angr/procedures/definitions/win32_wecapi.py +1 -0
- angr/procedures/definitions/win32_wer.py +1 -0
- angr/procedures/definitions/win32_wevtapi.py +1 -0
- angr/procedures/definitions/win32_winbio.py +1 -0
- angr/procedures/definitions/win32_windows_ai_machinelearning.py +1 -0
- angr/procedures/definitions/win32_windows_data_pdf.py +1 -0
- angr/procedures/definitions/win32_windows_media_mediacontrol.py +1 -0
- angr/procedures/definitions/win32_windows_networking.py +1 -0
- angr/procedures/definitions/win32_windows_ui_xaml.py +1 -0
- angr/procedures/definitions/win32_windowscodecs.py +1 -0
- angr/procedures/definitions/win32_winfax.py +1 -0
- angr/procedures/definitions/win32_winhttp.py +1 -0
- angr/procedures/definitions/win32_winhvemulation.py +1 -0
- angr/procedures/definitions/win32_winhvplatform.py +1 -0
- angr/procedures/definitions/win32_wininet.py +1 -0
- angr/procedures/definitions/win32_winml.py +1 -0
- angr/procedures/definitions/win32_winmm.py +1 -0
- angr/procedures/definitions/win32_winscard.py +1 -0
- angr/procedures/definitions/win32_winspool.py +1 -0
- angr/procedures/definitions/win32_winspool_drv.py +1 -0
- angr/procedures/definitions/win32_wintrust.py +1 -0
- angr/procedures/definitions/win32_winusb.py +1 -0
- angr/procedures/definitions/win32_wlanapi.py +1 -0
- angr/procedures/definitions/win32_wlanui.py +1 -0
- angr/procedures/definitions/win32_wldap32.py +1 -0
- angr/procedures/definitions/win32_wldp.py +1 -0
- angr/procedures/definitions/win32_wmvcore.py +1 -0
- angr/procedures/definitions/win32_wnvapi.py +1 -0
- angr/procedures/definitions/win32_wofutil.py +1 -0
- angr/procedures/definitions/win32_ws2_32.py +1 -0
- angr/procedures/definitions/win32_wscapi.py +1 -0
- angr/procedures/definitions/win32_wsclient.py +1 -0
- angr/procedures/definitions/win32_wsdapi.py +1 -0
- angr/procedures/definitions/win32_wsmsvc.py +1 -0
- angr/procedures/definitions/win32_wsnmp32.py +1 -0
- angr/procedures/definitions/win32_wtsapi32.py +1 -0
- angr/procedures/definitions/win32_xaudio2_8.py +1 -0
- angr/procedures/definitions/win32_xinput1_4.py +1 -0
- angr/procedures/definitions/win32_xinputuap.py +1 -0
- angr/procedures/definitions/win32_xmllite.py +1 -0
- angr/procedures/definitions/win32_xolehlp.py +1 -0
- angr/procedures/definitions/win32_xpsprint.py +1 -0
- angr/procedures/glibc/__ctype_b_loc.py +2 -3
- angr/procedures/glibc/__ctype_tolower_loc.py +2 -3
- angr/procedures/glibc/__ctype_toupper_loc.py +2 -3
- angr/procedures/glibc/__errno_location.py +1 -0
- angr/procedures/glibc/__libc_init.py +1 -0
- angr/procedures/glibc/__libc_start_main.py +2 -3
- angr/procedures/glibc/dynamic_loading.py +1 -0
- angr/procedures/glibc/scanf.py +1 -0
- angr/procedures/glibc/sscanf.py +1 -0
- angr/procedures/gnulib/xalloc_die.py +1 -0
- angr/procedures/gnulib/xstrtol_fatal.py +1 -0
- angr/procedures/java/__init__.py +1 -0
- angr/procedures/java/unconstrained.py +4 -3
- angr/procedures/java_io/read.py +1 -0
- angr/procedures/java_io/write.py +1 -0
- angr/procedures/java_jni/__init__.py +25 -18
- angr/procedures/java_jni/array_operations.py +1 -0
- angr/procedures/java_jni/class_and_interface_operations.py +3 -3
- angr/procedures/java_jni/field_access.py +3 -6
- angr/procedures/java_jni/global_and_local_refs.py +1 -0
- angr/procedures/java_jni/method_calls.py +3 -2
- angr/procedures/java_jni/not_implemented.py +2 -1
- angr/procedures/java_jni/object_operations.py +3 -4
- angr/procedures/java_jni/string_operations.py +2 -1
- angr/procedures/java_jni/version_information.py +1 -0
- angr/procedures/java_lang/character.py +2 -3
- angr/procedures/java_lang/double.py +2 -2
- angr/procedures/java_lang/exit.py +1 -0
- angr/procedures/java_lang/getsimplename.py +2 -2
- angr/procedures/java_lang/integer.py +1 -0
- angr/procedures/java_lang/load_library.py +1 -0
- angr/procedures/java_lang/math.py +1 -0
- angr/procedures/java_lang/string.py +3 -3
- angr/procedures/java_lang/stringbuilder.py +1 -0
- angr/procedures/java_lang/system.py +1 -0
- angr/procedures/java_util/collection.py +1 -0
- angr/procedures/java_util/iterator.py +1 -0
- angr/procedures/java_util/list.py +1 -0
- angr/procedures/java_util/map.py +3 -4
- angr/procedures/java_util/random.py +1 -0
- angr/procedures/java_util/scanner_nextline.py +2 -1
- angr/procedures/libc/abort.py +1 -0
- angr/procedures/libc/access.py +1 -0
- angr/procedures/libc/atoi.py +2 -2
- angr/procedures/libc/atol.py +1 -0
- angr/procedures/libc/calloc.py +1 -0
- angr/procedures/libc/closelog.py +1 -0
- angr/procedures/libc/err.py +1 -0
- angr/procedures/libc/error.py +2 -3
- angr/procedures/libc/exit.py +1 -0
- angr/procedures/libc/fclose.py +2 -3
- angr/procedures/libc/feof.py +1 -0
- angr/procedures/libc/fflush.py +1 -0
- angr/procedures/libc/fgetc.py +1 -0
- angr/procedures/libc/fgets.py +19 -19
- angr/procedures/libc/fopen.py +6 -8
- angr/procedures/libc/fprintf.py +1 -0
- angr/procedures/libc/fputc.py +1 -0
- angr/procedures/libc/fputs.py +1 -0
- angr/procedures/libc/fread.py +1 -0
- angr/procedures/libc/free.py +1 -0
- angr/procedures/libc/fscanf.py +2 -2
- angr/procedures/libc/fseek.py +3 -2
- angr/procedures/libc/ftell.py +1 -0
- angr/procedures/libc/fwrite.py +1 -0
- angr/procedures/libc/getchar.py +2 -2
- angr/procedures/libc/getdelim.py +25 -25
- angr/procedures/libc/getegid.py +1 -0
- angr/procedures/libc/geteuid.py +1 -0
- angr/procedures/libc/getgid.py +1 -0
- angr/procedures/libc/gets.py +18 -18
- angr/procedures/libc/getuid.py +1 -0
- angr/procedures/libc/malloc.py +1 -0
- angr/procedures/libc/memcmp.py +3 -6
- angr/procedures/libc/memcpy.py +1 -0
- angr/procedures/libc/memset.py +1 -0
- angr/procedures/libc/openlog.py +1 -0
- angr/procedures/libc/perror.py +1 -0
- angr/procedures/libc/printf.py +1 -0
- angr/procedures/libc/putchar.py +1 -0
- angr/procedures/libc/puts.py +1 -0
- angr/procedures/libc/rand.py +1 -0
- angr/procedures/libc/realloc.py +1 -0
- angr/procedures/libc/rewind.py +2 -1
- angr/procedures/libc/scanf.py +2 -2
- angr/procedures/libc/setbuf.py +1 -0
- angr/procedures/libc/setvbuf.py +1 -0
- angr/procedures/libc/snprintf.py +1 -0
- angr/procedures/libc/sprintf.py +1 -0
- angr/procedures/libc/srand.py +1 -0
- angr/procedures/libc/sscanf.py +2 -2
- angr/procedures/libc/stpcpy.py +2 -2
- angr/procedures/libc/strcat.py +1 -0
- angr/procedures/libc/strchr.py +1 -0
- angr/procedures/libc/strcmp.py +1 -0
- angr/procedures/libc/strcpy.py +2 -2
- angr/procedures/libc/strlen.py +35 -31
- angr/procedures/libc/strncat.py +1 -0
- angr/procedures/libc/strncmp.py +9 -11
- angr/procedures/libc/strncpy.py +1 -0
- angr/procedures/libc/strnlen.py +2 -2
- angr/procedures/libc/strstr.py +8 -4
- angr/procedures/libc/strtol.py +9 -9
- angr/procedures/libc/strtoul.py +2 -2
- angr/procedures/libc/system.py +1 -0
- angr/procedures/libc/time.py +2 -2
- angr/procedures/libc/tmpnam.py +1 -0
- angr/procedures/libc/tolower.py +1 -0
- angr/procedures/libc/toupper.py +1 -0
- angr/procedures/libc/ungetc.py +1 -0
- angr/procedures/libc/vsnprintf.py +1 -0
- angr/procedures/libc/wchar.py +1 -0
- angr/procedures/libstdcpp/_unwind_resume.py +1 -0
- angr/procedures/libstdcpp/std____throw_bad_alloc.py +1 -0
- angr/procedures/libstdcpp/std____throw_bad_cast.py +1 -0
- angr/procedures/libstdcpp/std____throw_length_error.py +1 -0
- angr/procedures/libstdcpp/std____throw_logic_error.py +1 -0
- angr/procedures/libstdcpp/std__terminate.py +1 -0
- angr/procedures/linux_kernel/access.py +1 -0
- angr/procedures/linux_kernel/arch_prctl.py +1 -0
- angr/procedures/linux_kernel/arm_user_helpers.py +1 -0
- angr/procedures/linux_kernel/brk.py +1 -0
- angr/procedures/linux_kernel/cwd.py +1 -0
- angr/procedures/linux_kernel/fstat.py +2 -1
- angr/procedures/linux_kernel/fstat64.py +2 -1
- angr/procedures/linux_kernel/futex.py +3 -3
- angr/procedures/linux_kernel/getegid.py +1 -0
- angr/procedures/linux_kernel/geteuid.py +1 -0
- angr/procedures/linux_kernel/getgid.py +1 -0
- angr/procedures/linux_kernel/getpid.py +1 -0
- angr/procedures/linux_kernel/getrlimit.py +3 -3
- angr/procedures/linux_kernel/gettid.py +1 -0
- angr/procedures/linux_kernel/getuid.py +1 -0
- angr/procedures/linux_kernel/iovec.py +1 -0
- angr/procedures/linux_kernel/lseek.py +1 -0
- angr/procedures/linux_kernel/mmap.py +1 -0
- angr/procedures/linux_kernel/mprotect.py +7 -6
- angr/procedures/linux_kernel/munmap.py +1 -0
- angr/procedures/linux_kernel/openat.py +3 -5
- angr/procedures/linux_kernel/set_tid_address.py +1 -0
- angr/procedures/linux_kernel/sigaction.py +1 -0
- angr/procedures/linux_kernel/sigprocmask.py +1 -0
- angr/procedures/linux_kernel/stat.py +3 -2
- angr/procedures/linux_kernel/sysinfo.py +1 -0
- angr/procedures/linux_kernel/tgkill.py +1 -0
- angr/procedures/linux_kernel/time.py +2 -1
- angr/procedures/linux_kernel/uid.py +1 -0
- angr/procedures/linux_kernel/uname.py +1 -0
- angr/procedures/linux_kernel/unlink.py +2 -2
- angr/procedures/linux_kernel/vsyscall.py +2 -1
- angr/procedures/linux_loader/_dl_initial_error_catch_tsd.py +1 -0
- angr/procedures/linux_loader/_dl_rtld_lock.py +1 -0
- angr/procedures/linux_loader/sim_loader.py +1 -0
- angr/procedures/linux_loader/tls.py +2 -2
- angr/procedures/msvcr/__getmainargs.py +1 -0
- angr/procedures/msvcr/_initterm.py +1 -0
- angr/procedures/msvcr/fmode.py +1 -0
- angr/procedures/ntdll/exceptions.py +4 -3
- angr/procedures/posix/accept.py +2 -2
- angr/procedures/posix/bind.py +1 -0
- angr/procedures/posix/bzero.py +1 -0
- angr/procedures/posix/chroot.py +1 -0
- angr/procedures/posix/close.py +2 -2
- angr/procedures/posix/closedir.py +1 -0
- angr/procedures/posix/dup.py +4 -3
- angr/procedures/posix/fcntl.py +1 -0
- angr/procedures/posix/fdopen.py +16 -19
- angr/procedures/posix/fileno.py +1 -0
- angr/procedures/posix/fork.py +1 -0
- angr/procedures/posix/getenv.py +1 -0
- angr/procedures/posix/gethostbyname.py +1 -0
- angr/procedures/posix/getpass.py +1 -0
- angr/procedures/posix/getsockopt.py +1 -0
- angr/procedures/posix/htonl.py +2 -2
- angr/procedures/posix/htons.py +2 -2
- angr/procedures/posix/inet_ntoa.py +3 -5
- angr/procedures/posix/listen.py +1 -0
- angr/procedures/posix/mmap.py +2 -1
- angr/procedures/posix/open.py +1 -0
- angr/procedures/posix/opendir.py +1 -0
- angr/procedures/posix/poll.py +3 -3
- angr/procedures/posix/pread64.py +1 -0
- angr/procedures/posix/pthread.py +3 -3
- angr/procedures/posix/pwrite64.py +1 -0
- angr/procedures/posix/read.py +1 -0
- angr/procedures/posix/readdir.py +1 -1
- angr/procedures/posix/recv.py +1 -0
- angr/procedures/posix/recvfrom.py +1 -0
- angr/procedures/posix/select.py +7 -7
- angr/procedures/posix/send.py +2 -2
- angr/procedures/posix/setsockopt.py +1 -0
- angr/procedures/posix/sigaction.py +1 -0
- angr/procedures/posix/sim_time.py +1 -0
- angr/procedures/posix/sleep.py +1 -0
- angr/procedures/posix/socket.py +2 -2
- angr/procedures/posix/strcasecmp.py +1 -0
- angr/procedures/posix/strdup.py +1 -0
- angr/procedures/posix/strtok_r.py +32 -36
- angr/procedures/posix/syslog.py +1 -0
- angr/procedures/posix/tz.py +1 -0
- angr/procedures/posix/unlink.py +1 -0
- angr/procedures/posix/usleep.py +1 -0
- angr/procedures/posix/write.py +1 -0
- angr/procedures/procedure_dict.py +1 -0
- angr/procedures/stubs/CallReturn.py +1 -0
- angr/procedures/stubs/NoReturnUnconstrained.py +1 -0
- angr/procedures/stubs/Nop.py +1 -0
- angr/procedures/stubs/PathTerminator.py +1 -0
- angr/procedures/stubs/Redirect.py +3 -2
- angr/procedures/stubs/ReturnChar.py +1 -0
- angr/procedures/stubs/ReturnUnconstrained.py +2 -1
- angr/procedures/stubs/UnresolvableCallTarget.py +1 -0
- angr/procedures/stubs/UnresolvableJumpTarget.py +1 -0
- angr/procedures/stubs/UserHook.py +2 -1
- angr/procedures/stubs/b64_decode.py +1 -0
- angr/procedures/stubs/caller.py +1 -0
- angr/procedures/stubs/crazy_scanf.py +1 -0
- angr/procedures/stubs/format_parser.py +12 -16
- angr/procedures/stubs/syscall_stub.py +6 -7
- angr/procedures/testing/manyargs.py +1 -0
- angr/procedures/testing/retreg.py +2 -2
- angr/procedures/tracer/random.py +1 -0
- angr/procedures/tracer/receive.py +4 -4
- angr/procedures/tracer/transmit.py +4 -4
- angr/procedures/uclibc/__uClibc_main.py +1 -0
- angr/procedures/win32/EncodePointer.py +1 -0
- angr/procedures/win32/ExitProcess.py +1 -0
- angr/procedures/win32/GetCommandLine.py +1 -0
- angr/procedures/win32/GetCurrentProcessId.py +1 -0
- angr/procedures/win32/GetCurrentThreadId.py +1 -0
- angr/procedures/win32/GetLastInputInfo.py +1 -0
- angr/procedures/win32/GetModuleHandle.py +3 -4
- angr/procedures/win32/GetProcessAffinityMask.py +1 -0
- angr/procedures/win32/InterlockedExchange.py +2 -1
- angr/procedures/win32/IsProcessorFeaturePresent.py +1 -0
- angr/procedures/win32/VirtualAlloc.py +2 -1
- angr/procedures/win32/VirtualProtect.py +1 -0
- angr/procedures/win32/critical_section.py +1 -0
- angr/procedures/win32/dynamic_loading.py +2 -1
- angr/procedures/win32/file_handles.py +4 -4
- angr/procedures/win32/gethostbyname.py +2 -2
- angr/procedures/win32/heap.py +1 -0
- angr/procedures/win32/is_bad_ptr.py +1 -0
- angr/procedures/win32/local_storage.py +7 -6
- angr/procedures/win32/mutex.py +1 -0
- angr/procedures/win32/sim_time.py +7 -10
- angr/procedures/win32/system_paths.py +5 -4
- angr/procedures/win32_kernel/ExAllocatePool.py +1 -0
- angr/procedures/win32_kernel/ExFreePoolWithTag.py +1 -0
- angr/procedures/win_user32/chars.py +1 -0
- angr/procedures/win_user32/keyboard.py +1 -0
- angr/procedures/win_user32/messagebox.py +2 -4
- angr/project.py +15 -22
- angr/protos/__init__.py +1 -0
- angr/serializable.py +6 -3
- angr/sim_manager.py +18 -18
- angr/sim_options.py +5 -7
- angr/sim_procedure.py +16 -15
- angr/sim_state.py +61 -88
- angr/sim_state_options.py +9 -15
- angr/sim_type.py +135 -123
- angr/sim_variable.py +23 -38
- angr/simos/__init__.py +3 -1
- angr/simos/cgc.py +2 -1
- angr/simos/javavm.py +84 -95
- angr/simos/linux.py +54 -64
- angr/simos/simos.py +14 -23
- angr/simos/snimmuc_nxp.py +3 -6
- angr/simos/userland.py +6 -6
- angr/simos/windows.py +14 -11
- angr/slicer.py +13 -11
- angr/state_hierarchy.py +4 -4
- angr/state_plugins/__init__.py +1 -0
- angr/state_plugins/callstack.py +19 -18
- angr/state_plugins/cgc.py +5 -4
- angr/state_plugins/concrete.py +7 -8
- angr/state_plugins/debug_variables.py +15 -17
- angr/state_plugins/filesystem.py +13 -19
- angr/state_plugins/gdb.py +3 -2
- angr/state_plugins/globals.py +5 -1
- angr/state_plugins/heap/__init__.py +1 -0
- angr/state_plugins/heap/heap_base.py +1 -0
- angr/state_plugins/heap/heap_brk.py +9 -6
- angr/state_plugins/heap/heap_freelist.py +12 -9
- angr/state_plugins/heap/heap_libc.py +1 -0
- angr/state_plugins/heap/heap_ptmalloc.py +27 -36
- angr/state_plugins/heap/utils.py +1 -0
- angr/state_plugins/history.py +7 -10
- angr/state_plugins/inspect.py +1 -0
- angr/state_plugins/javavm_classloader.py +3 -2
- angr/state_plugins/jni_references.py +2 -1
- angr/state_plugins/libc.py +4 -4
- angr/state_plugins/light_registers.py +6 -8
- angr/state_plugins/log.py +1 -0
- angr/state_plugins/loop_data.py +1 -0
- angr/state_plugins/plugin.py +7 -8
- angr/state_plugins/posix.py +14 -22
- angr/state_plugins/preconstrainer.py +4 -3
- angr/state_plugins/scratch.py +6 -5
- angr/state_plugins/sim_action.py +15 -20
- angr/state_plugins/sim_action_object.py +205 -82
- angr/state_plugins/sim_event.py +1 -0
- angr/state_plugins/solver.py +65 -93
- angr/state_plugins/symbolizer.py +5 -6
- angr/state_plugins/trace_additions.py +32 -42
- angr/state_plugins/uc_manager.py +16 -9
- angr/state_plugins/unicorn_engine.py +21 -37
- angr/state_plugins/view.py +20 -19
- angr/storage/__init__.py +1 -0
- angr/storage/file.py +31 -33
- angr/storage/memory_mixins/__init__.py +12 -15
- angr/storage/memory_mixins/__init__.pyi +13 -14
- angr/storage/memory_mixins/actions_mixin.py +2 -1
- angr/storage/memory_mixins/address_concretization_mixin.py +11 -15
- angr/storage/memory_mixins/bvv_conversion_mixin.py +10 -11
- angr/storage/memory_mixins/clouseau_mixin.py +1 -0
- angr/storage/memory_mixins/conditional_store_mixin.py +1 -0
- angr/storage/memory_mixins/convenient_mappings_mixin.py +7 -8
- angr/storage/memory_mixins/default_filler_mixin.py +12 -14
- angr/storage/memory_mixins/dirty_addrs_mixin.py +1 -0
- angr/storage/memory_mixins/hex_dumper_mixin.py +6 -9
- angr/storage/memory_mixins/javavm_memory/__init__.py +1 -0
- angr/storage/memory_mixins/javavm_memory/javavm_memory_mixin.py +16 -23
- angr/storage/memory_mixins/keyvalue_memory/__init__.py +1 -0
- angr/storage/memory_mixins/keyvalue_memory/keyvalue_memory_mixin.py +2 -1
- angr/storage/memory_mixins/label_merger_mixin.py +2 -2
- angr/storage/memory_mixins/multi_value_merger_mixin.py +6 -5
- angr/storage/memory_mixins/name_resolution_mixin.py +12 -15
- angr/storage/memory_mixins/paged_memory/page_backer_mixins.py +6 -6
- angr/storage/memory_mixins/paged_memory/paged_memory_mixin.py +22 -36
- angr/storage/memory_mixins/paged_memory/paged_memory_multivalue_mixin.py +1 -0
- angr/storage/memory_mixins/paged_memory/pages/__init__.py +1 -2
- angr/storage/memory_mixins/paged_memory/pages/cooperation.py +4 -3
- angr/storage/memory_mixins/paged_memory/pages/history_tracking_mixin.py +4 -4
- angr/storage/memory_mixins/paged_memory/pages/ispo_mixin.py +1 -0
- angr/storage/memory_mixins/paged_memory/pages/list_page.py +12 -20
- angr/storage/memory_mixins/paged_memory/pages/multi_values.py +14 -19
- angr/storage/memory_mixins/paged_memory/pages/mv_list_page.py +26 -32
- angr/storage/memory_mixins/paged_memory/pages/permissions_mixin.py +1 -0
- angr/storage/memory_mixins/paged_memory/pages/refcount_mixin.py +2 -2
- angr/storage/memory_mixins/paged_memory/pages/ultra_page.py +38 -42
- angr/storage/memory_mixins/paged_memory/privileged_mixin.py +1 -0
- angr/storage/memory_mixins/paged_memory/stack_allocation_mixin.py +1 -0
- angr/storage/memory_mixins/regioned_memory/__init__.py +1 -0
- angr/storage/memory_mixins/regioned_memory/abstract_address_descriptor.py +5 -4
- angr/storage/memory_mixins/regioned_memory/abstract_merger_mixin.py +6 -21
- angr/storage/memory_mixins/regioned_memory/region_category_mixin.py +1 -0
- angr/storage/memory_mixins/regioned_memory/region_data.py +4 -5
- angr/storage/memory_mixins/regioned_memory/region_meta_mixin.py +129 -13
- angr/storage/memory_mixins/regioned_memory/regioned_address_concretization_mixin.py +2 -1
- angr/storage/memory_mixins/regioned_memory/regioned_memory_mixin.py +34 -44
- angr/storage/memory_mixins/regioned_memory/static_find_mixin.py +7 -9
- angr/storage/memory_mixins/simple_interface_mixin.py +8 -11
- angr/storage/memory_mixins/simplification_mixin.py +1 -0
- angr/storage/memory_mixins/size_resolution_mixin.py +5 -4
- angr/storage/memory_mixins/slotted_memory.py +3 -3
- angr/storage/memory_mixins/smart_find_mixin.py +3 -2
- angr/storage/memory_mixins/symbolic_merger_mixin.py +1 -0
- angr/storage/memory_mixins/top_merger_mixin.py +2 -2
- angr/storage/memory_mixins/underconstrained_mixin.py +12 -14
- angr/storage/memory_mixins/unwrapper_mixin.py +1 -0
- angr/storage/memory_object.py +35 -35
- angr/storage/pcap.py +3 -3
- angr/tablespecs.py +1 -0
- angr/utils/__init__.py +1 -0
- angr/utils/ail.py +30 -0
- angr/utils/algo.py +1 -0
- angr/utils/bits.py +12 -0
- angr/utils/constants.py +2 -0
- angr/utils/cowdict.py +3 -4
- angr/utils/dynamic_dictlist.py +4 -7
- angr/utils/endness.py +1 -0
- angr/utils/enums_conv.py +1 -0
- angr/utils/env.py +1 -0
- angr/utils/formatting.py +1 -0
- angr/utils/funcid.py +15 -14
- angr/utils/graph.py +52 -19
- angr/utils/lazy_import.py +1 -0
- angr/utils/library.py +10 -13
- angr/utils/loader.py +6 -6
- angr/utils/mp.py +4 -3
- angr/utils/orderedset.py +1 -0
- angr/utils/segment_list.py +7 -9
- angr/utils/ssa/__init__.py +198 -0
- angr/utils/ssa/tmp_uses_collector.py +23 -0
- angr/utils/ssa/vvar_uses_collector.py +37 -0
- angr/utils/timing.py +32 -20
- angr/utils/typing.py +1 -0
- angr/vaults.py +7 -8
- {angr-9.2.117.dist-info → angr-9.2.119.dist-info}/METADATA +9 -8
- angr-9.2.119.dist-info/RECORD +1345 -0
- {angr-9.2.117.dist-info → angr-9.2.119.dist-info}/WHEEL +1 -1
- angr/analyses/decompiler/optimization_passes/spilled_register_finder.py +0 -18
- angr/analyses/decompiler/seq_cf_structure_counter.py +0 -37
- angr/service.py +0 -35
- angr-9.2.117.dist-info/RECORD +0 -1310
- {angr-9.2.117.dist-info → angr-9.2.119.dist-info}/LICENSE +0 -0
- {angr-9.2.117.dist-info → angr-9.2.119.dist-info}/entry_points.txt +0 -0
- {angr-9.2.117.dist-info → angr-9.2.119.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# pylint:disable=missing-class-docstring,too-many-boolean-expressions,unused-argument,no-self-use
|
|
2
|
-
from
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
from typing import Any, TYPE_CHECKING
|
|
3
4
|
from collections.abc import Callable
|
|
4
5
|
from collections import defaultdict, Counter
|
|
5
6
|
import logging
|
|
@@ -30,6 +31,8 @@ from ....sim_type import (
|
|
|
30
31
|
SimTypeLength,
|
|
31
32
|
SimTypeReg,
|
|
32
33
|
dereference_simtype,
|
|
34
|
+
SimTypeInt128,
|
|
35
|
+
SimTypeInt256,
|
|
33
36
|
)
|
|
34
37
|
from ....knowledge_plugins.functions import Function
|
|
35
38
|
from ....sim_variable import SimVariable, SimTemporaryVariable, SimStackVariable, SimMemoryVariable
|
|
@@ -120,7 +123,7 @@ def qualifies_for_implicit_cast(ty1, ty2):
|
|
|
120
123
|
return ty1.size <= ty2.size
|
|
121
124
|
|
|
122
125
|
|
|
123
|
-
def extract_terms(expr:
|
|
126
|
+
def extract_terms(expr: CExpression) -> tuple[int, list[tuple[int, CExpression]]]:
|
|
124
127
|
# handle unnecessary type casts
|
|
125
128
|
if isinstance(expr, CTypeCast):
|
|
126
129
|
expr = MakeTypecastsImplicit.collapse(expr.dst_type, expr.expr)
|
|
@@ -137,37 +140,35 @@ def extract_terms(expr: "CExpression") -> tuple[int, list[tuple[int, "CExpressio
|
|
|
137
140
|
if isinstance(expr, CConstant):
|
|
138
141
|
return expr.value, []
|
|
139
142
|
# elif isinstance(expr, CUnaryOp) and expr.op == 'Minus'
|
|
140
|
-
|
|
143
|
+
if isinstance(expr, CBinaryOp) and expr.op == "Add":
|
|
141
144
|
c1, t1 = extract_terms(expr.lhs)
|
|
142
145
|
c2, t2 = extract_terms(expr.rhs)
|
|
143
146
|
return c1 + c2, t1 + t2
|
|
144
|
-
|
|
147
|
+
if isinstance(expr, CBinaryOp) and expr.op == "Sub":
|
|
145
148
|
c1, t1 = extract_terms(expr.lhs)
|
|
146
149
|
c2, t2 = extract_terms(expr.rhs)
|
|
147
150
|
return c1 - c2, t1 + [(-c, t) for c, t in t2]
|
|
148
|
-
|
|
151
|
+
if isinstance(expr, CBinaryOp) and expr.op == "Mul":
|
|
149
152
|
if isinstance(expr.lhs, CConstant):
|
|
150
153
|
c, t = extract_terms(expr.rhs)
|
|
151
154
|
return c * expr.lhs.value, [(c1 * expr.lhs.value, t1) for c1, t1 in t]
|
|
152
|
-
|
|
155
|
+
if isinstance(expr.rhs, CConstant):
|
|
153
156
|
c, t = extract_terms(expr.lhs)
|
|
154
157
|
return c * expr.rhs.value, [(c1 * expr.rhs.value, t1) for c1, t1 in t]
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
elif isinstance(expr, CBinaryOp) and expr.op == "Shl":
|
|
158
|
+
return 0, [(1, expr)]
|
|
159
|
+
if isinstance(expr, CBinaryOp) and expr.op == "Shl":
|
|
158
160
|
if isinstance(expr.rhs, CConstant):
|
|
159
161
|
c, t = extract_terms(expr.lhs)
|
|
160
162
|
return c << expr.rhs.value, [(c1 << expr.rhs.value, t1) for c1, t1 in t]
|
|
161
163
|
return 0, [(1, expr)]
|
|
162
|
-
|
|
163
|
-
return 0, [(1, expr)]
|
|
164
|
+
return 0, [(1, expr)]
|
|
164
165
|
|
|
165
166
|
|
|
166
|
-
def is_machine_word_size_type(type_: SimType, arch:
|
|
167
|
+
def is_machine_word_size_type(type_: SimType, arch: archinfo.Arch) -> bool:
|
|
167
168
|
return isinstance(type_, SimTypeReg) and type_.size == arch.bits
|
|
168
169
|
|
|
169
170
|
|
|
170
|
-
def guess_value_type(value: int, project:
|
|
171
|
+
def guess_value_type(value: int, project: angr.Project) -> SimType | None:
|
|
171
172
|
if project.kb.functions.contains_addr(value):
|
|
172
173
|
# might be a function pointer
|
|
173
174
|
return SimTypePointer(SimTypeBottom(label="void")).with_arch(project.arch)
|
|
@@ -260,7 +261,7 @@ class CConstruct:
|
|
|
260
261
|
__slots__ = ("codegen",)
|
|
261
262
|
|
|
262
263
|
def __init__(self, codegen):
|
|
263
|
-
self.codegen:
|
|
264
|
+
self.codegen: StructuredCodeGenerator = codegen
|
|
264
265
|
|
|
265
266
|
def c_repr(self, indent=0, pos_to_node=None, pos_to_addr=None, addr_to_pos=None):
|
|
266
267
|
"""
|
|
@@ -303,22 +304,24 @@ class CConstruct:
|
|
|
303
304
|
|
|
304
305
|
# add all variables, constants, and function calls to map_pos_to_node for highlighting
|
|
305
306
|
# add ops to pos_to_node but NOT ast_to_pos
|
|
306
|
-
if
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
307
|
+
if (
|
|
308
|
+
isinstance(
|
|
309
|
+
obj,
|
|
310
|
+
(
|
|
311
|
+
CVariable,
|
|
312
|
+
CConstant,
|
|
313
|
+
CStructField,
|
|
314
|
+
CIndexedVariable,
|
|
315
|
+
CVariableField,
|
|
316
|
+
CBinaryOp,
|
|
317
|
+
CUnaryOp,
|
|
318
|
+
CAssignment,
|
|
319
|
+
CFunctionCall,
|
|
320
|
+
),
|
|
321
|
+
)
|
|
322
|
+
and pos_to_node is not None
|
|
319
323
|
):
|
|
320
|
-
|
|
321
|
-
pos_to_node.add_mapping(pos, len(s), obj)
|
|
324
|
+
pos_to_node.add_mapping(pos, len(s), obj)
|
|
322
325
|
|
|
323
326
|
# add (), {}, [], and [20] to mapping for highlighting as well as the full functions name
|
|
324
327
|
elif isinstance(obj, (CClosingObject, CFunction, CArrayTypeLength, CStructFieldNameDef)):
|
|
@@ -369,7 +372,7 @@ class CConstruct:
|
|
|
369
372
|
return "".join(mapper(self.c_repr_chunks(indent)))
|
|
370
373
|
|
|
371
374
|
def c_repr_chunks(self, indent=0, asexpr=False):
|
|
372
|
-
raise NotImplementedError
|
|
375
|
+
raise NotImplementedError
|
|
373
376
|
|
|
374
377
|
@staticmethod
|
|
375
378
|
def indent_str(indent=0):
|
|
@@ -400,7 +403,7 @@ class CFunction(CConstruct): # pylint:disable=abstract-method
|
|
|
400
403
|
addr,
|
|
401
404
|
name,
|
|
402
405
|
functy: SimTypeFunction,
|
|
403
|
-
arg_list: list[
|
|
406
|
+
arg_list: list[CVariable],
|
|
404
407
|
statements,
|
|
405
408
|
variables_in_use,
|
|
406
409
|
variable_manager,
|
|
@@ -417,13 +420,13 @@ class CFunction(CConstruct): # pylint:disable=abstract-method
|
|
|
417
420
|
self.arg_list = arg_list
|
|
418
421
|
self.statements = statements
|
|
419
422
|
self.variables_in_use = variables_in_use
|
|
420
|
-
self.variable_manager:
|
|
423
|
+
self.variable_manager: VariableManagerInternal = variable_manager
|
|
421
424
|
self.demangled_name = demangled_name
|
|
422
425
|
self.unified_local_vars: dict[SimVariable, set[tuple[CVariable, SimType]]] = self.get_unified_local_vars()
|
|
423
426
|
self.show_demangled_name = show_demangled_name
|
|
424
427
|
self.omit_header = omit_header
|
|
425
428
|
|
|
426
|
-
def get_unified_local_vars(self) -> dict[SimVariable, set[tuple[
|
|
429
|
+
def get_unified_local_vars(self) -> dict[SimVariable, set[tuple[CVariable, SimType]]]:
|
|
427
430
|
unified_to_var_and_types: dict[SimVariable, set[tuple[CVariable, SimType]]] = defaultdict(set)
|
|
428
431
|
|
|
429
432
|
arg_set: set[SimVariable] = set()
|
|
@@ -559,10 +562,7 @@ class CFunction(CConstruct): # pylint:disable=abstract-method
|
|
|
559
562
|
|
|
560
563
|
if self.codegen.show_externs and self.codegen.cexterns:
|
|
561
564
|
for v in sorted(self.codegen.cexterns, key=lambda v: v.variable.name):
|
|
562
|
-
if v.type is None
|
|
563
|
-
varname = v.c_repr()
|
|
564
|
-
else:
|
|
565
|
-
varname = v.variable.name
|
|
565
|
+
varname = v.c_repr() if v.type is None else v.variable.name
|
|
566
566
|
yield "extern ", None
|
|
567
567
|
yield from type_to_c_repr_chunks(v.type, name=varname, name_type=v, full=False)
|
|
568
568
|
yield ";\n", None
|
|
@@ -659,7 +659,7 @@ class CExpression(CConstruct):
|
|
|
659
659
|
|
|
660
660
|
@property
|
|
661
661
|
def type(self):
|
|
662
|
-
raise NotImplementedError("Class
|
|
662
|
+
raise NotImplementedError(f"Class {type(self)} does not implement type().")
|
|
663
663
|
|
|
664
664
|
def set_type(self, v):
|
|
665
665
|
self._type = v
|
|
@@ -1229,7 +1229,7 @@ class CFunctionCall(CStatement, CExpression):
|
|
|
1229
1229
|
super().__init__(**kwargs)
|
|
1230
1230
|
|
|
1231
1231
|
self.callee_target = callee_target
|
|
1232
|
-
self.callee_func:
|
|
1232
|
+
self.callee_func: Function | None = callee_func
|
|
1233
1233
|
self.args = args if args is not None else []
|
|
1234
1234
|
self.returning = returning
|
|
1235
1235
|
self.ret_expr = ret_expr
|
|
@@ -1258,10 +1258,7 @@ class CFunctionCall(CStatement, CExpression):
|
|
|
1258
1258
|
def type(self):
|
|
1259
1259
|
if self.is_expr:
|
|
1260
1260
|
return self.prototype.returnty or SimTypeInt(signed=False).with_arch(self.codegen.project.arch)
|
|
1261
|
-
|
|
1262
|
-
raise AngrRuntimeError(
|
|
1263
|
-
"CFunctionCall.type should not be accessed if the function call is used as a statement."
|
|
1264
|
-
)
|
|
1261
|
+
raise AngrRuntimeError("CFunctionCall.type should not be accessed if the function call is used as a statement.")
|
|
1265
1262
|
|
|
1266
1263
|
def _is_target_ambiguous(self, func_name: str) -> bool:
|
|
1267
1264
|
"""
|
|
@@ -1409,7 +1406,6 @@ class CUnsupportedStatement(CStatement):
|
|
|
1409
1406
|
|
|
1410
1407
|
|
|
1411
1408
|
class CDirtyStatement(CExpression):
|
|
1412
|
-
|
|
1413
1409
|
__slots__ = ("dirty",)
|
|
1414
1410
|
|
|
1415
1411
|
def __init__(self, dirty, **kwargs):
|
|
@@ -1535,10 +1531,9 @@ class CVariable(CExpression):
|
|
|
1535
1531
|
|
|
1536
1532
|
if v.name:
|
|
1537
1533
|
return v.name
|
|
1538
|
-
|
|
1534
|
+
if isinstance(v, SimTemporaryVariable):
|
|
1539
1535
|
return "tmp_%d" % v.tmp_id
|
|
1540
|
-
|
|
1541
|
-
return str(v)
|
|
1536
|
+
return str(v)
|
|
1542
1537
|
|
|
1543
1538
|
def c_repr_chunks(self, indent=0, asexpr=False):
|
|
1544
1539
|
yield self.name, self
|
|
@@ -1559,11 +1554,8 @@ class CIndexedVariable(CExpression):
|
|
|
1559
1554
|
if self._type is None and self.variable.type is not None:
|
|
1560
1555
|
u = unpack_typeref(self.variable.type)
|
|
1561
1556
|
if isinstance(u, SimTypePointer):
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
u = u.pts_to.elem_type
|
|
1565
|
-
else:
|
|
1566
|
-
u = u.pts_to
|
|
1557
|
+
# special case: (&array)[x]
|
|
1558
|
+
u = u.pts_to.elem_type if isinstance(u.pts_to, (SimTypeArray, SimTypeFixedSizeArray)) else u.pts_to
|
|
1567
1559
|
u = unpack_typeref(u)
|
|
1568
1560
|
elif isinstance(u, (SimTypeArray, SimTypeFixedSizeArray)):
|
|
1569
1561
|
u = u.elem_type
|
|
@@ -1650,9 +1642,8 @@ class CUnaryOp(CExpression):
|
|
|
1650
1642
|
|
|
1651
1643
|
@property
|
|
1652
1644
|
def type(self):
|
|
1653
|
-
if self._type is None:
|
|
1654
|
-
|
|
1655
|
-
self._type = self.operand.type
|
|
1645
|
+
if self._type is None and self.operand is not None and hasattr(self.operand, "type"):
|
|
1646
|
+
self._type = self.operand.type
|
|
1656
1647
|
return self._type
|
|
1657
1648
|
|
|
1658
1649
|
def c_repr_chunks(self, indent=0, asexpr=False):
|
|
@@ -1673,7 +1664,7 @@ class CUnaryOp(CExpression):
|
|
|
1673
1664
|
if handler is not None:
|
|
1674
1665
|
yield from handler()
|
|
1675
1666
|
else:
|
|
1676
|
-
yield "UnaryOp
|
|
1667
|
+
yield f"UnaryOp {self.op}", self
|
|
1677
1668
|
|
|
1678
1669
|
#
|
|
1679
1670
|
# Handlers
|
|
@@ -1773,8 +1764,7 @@ class CBinaryOp(CExpression):
|
|
|
1773
1764
|
if lhs_signed == rhs_signed:
|
|
1774
1765
|
if lhs_ty.size > rhs_ty.size:
|
|
1775
1766
|
return lhs_ty
|
|
1776
|
-
|
|
1777
|
-
return rhs_ty
|
|
1767
|
+
return rhs_ty
|
|
1778
1768
|
|
|
1779
1769
|
if lhs_signed:
|
|
1780
1770
|
signed_ty = lhs_ty
|
|
@@ -1870,13 +1860,12 @@ class CBinaryOp(CExpression):
|
|
|
1870
1860
|
|
|
1871
1861
|
def _c_repr_chunks(self, op):
|
|
1872
1862
|
skip_op_and_rhs = False
|
|
1873
|
-
if self._cstyle_null_cmp:
|
|
1874
|
-
if self.
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
skip_op_and_rhs = True
|
|
1863
|
+
if self._cstyle_null_cmp and self._has_const_null_rhs():
|
|
1864
|
+
if self.op == "CmpEQ":
|
|
1865
|
+
skip_op_and_rhs = True
|
|
1866
|
+
yield "!", None
|
|
1867
|
+
elif self.op == "CmpNE":
|
|
1868
|
+
skip_op_and_rhs = True
|
|
1880
1869
|
# lhs
|
|
1881
1870
|
if isinstance(self.lhs, CBinaryOp) and self.op_precedence > self.lhs.op_precedence:
|
|
1882
1871
|
paren = CClosingObject("(")
|
|
@@ -2059,8 +2048,7 @@ class CConstant(CExpression):
|
|
|
2059
2048
|
ident = (self.tags or {}).get("ins_addr", None)
|
|
2060
2049
|
if ident is not None:
|
|
2061
2050
|
return ("inst", ident)
|
|
2062
|
-
|
|
2063
|
-
return ("val", self.value)
|
|
2051
|
+
return ("val", self.value)
|
|
2064
2052
|
|
|
2065
2053
|
@property
|
|
2066
2054
|
def fmt(self):
|
|
@@ -2094,13 +2082,13 @@ class CConstant(CExpression):
|
|
|
2094
2082
|
if result is None:
|
|
2095
2083
|
result = False
|
|
2096
2084
|
if isinstance(self.value, int):
|
|
2097
|
-
if self._type is not None
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2085
|
+
value_size = self._type.size if self._type is not None else None
|
|
2086
|
+
if (
|
|
2087
|
+
value_size == 32
|
|
2088
|
+
and 0xF000_0000 <= self.value <= 0xFFFF_FFFF
|
|
2089
|
+
or value_size == 64
|
|
2090
|
+
and 0xF000_0000_0000_0000 <= self.value <= 0xFFFF_FFFF_FFFF_FFFF
|
|
2091
|
+
):
|
|
2104
2092
|
result = True
|
|
2105
2093
|
|
|
2106
2094
|
return result
|
|
@@ -2141,10 +2129,9 @@ class CConstant(CExpression):
|
|
|
2141
2129
|
def str_to_c_str(_str, prefix: str = ""):
|
|
2142
2130
|
repr_str = repr(_str)
|
|
2143
2131
|
base_str = repr_str[1:-1]
|
|
2144
|
-
if
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
base_str = base_str.replace('"', '\\"')
|
|
2132
|
+
# check if there's double quotes in the body
|
|
2133
|
+
if repr_str[0] == "'" and '"' in base_str:
|
|
2134
|
+
base_str = base_str.replace('"', '\\"')
|
|
2148
2135
|
return f'{prefix}"{base_str}"'
|
|
2149
2136
|
|
|
2150
2137
|
def c_repr_chunks(self, indent=0, asexpr=False):
|
|
@@ -2154,7 +2141,7 @@ class CConstant(CExpression):
|
|
|
2154
2141
|
|
|
2155
2142
|
# default priority: string references -> variables -> other reference values
|
|
2156
2143
|
if self.reference_values is not None:
|
|
2157
|
-
for
|
|
2144
|
+
for _ty, v in self.reference_values.items(): # pylint:disable=unused-variable
|
|
2158
2145
|
if isinstance(v, MemoryData) and v.sort == MemoryDataSort.String:
|
|
2159
2146
|
yield CConstant.str_to_c_str(v.content.decode("utf-8")), self
|
|
2160
2147
|
return
|
|
@@ -2179,11 +2166,7 @@ class CConstant(CExpression):
|
|
|
2179
2166
|
yield CConstant.str_to_c_str(v), self
|
|
2180
2167
|
elif isinstance(self._type, SimTypePointer) and isinstance(self._type.pts_to, SimTypeWideChar):
|
|
2181
2168
|
refval = self.reference_values[self._type]
|
|
2182
|
-
if isinstance(refval, MemoryData)
|
|
2183
|
-
v = refval.content.decode("utf_16_le")
|
|
2184
|
-
else:
|
|
2185
|
-
# it's a string
|
|
2186
|
-
v = refval
|
|
2169
|
+
v = refval.content.decode("utf_16_le") if isinstance(refval, MemoryData) else refval # it's a string
|
|
2187
2170
|
yield CConstant.str_to_c_str(v, prefix="L"), self
|
|
2188
2171
|
else:
|
|
2189
2172
|
if isinstance(self.reference_values[self._type], int):
|
|
@@ -2217,9 +2200,8 @@ class CConstant(CExpression):
|
|
|
2217
2200
|
:return: The formatted string.
|
|
2218
2201
|
"""
|
|
2219
2202
|
|
|
2220
|
-
if self.fmt_float:
|
|
2221
|
-
|
|
2222
|
-
return str(struct.unpack("f", struct.pack("I", value))[0])
|
|
2203
|
+
if self.fmt_float and 0 < value <= 0xFFFF_FFFF:
|
|
2204
|
+
return str(struct.unpack("f", struct.pack("I", value))[0])
|
|
2223
2205
|
|
|
2224
2206
|
if self.fmt_char:
|
|
2225
2207
|
if value < 0:
|
|
@@ -2227,10 +2209,8 @@ class CConstant(CExpression):
|
|
|
2227
2209
|
value &= 0xFF
|
|
2228
2210
|
return repr(chr(value)) if value < 0x80 else f"'\\x{value:x}'"
|
|
2229
2211
|
|
|
2230
|
-
if self.fmt_double:
|
|
2231
|
-
|
|
2232
|
-
str_value = str(struct.unpack("d", struct.pack("Q", value))[0])
|
|
2233
|
-
return str_value
|
|
2212
|
+
if self.fmt_double and 0 < value <= 0xFFFF_FFFF_FFFF_FFFF:
|
|
2213
|
+
return str(struct.unpack("d", struct.pack("Q", value))[0])
|
|
2234
2214
|
|
|
2235
2215
|
if self.fmt_neg:
|
|
2236
2216
|
if value > 0:
|
|
@@ -2448,6 +2428,7 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
2448
2428
|
Expr.ITE: self._handle_Expr_ITE,
|
|
2449
2429
|
Expr.Reinterpret: self._handle_Reinterpret,
|
|
2450
2430
|
Expr.MultiStatementExpression: self._handle_MultiStatementExpression,
|
|
2431
|
+
Expr.VirtualVariable: self._handle_VirtualVariable,
|
|
2451
2432
|
}
|
|
2452
2433
|
|
|
2453
2434
|
self._func = func
|
|
@@ -2523,10 +2504,7 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
2523
2504
|
# memo
|
|
2524
2505
|
self.ailexpr2cnode = {}
|
|
2525
2506
|
|
|
2526
|
-
if self._func_args
|
|
2527
|
-
arg_list = [self._variable(arg, None) for arg in self._func_args]
|
|
2528
|
-
else:
|
|
2529
|
-
arg_list = []
|
|
2507
|
+
arg_list = [self._variable(arg, None) for arg in self._func_args] if self._func_args else []
|
|
2530
2508
|
|
|
2531
2509
|
obj = self._handle(self._sequence)
|
|
2532
2510
|
|
|
@@ -2619,8 +2597,7 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
2619
2597
|
def _get_variable_type(self, var, is_global=False):
|
|
2620
2598
|
if is_global:
|
|
2621
2599
|
return self._variable_kb.variables["global"].get_variable_type(var)
|
|
2622
|
-
|
|
2623
|
-
return self._variable_kb.variables[self._func.addr].get_variable_type(var)
|
|
2600
|
+
return self._variable_kb.variables[self._func.addr].get_variable_type(var)
|
|
2624
2601
|
|
|
2625
2602
|
def _get_derefed_type(self, ty: SimType) -> SimType | None:
|
|
2626
2603
|
if ty is None:
|
|
@@ -2758,10 +2735,7 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
2758
2735
|
codegen=self,
|
|
2759
2736
|
)
|
|
2760
2737
|
|
|
2761
|
-
if isinstance(expr, CUnaryOp) and expr.op == "Reference"
|
|
2762
|
-
base_expr = expr.operand
|
|
2763
|
-
else:
|
|
2764
|
-
base_expr = None
|
|
2738
|
+
base_expr = expr.operand if isinstance(expr, CUnaryOp) and expr.op == "Reference" else None
|
|
2765
2739
|
|
|
2766
2740
|
if offset == 0:
|
|
2767
2741
|
data_type = renegotiate_type(data_type, base_type)
|
|
@@ -2779,10 +2753,7 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
2779
2753
|
return _force_type_cast(base_type, data_type, expr)
|
|
2780
2754
|
return CUnaryOp("Dereference", expr, codegen=self)
|
|
2781
2755
|
|
|
2782
|
-
if base_type.size is None
|
|
2783
|
-
stride = 1
|
|
2784
|
-
else:
|
|
2785
|
-
stride = base_type.size // self.project.arch.byte_width or 1
|
|
2756
|
+
stride = 1 if base_type.size is None else base_type.size // self.project.arch.byte_width or 1
|
|
2786
2757
|
index, remainder = divmod(offset, stride)
|
|
2787
2758
|
if index != 0:
|
|
2788
2759
|
index = CConstant(index, SimTypeInt(), codegen=self)
|
|
@@ -2915,10 +2886,7 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
2915
2886
|
),
|
|
2916
2887
|
codegen=self,
|
|
2917
2888
|
)
|
|
2918
|
-
if result is None
|
|
2919
|
-
result = piece
|
|
2920
|
-
else:
|
|
2921
|
-
result = CBinaryOp(op, result, piece, codegen=self)
|
|
2889
|
+
result = piece if result is None else CBinaryOp(op, result, piece, codegen=self)
|
|
2922
2890
|
if o_constant != 0:
|
|
2923
2891
|
result = CBinaryOp("Add", CConstant(o_constant, SimTypeInt(), codegen=self), result, codegen=self)
|
|
2924
2892
|
|
|
@@ -3048,14 +3016,11 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3048
3016
|
|
|
3049
3017
|
handler: Callable | None = self._handlers.get(node.__class__, None)
|
|
3050
3018
|
if handler is not None:
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
converted = handler(node, is_expr=is_expr)
|
|
3054
|
-
else:
|
|
3055
|
-
converted = handler(node, lvalue=lvalue)
|
|
3019
|
+
# special case for Call
|
|
3020
|
+
converted = handler(node, is_expr=is_expr) if isinstance(node, Stmt.Call) else handler(node, lvalue=lvalue)
|
|
3056
3021
|
self.ailexpr2cnode[(node, is_expr)] = converted
|
|
3057
3022
|
return converted
|
|
3058
|
-
raise UnsupportedNodeTypeError("Node type
|
|
3023
|
+
raise UnsupportedNodeTypeError(f"Node type {type(node)} is not supported yet.")
|
|
3059
3024
|
|
|
3060
3025
|
def _handle_Code(self, node, **kwargs):
|
|
3061
3026
|
return self._handle(node.node, is_expr=False)
|
|
@@ -3081,14 +3046,14 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3081
3046
|
tags=tags,
|
|
3082
3047
|
codegen=self,
|
|
3083
3048
|
)
|
|
3084
|
-
|
|
3049
|
+
if loop_node.sort == "do-while":
|
|
3085
3050
|
return CDoWhileLoop(
|
|
3086
3051
|
self._handle(loop_node.condition),
|
|
3087
3052
|
None if loop_node.sequence_node is None else self._handle(loop_node.sequence_node, is_expr=False),
|
|
3088
3053
|
tags=tags,
|
|
3089
3054
|
codegen=self,
|
|
3090
3055
|
)
|
|
3091
|
-
|
|
3056
|
+
if loop_node.sort == "for":
|
|
3092
3057
|
return CForLoop(
|
|
3093
3058
|
None if loop_node.initializer is None else self._handle(loop_node.initializer),
|
|
3094
3059
|
None if loop_node.condition is None else self._handle(loop_node.condition),
|
|
@@ -3098,8 +3063,7 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3098
3063
|
codegen=self,
|
|
3099
3064
|
)
|
|
3100
3065
|
|
|
3101
|
-
|
|
3102
|
-
raise NotImplementedError()
|
|
3066
|
+
raise NotImplementedError
|
|
3103
3067
|
|
|
3104
3068
|
def _handle_Condition(self, condition_node: ConditionNode, **kwargs):
|
|
3105
3069
|
tags = {"ins_addr": condition_node.addr}
|
|
@@ -3113,7 +3077,7 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3113
3077
|
|
|
3114
3078
|
else_node = self._handle(condition_node.false_node, is_expr=False) if condition_node.false_node else None
|
|
3115
3079
|
|
|
3116
|
-
|
|
3080
|
+
return CIfElse(
|
|
3117
3081
|
condition_and_nodes,
|
|
3118
3082
|
else_node=else_node,
|
|
3119
3083
|
simplify_else_scope=self.simplify_else_scope
|
|
@@ -3123,7 +3087,6 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3123
3087
|
tags=tags,
|
|
3124
3088
|
codegen=self,
|
|
3125
3089
|
)
|
|
3126
|
-
return code
|
|
3127
3090
|
|
|
3128
3091
|
def _handle_CascadingCondition(self, cond_node: CascadingConditionNode, **kwargs):
|
|
3129
3092
|
tags = {"ins_addr": cond_node.addr}
|
|
@@ -3133,14 +3096,13 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3133
3096
|
]
|
|
3134
3097
|
else_node = self._handle(cond_node.else_node) if cond_node.else_node is not None else None
|
|
3135
3098
|
|
|
3136
|
-
|
|
3099
|
+
return CIfElse(
|
|
3137
3100
|
condition_and_nodes,
|
|
3138
3101
|
else_node=else_node,
|
|
3139
3102
|
tags=tags,
|
|
3140
3103
|
cstyle_ifs=self.cstyle_ifs,
|
|
3141
3104
|
codegen=self,
|
|
3142
3105
|
)
|
|
3143
|
-
return code
|
|
3144
3106
|
|
|
3145
3107
|
def _handle_ConditionalBreak(self, node, **kwargs):
|
|
3146
3108
|
tags = {"ins_addr": node.addr}
|
|
@@ -3172,8 +3134,7 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3172
3134
|
cases = [(idx, self._handle(case, is_expr=False)) for idx, case in node.cases.items()]
|
|
3173
3135
|
default = self._handle(node.default_node, is_expr=False) if node.default_node is not None else None
|
|
3174
3136
|
tags = {"ins_addr": node.addr}
|
|
3175
|
-
|
|
3176
|
-
return switch_case
|
|
3137
|
+
return CSwitchCase(switch_expr, cases, default=default, tags=tags, codegen=self)
|
|
3177
3138
|
|
|
3178
3139
|
def _handle_Continue(self, node, **kwargs):
|
|
3179
3140
|
tags = {"ins_addr": node.addr}
|
|
@@ -3235,33 +3196,57 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3235
3196
|
return CAssignment(cdst, cdata, tags=stmt.tags, codegen=self)
|
|
3236
3197
|
|
|
3237
3198
|
def _handle_Stmt_Assignment(self, stmt, **kwargs):
|
|
3238
|
-
cdst = self._handle(stmt.dst, lvalue=True)
|
|
3239
3199
|
csrc = self._handle(stmt.src, lvalue=False)
|
|
3200
|
+
cdst = None
|
|
3201
|
+
|
|
3202
|
+
if isinstance(stmt.dst, Expr.VirtualVariable) and stmt.dst.was_stack:
|
|
3203
|
+
|
|
3204
|
+
def negotiate(old_ty, proposed_ty):
|
|
3205
|
+
# transfer casts from the dst to the src if possible
|
|
3206
|
+
# if we see something like *(size_t*)&v4 = x; where v4 is a pointer, change to v4 = (void*)x;
|
|
3207
|
+
nonlocal csrc
|
|
3208
|
+
if old_ty != proposed_ty and qualifies_for_simple_cast(old_ty, proposed_ty):
|
|
3209
|
+
csrc = CTypeCast(csrc.type, proposed_ty, csrc, codegen=self)
|
|
3210
|
+
return proposed_ty
|
|
3211
|
+
return old_ty
|
|
3212
|
+
|
|
3213
|
+
if stmt.dst.variable is not None:
|
|
3214
|
+
if "struct_member_info" in stmt.dst.tags:
|
|
3215
|
+
offset, var, _ = stmt.dst.struct_member_info
|
|
3216
|
+
cvar = self._variable(var, stmt.dst.size)
|
|
3217
|
+
else:
|
|
3218
|
+
cvar = self._variable(stmt.dst.variable, stmt.dst.size)
|
|
3219
|
+
offset = stmt.dst.variable_offset or 0
|
|
3220
|
+
assert type(offset) is int # I refuse to deal with the alternative
|
|
3221
|
+
|
|
3222
|
+
cdst = self._access_constant_offset(
|
|
3223
|
+
self._get_variable_reference(cvar), offset, csrc.type, True, negotiate
|
|
3224
|
+
)
|
|
3225
|
+
|
|
3226
|
+
if cdst is None:
|
|
3227
|
+
cdst = self._handle(stmt.dst, lvalue=True)
|
|
3240
3228
|
|
|
3241
3229
|
return CAssignment(cdst, csrc, tags=stmt.tags, codegen=self)
|
|
3242
3230
|
|
|
3243
3231
|
def _handle_Stmt_Call(self, stmt: Stmt.Call, is_expr: bool = False, **kwargs):
|
|
3244
3232
|
try:
|
|
3245
3233
|
# Try to handle it as a normal function call
|
|
3246
|
-
if not isinstance(stmt.target, str)
|
|
3247
|
-
target = self._handle(stmt.target)
|
|
3248
|
-
else:
|
|
3249
|
-
target = stmt.target
|
|
3234
|
+
target = self._handle(stmt.target) if not isinstance(stmt.target, str) else stmt.target
|
|
3250
3235
|
except UnsupportedNodeTypeError:
|
|
3251
3236
|
target = stmt.target
|
|
3252
3237
|
|
|
3253
|
-
if isinstance(target, CConstant)
|
|
3254
|
-
target_func = self.kb.functions.function(addr=target.value)
|
|
3255
|
-
else:
|
|
3256
|
-
target_func = None
|
|
3238
|
+
target_func = self.kb.functions.function(addr=target.value) if isinstance(target, CConstant) else None
|
|
3257
3239
|
|
|
3258
3240
|
args = []
|
|
3259
3241
|
if stmt.args is not None:
|
|
3260
3242
|
for i, arg in enumerate(stmt.args):
|
|
3261
3243
|
type_ = None
|
|
3262
|
-
if
|
|
3263
|
-
|
|
3264
|
-
|
|
3244
|
+
if (
|
|
3245
|
+
target_func is not None
|
|
3246
|
+
and target_func.prototype is not None
|
|
3247
|
+
and i < len(target_func.prototype.args)
|
|
3248
|
+
):
|
|
3249
|
+
type_ = target_func.prototype.args[i].with_arch(self.project.arch)
|
|
3265
3250
|
|
|
3266
3251
|
if isinstance(arg, Expr.Const):
|
|
3267
3252
|
if type_ is None or is_machine_word_size_type(type_, self.project.arch):
|
|
@@ -3308,26 +3293,24 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3308
3293
|
if stmt.false_target is None
|
|
3309
3294
|
else CGoto(self._handle(stmt.false_target), None, tags=stmt.tags, codegen=self)
|
|
3310
3295
|
)
|
|
3311
|
-
|
|
3296
|
+
return CIfElse(
|
|
3312
3297
|
[(self._handle(stmt.condition), CGoto(self._handle(stmt.true_target), None, tags=stmt.tags, codegen=self))],
|
|
3313
3298
|
else_node=else_node,
|
|
3314
3299
|
cstyle_ifs=self.cstyle_ifs,
|
|
3315
3300
|
tags=stmt.tags,
|
|
3316
3301
|
codegen=self,
|
|
3317
3302
|
)
|
|
3318
|
-
return ifelse
|
|
3319
3303
|
|
|
3320
3304
|
def _handle_Stmt_Return(self, stmt: Stmt.Return, **kwargs):
|
|
3321
3305
|
if not stmt.ret_exprs:
|
|
3322
3306
|
return CReturn(None, tags=stmt.tags, codegen=self)
|
|
3323
|
-
|
|
3324
|
-
ret_expr = stmt.ret_exprs[0]
|
|
3325
|
-
return CReturn(self._handle(ret_expr), tags=stmt.tags, codegen=self)
|
|
3326
|
-
else:
|
|
3327
|
-
# TODO: Multiple return expressions
|
|
3328
|
-
l.warning("StructuredCodeGen does not support multiple return expressions yet. Only picking the first one.")
|
|
3307
|
+
if len(stmt.ret_exprs) == 1:
|
|
3329
3308
|
ret_expr = stmt.ret_exprs[0]
|
|
3330
3309
|
return CReturn(self._handle(ret_expr), tags=stmt.tags, codegen=self)
|
|
3310
|
+
# TODO: Multiple return expressions
|
|
3311
|
+
l.warning("StructuredCodeGen does not support multiple return expressions yet. Only picking the first one.")
|
|
3312
|
+
ret_expr = stmt.ret_exprs[0]
|
|
3313
|
+
return CReturn(self._handle(ret_expr), tags=stmt.tags, codegen=self)
|
|
3331
3314
|
|
|
3332
3315
|
def _handle_Stmt_Label(self, stmt: Stmt.Label, **kwargs):
|
|
3333
3316
|
clabel = CLabel(stmt.name, stmt.ins_addr, stmt.block_idx, tags=stmt.tags, codegen=self)
|
|
@@ -3343,10 +3326,11 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3343
3326
|
|
|
3344
3327
|
def _handle_Expr_Register(self, expr: Expr.Register, lvalue: bool = False, **kwargs):
|
|
3345
3328
|
def negotiate(old_ty: SimType, proposed_ty: SimType) -> SimType:
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3329
|
+
# we do not allow returning a struct for a primitive type
|
|
3330
|
+
if old_ty.size == proposed_ty.size and (
|
|
3331
|
+
not isinstance(proposed_ty, SimStruct) or isinstance(old_ty, SimStruct)
|
|
3332
|
+
):
|
|
3333
|
+
return proposed_ty
|
|
3350
3334
|
return old_ty
|
|
3351
3335
|
|
|
3352
3336
|
if expr.variable:
|
|
@@ -3357,17 +3341,19 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3357
3341
|
# FIXME: The type should be associated to the register expression itself
|
|
3358
3342
|
type_ = self.default_simtype_from_size(expr.size, signed=False)
|
|
3359
3343
|
return self._access_constant_offset(self._get_variable_reference(cvar), offset, type_, lvalue, negotiate)
|
|
3360
|
-
|
|
3361
|
-
return CRegister(expr, tags=expr.tags, codegen=self)
|
|
3344
|
+
return CRegister(expr, tags=expr.tags, codegen=self)
|
|
3362
3345
|
|
|
3363
3346
|
def _handle_Expr_Load(self, expr: Expr.Load, **kwargs):
|
|
3364
3347
|
ty = self.default_simtype_from_size(expr.size)
|
|
3365
3348
|
|
|
3366
3349
|
def negotiate(old_ty: SimType, proposed_ty: SimType) -> SimType:
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3350
|
+
# we do not allow returning a struct for a primitive type
|
|
3351
|
+
if (
|
|
3352
|
+
old_ty.size == proposed_ty.size
|
|
3353
|
+
and not isinstance(proposed_ty, SimStruct)
|
|
3354
|
+
and not isinstance(old_ty, SimStruct)
|
|
3355
|
+
):
|
|
3356
|
+
return proposed_ty
|
|
3371
3357
|
return old_ty
|
|
3372
3358
|
|
|
3373
3359
|
if expr.variable is not None:
|
|
@@ -3495,8 +3481,13 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3495
3481
|
|
|
3496
3482
|
def _handle_Expr_Convert(self, expr: Expr.Convert, **kwargs):
|
|
3497
3483
|
# width of converted type is easy
|
|
3498
|
-
|
|
3499
|
-
|
|
3484
|
+
dst_type: SimTypeInt | SimTypeChar
|
|
3485
|
+
if 258 >= expr.to_bits > 128:
|
|
3486
|
+
dst_type = SimTypeInt256()
|
|
3487
|
+
elif 128 >= expr.to_bits > 64:
|
|
3488
|
+
dst_type = SimTypeInt128()
|
|
3489
|
+
elif 64 >= expr.to_bits > 32:
|
|
3490
|
+
dst_type = SimTypeLongLong()
|
|
3500
3491
|
elif 32 >= expr.to_bits > 16:
|
|
3501
3492
|
dst_type = SimTypeInt()
|
|
3502
3493
|
elif 16 >= expr.to_bits > 8:
|
|
@@ -3506,7 +3497,7 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3506
3497
|
elif expr.to_bits == 1:
|
|
3507
3498
|
dst_type = SimTypeChar() # FIXME: Add a SimTypeBit?
|
|
3508
3499
|
else:
|
|
3509
|
-
raise UnsupportedNodeTypeError("Unsupported conversion bits
|
|
3500
|
+
raise UnsupportedNodeTypeError(f"Unsupported conversion bits {expr.to_bits}.")
|
|
3510
3501
|
|
|
3511
3502
|
# convert child
|
|
3512
3503
|
child = self._handle(expr.operand)
|
|
@@ -3565,6 +3556,28 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3565
3556
|
cexpr = self._handle(expr.expr)
|
|
3566
3557
|
return CMultiStatementExpression(cstmts, cexpr, tags=expr.tags, codegen=self)
|
|
3567
3558
|
|
|
3559
|
+
def _handle_VirtualVariable(self, expr: Expr.VirtualVariable, **kwargs):
|
|
3560
|
+
if expr.variable:
|
|
3561
|
+
cvar = self._variable(expr.variable, None)
|
|
3562
|
+
if expr.variable.size != expr.size:
|
|
3563
|
+
l.warning(
|
|
3564
|
+
"VirtualVariable size (%d) and variable size (%d) do not match. Force a type cast.",
|
|
3565
|
+
expr.size,
|
|
3566
|
+
expr.variable.size,
|
|
3567
|
+
)
|
|
3568
|
+
src_type = cvar.type
|
|
3569
|
+
dst_type = {
|
|
3570
|
+
64: SimTypeLongLong(signed=False),
|
|
3571
|
+
32: SimTypeInt(signed=False),
|
|
3572
|
+
16: SimTypeShort(signed=False),
|
|
3573
|
+
8: SimTypeChar(signed=False),
|
|
3574
|
+
}.get(expr.bits, None)
|
|
3575
|
+
if dst_type is not None:
|
|
3576
|
+
dst_type = dst_type.with_arch(self.project.arch)
|
|
3577
|
+
return CTypeCast(src_type, dst_type, cvar, tags=expr.tags, codegen=self)
|
|
3578
|
+
return cvar
|
|
3579
|
+
return CDirtyExpression(expr, codegen=self)
|
|
3580
|
+
|
|
3568
3581
|
def _handle_Expr_StackBaseOffset(self, expr: StackBaseOffset, **kwargs):
|
|
3569
3582
|
if expr.variable is not None:
|
|
3570
3583
|
var_thing = self._variable(expr.variable, expr.size)
|
|
@@ -3575,8 +3588,7 @@ class CStructuredCodeGenerator(BaseStructuredCodeGenerator, Analysis):
|
|
|
3575
3588
|
|
|
3576
3589
|
# FIXME
|
|
3577
3590
|
stack_base = CFakeVariable("stack_base", SimTypePointer(SimTypeBottom()), codegen=self)
|
|
3578
|
-
|
|
3579
|
-
return ptr
|
|
3591
|
+
return CBinaryOp("Add", stack_base, CConstant(expr.offset, SimTypeInt(), codegen=self), codegen=self)
|
|
3580
3592
|
|
|
3581
3593
|
|
|
3582
3594
|
class CStructuredCodeWalker:
|