angr 9.2.131__py3-none-manylinux2014_aarch64.whl → 9.2.133__py3-none-manylinux2014_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of angr might be problematic. Click here for more details.
- angr/__init__.py +128 -128
- angr/analyses/__init__.py +38 -38
- angr/analyses/analysis.py +6 -2
- angr/analyses/backward_slice.py +3 -4
- angr/analyses/binary_optimizer.py +5 -12
- angr/analyses/bindiff.py +3 -6
- angr/analyses/calling_convention.py +3 -4
- angr/analyses/cfg/__init__.py +3 -3
- angr/analyses/cfg/cfg_base.py +1 -1
- angr/analyses/cfg/cfg_emulated.py +5 -5
- angr/analyses/cfg/cfg_fast.py +19 -17
- angr/analyses/cfg/indirect_jump_resolvers/__init__.py +5 -5
- angr/analyses/cfg/indirect_jump_resolvers/amd64_elf_got.py +1 -1
- angr/analyses/cfg/indirect_jump_resolvers/jumptable.py +148 -101
- angr/analyses/cfg/indirect_jump_resolvers/x86_elf_pic_plt.py +1 -1
- angr/analyses/data_dep/__init__.py +4 -4
- angr/analyses/datagraph_meta.py +1 -1
- angr/analyses/ddg.py +16 -17
- angr/analyses/decompiler/__init__.py +12 -12
- angr/analyses/decompiler/ail_simplifier.py +24 -12
- angr/analyses/decompiler/block_similarity.py +2 -4
- angr/analyses/decompiler/block_simplifier.py +10 -21
- angr/analyses/decompiler/callsite_maker.py +1 -1
- angr/analyses/decompiler/ccall_rewriters/rewriter_base.py +1 -1
- angr/analyses/decompiler/clinic.py +122 -41
- angr/analyses/decompiler/condition_processor.py +57 -39
- angr/analyses/decompiler/counters/__init__.py +3 -3
- angr/analyses/decompiler/decompilation_cache.py +7 -7
- angr/analyses/decompiler/dephication/__init__.py +1 -1
- angr/analyses/decompiler/dephication/graph_rewriting.py +1 -1
- angr/analyses/decompiler/dephication/graph_vvar_mapping.py +11 -3
- angr/analyses/decompiler/dephication/rewriting_engine.py +169 -45
- angr/analyses/decompiler/dephication/seqnode_dephication.py +5 -4
- angr/analyses/decompiler/expression_narrower.py +1 -1
- angr/analyses/decompiler/graph_region.py +8 -8
- angr/analyses/decompiler/optimization_passes/__init__.py +20 -20
- angr/analyses/decompiler/optimization_passes/const_derefs.py +1 -0
- angr/analyses/decompiler/optimization_passes/deadblock_remover.py +1 -2
- angr/analyses/decompiler/optimization_passes/div_simplifier.py +41 -16
- angr/analyses/decompiler/optimization_passes/duplication_reverter/duplication_reverter.py +8 -7
- angr/analyses/decompiler/optimization_passes/duplication_reverter/utils.py +1 -3
- angr/analyses/decompiler/optimization_passes/engine_base.py +262 -84
- angr/analyses/decompiler/optimization_passes/inlined_string_transformation_simplifier.py +175 -39
- angr/analyses/decompiler/optimization_passes/ite_region_converter.py +2 -5
- angr/analyses/decompiler/optimization_passes/lowered_switch_simplifier.py +5 -5
- angr/analyses/decompiler/optimization_passes/mod_simplifier.py +12 -3
- angr/analyses/decompiler/optimization_passes/optimization_pass.py +42 -19
- angr/analyses/decompiler/optimization_passes/stack_canary_simplifier.py +9 -5
- angr/analyses/decompiler/peephole_optimizations/__init__.py +1 -1
- angr/analyses/decompiler/peephole_optimizations/base.py +6 -6
- angr/analyses/decompiler/peephole_optimizations/remove_noop_conversions.py +2 -0
- angr/analyses/decompiler/peephole_optimizations/rewrite_bit_extractions.py +1 -1
- angr/analyses/decompiler/presets/__init__.py +1 -1
- angr/analyses/decompiler/region_simplifiers/expr_folding.py +3 -3
- angr/analyses/decompiler/region_simplifiers/switch_cluster_simplifier.py +8 -12
- angr/analyses/decompiler/ssailification/rewriting.py +1 -2
- angr/analyses/decompiler/ssailification/rewriting_engine.py +139 -56
- angr/analyses/decompiler/ssailification/ssailification.py +2 -1
- angr/analyses/decompiler/ssailification/traversal.py +4 -6
- angr/analyses/decompiler/ssailification/traversal_engine.py +125 -42
- angr/analyses/decompiler/structured_codegen/__init__.py +5 -5
- angr/analyses/decompiler/structured_codegen/base.py +3 -3
- angr/analyses/decompiler/structured_codegen/c.py +39 -40
- angr/analyses/decompiler/structuring/__init__.py +3 -3
- angr/analyses/decompiler/structuring/phoenix.py +45 -29
- angr/analyses/decompiler/structuring/structurer_base.py +2 -2
- angr/analyses/decompiler/structuring/structurer_nodes.py +23 -14
- angr/analyses/deobfuscator/__init__.py +3 -3
- angr/analyses/deobfuscator/irsb_reg_collector.py +29 -60
- angr/analyses/deobfuscator/string_obf_finder.py +2 -2
- angr/analyses/deobfuscator/string_obf_opt_passes.py +1 -1
- angr/analyses/disassembly.py +4 -4
- angr/analyses/forward_analysis/__init__.py +1 -1
- angr/analyses/forward_analysis/visitors/graph.py +6 -6
- angr/analyses/init_finder.py +47 -22
- angr/analyses/loop_analysis.py +1 -1
- angr/analyses/loopfinder.py +1 -1
- angr/analyses/propagator/engine_base.py +21 -14
- angr/analyses/propagator/engine_vex.py +149 -179
- angr/analyses/propagator/outdated_definition_walker.py +12 -6
- angr/analyses/propagator/propagator.py +10 -28
- angr/analyses/propagator/top_checker_mixin.py +211 -5
- angr/analyses/propagator/vex_vars.py +4 -4
- angr/analyses/reaching_definitions/__init__.py +9 -9
- angr/analyses/reaching_definitions/call_trace.py +2 -2
- angr/analyses/reaching_definitions/dep_graph.py +1 -1
- angr/analyses/reaching_definitions/engine_ail.py +304 -329
- angr/analyses/reaching_definitions/engine_vex.py +243 -229
- angr/analyses/reaching_definitions/function_handler.py +3 -3
- angr/analyses/reaching_definitions/function_handler_library/__init__.py +1 -1
- angr/analyses/reaching_definitions/rd_state.py +47 -42
- angr/analyses/reassembler.py +26 -31
- angr/analyses/s_liveness.py +8 -0
- angr/analyses/s_propagator.py +18 -3
- angr/analyses/s_reaching_definitions/s_rda_view.py +2 -5
- angr/analyses/s_reaching_definitions/s_reaching_definitions.py +9 -5
- angr/analyses/stack_pointer_tracker.py +4 -4
- angr/analyses/typehoon/simple_solver.py +14 -14
- angr/analyses/typehoon/translator.py +10 -2
- angr/analyses/typehoon/typeconsts.py +11 -3
- angr/analyses/typehoon/typevars.py +26 -26
- angr/analyses/unpacker/__init__.py +1 -1
- angr/analyses/variable_recovery/engine_ail.py +299 -259
- angr/analyses/variable_recovery/engine_base.py +138 -121
- angr/analyses/variable_recovery/engine_vex.py +175 -185
- angr/analyses/variable_recovery/irsb_scanner.py +49 -38
- angr/analyses/variable_recovery/variable_recovery.py +28 -5
- angr/analyses/variable_recovery/variable_recovery_base.py +33 -34
- angr/analyses/variable_recovery/variable_recovery_fast.py +4 -8
- angr/analyses/veritesting.py +2 -2
- angr/analyses/vfg.py +5 -5
- angr/analyses/xrefs.py +46 -19
- angr/angrdb/serializers/__init__.py +1 -1
- angr/annocfg.py +20 -15
- angr/blade.py +2 -2
- angr/block.py +20 -25
- angr/calling_conventions.py +12 -14
- angr/code_location.py +6 -10
- angr/codenode.py +3 -3
- angr/engines/__init__.py +12 -14
- angr/engines/engine.py +24 -61
- angr/engines/light/__init__.py +13 -5
- angr/engines/light/data.py +1 -1
- angr/engines/light/engine.py +1003 -1185
- angr/engines/pcode/__init__.py +1 -1
- angr/engines/pcode/behavior.py +1 -1
- angr/engines/pcode/cc.py +2 -0
- angr/engines/pcode/lifter.py +13 -15
- angr/engines/soot/expressions/__init__.py +12 -12
- angr/engines/soot/statements/__init__.py +6 -6
- angr/engines/soot/values/__init__.py +6 -6
- angr/engines/soot/values/arrayref.py +2 -2
- angr/engines/soot/values/constants.py +1 -1
- angr/engines/soot/values/instancefieldref.py +1 -1
- angr/engines/soot/values/paramref.py +1 -1
- angr/engines/soot/values/staticfieldref.py +1 -1
- angr/engines/successors.py +15 -14
- angr/engines/vex/__init__.py +5 -5
- angr/engines/vex/claripy/ccall.py +2 -2
- angr/engines/vex/claripy/datalayer.py +1 -1
- angr/engines/vex/claripy/irop.py +19 -19
- angr/engines/vex/heavy/__init__.py +2 -2
- angr/engines/vex/heavy/actions.py +1 -3
- angr/engines/vex/heavy/heavy.py +4 -6
- angr/engines/vex/lifter.py +2 -4
- angr/engines/vex/light/light.py +0 -2
- angr/engines/vex/light/slicing.py +5 -5
- angr/exploration_techniques/__init__.py +19 -142
- angr/exploration_techniques/base.py +126 -0
- angr/exploration_techniques/bucketizer.py +1 -1
- angr/exploration_techniques/dfs.py +3 -1
- angr/exploration_techniques/director.py +2 -3
- angr/exploration_techniques/driller_core.py +1 -1
- angr/exploration_techniques/explorer.py +4 -2
- angr/exploration_techniques/lengthlimiter.py +2 -1
- angr/exploration_techniques/local_loop_seer.py +2 -1
- angr/exploration_techniques/loop_seer.py +5 -5
- angr/exploration_techniques/manual_mergepoint.py +2 -1
- angr/exploration_techniques/memory_watcher.py +3 -1
- angr/exploration_techniques/oppologist.py +4 -5
- angr/exploration_techniques/slicecutor.py +4 -2
- angr/exploration_techniques/spiller.py +1 -1
- angr/exploration_techniques/stochastic.py +2 -1
- angr/exploration_techniques/stub_stasher.py +2 -1
- angr/exploration_techniques/suggestions.py +3 -1
- angr/exploration_techniques/symbion.py +3 -1
- angr/exploration_techniques/tech_builder.py +2 -1
- angr/exploration_techniques/threading.py +2 -11
- angr/exploration_techniques/timeout.py +4 -2
- angr/exploration_techniques/tracer.py +4 -3
- angr/exploration_techniques/unique.py +3 -2
- angr/exploration_techniques/veritesting.py +1 -1
- angr/factory.py +36 -6
- angr/keyed_region.py +4 -4
- angr/knowledge_base.py +1 -1
- angr/knowledge_plugins/__init__.py +11 -11
- angr/knowledge_plugins/cfg/__init__.py +5 -5
- angr/knowledge_plugins/cfg/cfg_manager.py +2 -2
- angr/knowledge_plugins/cfg/cfg_model.py +8 -8
- angr/knowledge_plugins/cfg/cfg_node.py +19 -19
- angr/knowledge_plugins/cfg/indirect_jump.py +6 -6
- angr/knowledge_plugins/cfg/memory_data.py +5 -7
- angr/knowledge_plugins/functions/function.py +48 -52
- angr/knowledge_plugins/functions/function_parser.py +4 -4
- angr/knowledge_plugins/key_definitions/__init__.py +3 -3
- angr/knowledge_plugins/key_definitions/atoms.py +8 -8
- angr/knowledge_plugins/key_definitions/definition.py +1 -1
- angr/knowledge_plugins/key_definitions/live_definitions.py +30 -27
- angr/knowledge_plugins/labels.py +1 -1
- angr/knowledge_plugins/propagations/__init__.py +1 -1
- angr/knowledge_plugins/propagations/prop_value.py +2 -2
- angr/knowledge_plugins/propagations/propagation_model.py +7 -8
- angr/knowledge_plugins/propagations/states.py +44 -39
- angr/knowledge_plugins/variables/variable_access.py +2 -2
- angr/knowledge_plugins/variables/variable_manager.py +24 -10
- angr/knowledge_plugins/xrefs/xref.py +5 -8
- angr/misc/__init__.py +4 -4
- angr/misc/hookset.py +4 -5
- angr/misc/loggers.py +2 -2
- angr/misc/telemetry.py +1 -1
- angr/procedures/__init__.py +1 -1
- angr/procedures/cgc/fdwait.py +2 -2
- angr/procedures/definitions/__init__.py +2 -2
- angr/procedures/definitions/linux_kernel.py +0 -1
- angr/procedures/definitions/parse_syscalls_from_local_system.py +1 -1
- angr/procedures/definitions/parse_win32json.py +0 -1
- angr/procedures/ntdll/exceptions.py +1 -1
- angr/procedures/stubs/format_parser.py +3 -3
- angr/procedures/win32/dynamic_loading.py +1 -1
- angr/protos/__init__.py +3 -3
- angr/sim_manager.py +3 -5
- angr/sim_state.py +40 -42
- angr/sim_state_options.py +3 -3
- angr/sim_type.py +15 -14
- angr/sim_variable.py +42 -45
- angr/simos/__init__.py +4 -4
- angr/simos/cgc.py +1 -1
- angr/simos/simos.py +1 -1
- angr/simos/userland.py +1 -1
- angr/slicer.py +4 -7
- angr/state_plugins/__init__.py +34 -34
- angr/state_plugins/callstack.py +5 -12
- angr/state_plugins/heap/__init__.py +2 -2
- angr/state_plugins/heap/heap_brk.py +2 -4
- angr/state_plugins/heap/heap_ptmalloc.py +1 -1
- angr/state_plugins/jni_references.py +3 -2
- angr/state_plugins/scratch.py +1 -1
- angr/state_plugins/sim_action.py +1 -4
- angr/state_plugins/sim_event.py +1 -1
- angr/state_plugins/solver.py +7 -9
- angr/state_plugins/uc_manager.py +1 -1
- angr/state_plugins/view.py +2 -2
- angr/storage/__init__.py +1 -1
- angr/storage/file.py +10 -10
- angr/storage/memory_mixins/__init__.py +46 -46
- angr/storage/memory_mixins/default_filler_mixin.py +1 -3
- angr/storage/memory_mixins/javavm_memory_mixin.py +2 -2
- angr/storage/memory_mixins/name_resolution_mixin.py +2 -2
- angr/storage/memory_mixins/paged_memory/paged_memory_mixin.py +1 -3
- angr/storage/memory_mixins/paged_memory/pages/__init__.py +6 -6
- angr/storage/memory_mixins/paged_memory/pages/list_page.py +1 -1
- angr/storage/memory_mixins/paged_memory/pages/multi_values.py +1 -1
- angr/storage/memory_mixins/paged_memory/pages/mv_list_page.py +1 -1
- angr/storage/memory_mixins/paged_memory/pages/ultra_page.py +2 -4
- angr/storage/memory_mixins/regioned_memory/__init__.py +3 -3
- angr/storage/memory_mixins/regioned_memory/region_data.py +5 -5
- angr/storage/memory_mixins/regioned_memory/region_meta_mixin.py +7 -9
- angr/storage/memory_mixins/regioned_memory/regioned_memory_mixin.py +4 -4
- angr/storage/memory_object.py +4 -4
- angr/utils/__init__.py +3 -3
- angr/utils/bits.py +12 -0
- angr/utils/dynamic_dictlist.py +1 -1
- angr/utils/graph.py +1 -1
- angr/utils/orderedset.py +4 -1
- angr/utils/segment_list.py +2 -2
- angr/utils/ssa/__init__.py +33 -8
- {angr-9.2.131.dist-info → angr-9.2.133.dist-info}/METADATA +6 -6
- {angr-9.2.131.dist-info → angr-9.2.133.dist-info}/RECORD +262 -263
- angr/analyses/propagator/engine_ail.py +0 -1562
- angr/storage/memory_mixins/__init__.pyi +0 -48
- {angr-9.2.131.dist-info → angr-9.2.133.dist-info}/LICENSE +0 -0
- {angr-9.2.131.dist-info → angr-9.2.133.dist-info}/WHEEL +0 -0
- {angr-9.2.131.dist-info → angr-9.2.133.dist-info}/entry_points.txt +0 -0
- {angr-9.2.131.dist-info → angr-9.2.133.dist-info}/top_level.txt +0 -0
|
@@ -8,10 +8,10 @@ from .region_meta_mixin import MemoryRegionMetaMixin
|
|
|
8
8
|
from .regioned_address_concretization_mixin import RegionedAddressConcretizationMixin
|
|
9
9
|
|
|
10
10
|
__all__ = (
|
|
11
|
-
"RegionedMemoryMixin",
|
|
12
|
-
"RegionCategoryMixin",
|
|
13
|
-
"StaticFindMixin",
|
|
14
11
|
"AbstractMergerMixin",
|
|
15
12
|
"MemoryRegionMetaMixin",
|
|
13
|
+
"RegionCategoryMixin",
|
|
16
14
|
"RegionedAddressConcretizationMixin",
|
|
15
|
+
"RegionedMemoryMixin",
|
|
16
|
+
"StaticFindMixin",
|
|
17
17
|
)
|
|
@@ -14,11 +14,11 @@ class AddressWrapper:
|
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
16
|
__slots__ = (
|
|
17
|
-
"region",
|
|
18
|
-
"region_base_addr",
|
|
19
17
|
"address",
|
|
20
|
-
"is_on_stack",
|
|
21
18
|
"function_address",
|
|
19
|
+
"is_on_stack",
|
|
20
|
+
"region",
|
|
21
|
+
"region_base_addr",
|
|
22
22
|
)
|
|
23
23
|
|
|
24
24
|
def __init__(self, region: str, region_base_addr: int, address, is_on_stack: bool, function_address: int | None):
|
|
@@ -62,8 +62,8 @@ class RegionDescriptor:
|
|
|
62
62
|
"""
|
|
63
63
|
|
|
64
64
|
__slots__ = (
|
|
65
|
-
"region_id",
|
|
66
65
|
"base_address",
|
|
66
|
+
"region_id",
|
|
67
67
|
"related_function_address",
|
|
68
68
|
)
|
|
69
69
|
|
|
@@ -145,7 +145,7 @@ class RegionMap:
|
|
|
145
145
|
if self.is_stack:
|
|
146
146
|
# Sanity check
|
|
147
147
|
if not region_id.startswith("stack_"):
|
|
148
|
-
raise SimRegionMapError('Received a non-stack memory ID "
|
|
148
|
+
raise SimRegionMapError(f'Received a non-stack memory ID "{region_id}" in a stack region map')
|
|
149
149
|
|
|
150
150
|
# Remove all stack regions that are lower than the one to add
|
|
151
151
|
while True:
|
|
@@ -13,7 +13,7 @@ class Segment:
|
|
|
13
13
|
self.size = size
|
|
14
14
|
|
|
15
15
|
def __repr__(self):
|
|
16
|
-
return "Seg (
|
|
16
|
+
return f"Seg ({hex(self.offset)} [ {self.size} ])"
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class AbstractLocation:
|
|
@@ -120,22 +120,20 @@ class AbstractLocation:
|
|
|
120
120
|
return False
|
|
121
121
|
|
|
122
122
|
def __repr__(self):
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
self._segment_list,
|
|
127
|
-
)
|
|
123
|
+
bbl_key = self.basicblock_key if self.basicblock_key is not None else -1
|
|
124
|
+
stmt_id = self.statement_id if self.statement_id is not None else -1
|
|
125
|
+
return f"({bbl_key:x}h, {stmt_id}) {self._segment_list}"
|
|
128
126
|
|
|
129
127
|
|
|
130
128
|
class MemoryRegionMetaMixin(MemoryMixin):
|
|
131
129
|
__slots__ = (
|
|
130
|
+
"_alocs",
|
|
132
131
|
"_endness",
|
|
133
132
|
"_id",
|
|
134
|
-
"_state",
|
|
135
133
|
"_is_stack",
|
|
136
|
-
"_related_function_addr",
|
|
137
|
-
"_alocs",
|
|
138
134
|
"_memory",
|
|
135
|
+
"_related_function_addr",
|
|
136
|
+
"_state",
|
|
139
137
|
)
|
|
140
138
|
|
|
141
139
|
def __init__(self, related_function_addr=None, **kwargs):
|
|
@@ -95,9 +95,9 @@ class RegionedMemoryMixin(MemoryMixin):
|
|
|
95
95
|
if isinstance(size, BV) and size.has_annotation_type(RegionAnnotation):
|
|
96
96
|
_l.critical("load(): size %s is a ValueSet. Something is wrong.", size)
|
|
97
97
|
if self.state.scratch.ins_addr is not None:
|
|
98
|
-
var_name = "invalid_read_
|
|
98
|
+
var_name = f"invalid_read_{next(invalid_read_ctr)}_{self.state.scratch.ins_addr:#x}"
|
|
99
99
|
else:
|
|
100
|
-
var_name = "invalid_read_
|
|
100
|
+
var_name = f"invalid_read_{next(invalid_read_ctr)}_None"
|
|
101
101
|
|
|
102
102
|
return self.state.solver.Unconstrained(var_name, self.state.arch.bits)
|
|
103
103
|
|
|
@@ -127,7 +127,7 @@ class RegionedMemoryMixin(MemoryMixin):
|
|
|
127
127
|
# address_wrappers is empty - we cannot concretize the address in static mode.
|
|
128
128
|
# ensure val is not None
|
|
129
129
|
val = self.state.solver.Unconstrained(
|
|
130
|
-
"invalid_read_
|
|
130
|
+
f"invalid_read_{next(invalid_read_ctr)}_{size}", size * self.state.arch.byte_width
|
|
131
131
|
)
|
|
132
132
|
|
|
133
133
|
return val
|
|
@@ -225,7 +225,7 @@ class RegionedMemoryMixin(MemoryMixin):
|
|
|
225
225
|
if region_id not in region_ids:
|
|
226
226
|
return region_id
|
|
227
227
|
for i in range(2000):
|
|
228
|
-
new_region_id = region_id
|
|
228
|
+
new_region_id = f"{region_id}_{i}"
|
|
229
229
|
if new_region_id not in region_ids:
|
|
230
230
|
return new_region_id
|
|
231
231
|
raise SimMemoryError(f"Cannot allocate region ID for function {function_address:#08x} - recursion too deep")
|
angr/storage/memory_object.py
CHANGED
|
@@ -21,13 +21,13 @@ class SimMemoryObject:
|
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
23
|
__slots__ = (
|
|
24
|
-
"is_bytes",
|
|
25
24
|
"_byte_width",
|
|
25
|
+
"_concrete_bytes",
|
|
26
26
|
"base",
|
|
27
|
-
"object",
|
|
28
|
-
"length",
|
|
29
27
|
"endness",
|
|
30
|
-
"
|
|
28
|
+
"is_bytes",
|
|
29
|
+
"length",
|
|
30
|
+
"object",
|
|
31
31
|
)
|
|
32
32
|
|
|
33
33
|
def __init__(self, obj, base, endness, length=None, byte_width=8):
|
angr/utils/__init__.py
CHANGED
angr/utils/bits.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import claripy
|
|
4
|
+
|
|
3
5
|
|
|
4
6
|
def truncate_bits(value: int, nbits: int) -> int:
|
|
5
7
|
"""
|
|
@@ -19,3 +21,13 @@ def ffs(x: int) -> int:
|
|
|
19
21
|
def sign_extend(value: int, bits: int) -> int:
|
|
20
22
|
sign_bit = 1 << (bits - 1)
|
|
21
23
|
return (value & (sign_bit - 1)) - (value & sign_bit)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def zeroextend_on_demand(op0: claripy.ast.BV, op1: claripy.ast.BV) -> claripy.ast.BV:
|
|
27
|
+
"""
|
|
28
|
+
ZeroExtend op1 if the size of op1 is smaller than the size of op0. Otherwise, return op1.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
if op0.size() > op1.size():
|
|
32
|
+
return claripy.ZeroExt(op0.size() - op1.size(), op1)
|
|
33
|
+
return op1
|
angr/utils/dynamic_dictlist.py
CHANGED
|
@@ -19,7 +19,7 @@ class DynamicDictList(Generic[VT]):
|
|
|
19
19
|
https://github.com/angr/angr/pull/3471#issuecomment-1236515950.
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
|
-
__slots__ = ("
|
|
22
|
+
__slots__ = ("dict_content", "list_content", "max_size")
|
|
23
23
|
|
|
24
24
|
def __init__(
|
|
25
25
|
self,
|
angr/utils/graph.py
CHANGED
|
@@ -572,7 +572,7 @@ class SCCPlaceholder:
|
|
|
572
572
|
return isinstance(other, SCCPlaceholder) and other.scc_id == self.scc_id
|
|
573
573
|
|
|
574
574
|
def __hash__(self):
|
|
575
|
-
return hash("scc_placeholder_
|
|
575
|
+
return hash(f"scc_placeholder_{self.scc_id}")
|
|
576
576
|
|
|
577
577
|
|
|
578
578
|
class GraphUtils:
|
angr/utils/orderedset.py
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
from typing import Generic, TypeVar
|
|
2
3
|
import collections.abc
|
|
3
4
|
|
|
5
|
+
T = TypeVar("T")
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
|
|
8
|
+
class OrderedSet(Generic[T], collections.abc.MutableSet[T]):
|
|
6
9
|
"""
|
|
7
10
|
Adapted from http://code.activestate.com/recipes/576694/
|
|
8
11
|
Originally created by Raymond Hettinger and licensed under MIT.
|
angr/utils/segment_list.py
CHANGED
|
@@ -13,7 +13,7 @@ class Segment:
|
|
|
13
13
|
Representing a memory block. This is not the "Segment" in ELF memory model
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
|
-
__slots__ = ["
|
|
16
|
+
__slots__ = ["end", "sort", "start"]
|
|
17
17
|
|
|
18
18
|
def __init__(self, start, end, sort):
|
|
19
19
|
"""
|
|
@@ -56,7 +56,7 @@ class SegmentList:
|
|
|
56
56
|
blocks or not, and obtain the exact block(segment) that the address belongs to.
|
|
57
57
|
"""
|
|
58
58
|
|
|
59
|
-
__slots__ = ["
|
|
59
|
+
__slots__ = ["_bytes_occupied", "_list"]
|
|
60
60
|
|
|
61
61
|
def __init__(self):
|
|
62
62
|
self._list: list[Segment] = []
|
angr/utils/ssa/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from collections import defaultdict
|
|
3
|
-
from typing import Any
|
|
3
|
+
from typing import Any, Literal, overload
|
|
4
4
|
|
|
5
5
|
import archinfo
|
|
6
6
|
from ailment import Expression, Block
|
|
@@ -14,6 +14,19 @@ from .vvar_uses_collector import VVarUsesCollector
|
|
|
14
14
|
from .tmp_uses_collector import TmpUsesCollector
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
DEPHI_VVAR_REG_OFFSET = 4096
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@overload
|
|
21
|
+
def get_reg_offset_base_and_size(
|
|
22
|
+
reg_offset: int, arch: archinfo.Arch, size: int | None = None, resilient: Literal[True] = True
|
|
23
|
+
) -> tuple[int, int]: ...
|
|
24
|
+
@overload
|
|
25
|
+
def get_reg_offset_base_and_size(
|
|
26
|
+
reg_offset: int, arch: archinfo.Arch, size: int | None = None, resilient: Literal[False] = False
|
|
27
|
+
) -> tuple[int, int] | None: ...
|
|
28
|
+
|
|
29
|
+
|
|
17
30
|
def get_reg_offset_base_and_size(
|
|
18
31
|
reg_offset: int, arch: archinfo.Arch, size: int | None = None, resilient: bool = True
|
|
19
32
|
) -> tuple[int, int] | None:
|
|
@@ -34,9 +47,17 @@ def get_reg_offset_base_and_size(
|
|
|
34
47
|
return base_reg_and_size
|
|
35
48
|
|
|
36
49
|
|
|
50
|
+
@overload
|
|
37
51
|
def get_reg_offset_base(
|
|
38
|
-
reg_offset: int, arch: archinfo.Arch, size: int | None = None, resilient:
|
|
39
|
-
) -> int
|
|
52
|
+
reg_offset: int, arch: archinfo.Arch, size: int | None = None, resilient: Literal[True] = True
|
|
53
|
+
) -> int: ...
|
|
54
|
+
@overload
|
|
55
|
+
def get_reg_offset_base(
|
|
56
|
+
reg_offset: int, arch: archinfo.Arch, size: int | None = None, resilient: Literal[False] = False
|
|
57
|
+
) -> int | None: ...
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def get_reg_offset_base(reg_offset, arch, size=None, resilient=True):
|
|
40
61
|
"""
|
|
41
62
|
Translate a given register offset into the offset of its full register.
|
|
42
63
|
|
|
@@ -188,16 +209,20 @@ def phi_assignment_get_src(stmt: Statement) -> Phi | None:
|
|
|
188
209
|
return None
|
|
189
210
|
|
|
190
211
|
|
|
212
|
+
def is_dephi_vvar(vvar: VirtualVariable) -> bool:
|
|
213
|
+
return vvar.varid == DEPHI_VVAR_REG_OFFSET
|
|
214
|
+
|
|
215
|
+
|
|
191
216
|
__all__ = (
|
|
192
217
|
"VVarUsesCollector",
|
|
218
|
+
"get_tmp_deflocs",
|
|
219
|
+
"get_tmp_uselocs",
|
|
193
220
|
"get_vvar_deflocs",
|
|
194
221
|
"get_vvar_uselocs",
|
|
195
|
-
"is_const_assignment",
|
|
196
|
-
"is_phi_assignment",
|
|
197
|
-
"phi_assignment_get_src",
|
|
198
222
|
"is_const_and_vvar_assignment",
|
|
223
|
+
"is_const_assignment",
|
|
199
224
|
"is_const_vvar_load_assignment",
|
|
200
225
|
"is_const_vvar_load_dirty_assignment",
|
|
201
|
-
"
|
|
202
|
-
"
|
|
226
|
+
"is_phi_assignment",
|
|
227
|
+
"phi_assignment_get_src",
|
|
203
228
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: angr
|
|
3
|
-
Version: 9.2.
|
|
3
|
+
Version: 9.2.133
|
|
4
4
|
Summary: A multi-architecture binary analysis toolkit, with the ability to perform dynamic symbolic execution and various static analyses on binaries
|
|
5
5
|
Home-page: https://github.com/angr/angr
|
|
6
6
|
License: BSD-2-Clause
|
|
@@ -16,13 +16,13 @@ Description-Content-Type: text/markdown
|
|
|
16
16
|
License-File: LICENSE
|
|
17
17
|
Requires-Dist: CppHeaderParser
|
|
18
18
|
Requires-Dist: GitPython
|
|
19
|
-
Requires-Dist: ailment==9.2.
|
|
20
|
-
Requires-Dist: archinfo==9.2.
|
|
19
|
+
Requires-Dist: ailment==9.2.133
|
|
20
|
+
Requires-Dist: archinfo==9.2.133
|
|
21
21
|
Requires-Dist: cachetools
|
|
22
22
|
Requires-Dist: capstone==5.0.3
|
|
23
23
|
Requires-Dist: cffi>=1.14.0
|
|
24
|
-
Requires-Dist: claripy==9.2.
|
|
25
|
-
Requires-Dist: cle==9.2.
|
|
24
|
+
Requires-Dist: claripy==9.2.133
|
|
25
|
+
Requires-Dist: cle==9.2.133
|
|
26
26
|
Requires-Dist: itanium-demangler
|
|
27
27
|
Requires-Dist: mulpyplexer
|
|
28
28
|
Requires-Dist: nampa
|
|
@@ -31,7 +31,7 @@ Requires-Dist: protobuf>=5.28.2
|
|
|
31
31
|
Requires-Dist: psutil
|
|
32
32
|
Requires-Dist: pycparser>=2.18
|
|
33
33
|
Requires-Dist: pyformlang
|
|
34
|
-
Requires-Dist: pyvex==9.2.
|
|
34
|
+
Requires-Dist: pyvex==9.2.133
|
|
35
35
|
Requires-Dist: rich>=13.1.0
|
|
36
36
|
Requires-Dist: sortedcontainers
|
|
37
37
|
Requires-Dist: sympy
|