angr 9.2.132__py3-none-manylinux2014_x86_64.whl → 9.2.134__py3-none-manylinux2014_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of angr might be problematic. Click here for more details.
- angr/__init__.py +128 -128
- angr/analyses/__init__.py +38 -38
- 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_fast.py +17 -15
- 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 +15 -13
- angr/analyses/data_dep/__init__.py +4 -4
- angr/analyses/datagraph_meta.py +1 -1
- angr/analyses/ddg.py +2 -6
- angr/analyses/decompiler/__init__.py +12 -12
- angr/analyses/decompiler/ail_simplifier.py +21 -10
- angr/analyses/decompiler/block_similarity.py +2 -4
- angr/analyses/decompiler/callsite_maker.py +1 -1
- angr/analyses/decompiler/ccall_rewriters/rewriter_base.py +1 -1
- angr/analyses/decompiler/clinic.py +14 -7
- angr/analyses/decompiler/condition_processor.py +45 -29
- 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_vvar_mapping.py +11 -3
- 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/deadblock_remover.py +1 -2
- 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 +1 -1
- angr/analyses/decompiler/optimization_passes/inlined_string_transformation_simplifier.py +2 -4
- 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 +9 -3
- angr/analyses/decompiler/optimization_passes/optimization_pass.py +3 -0
- 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/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_engine.py +1 -1
- 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 +49 -42
- angr/analyses/decompiler/structuring/__init__.py +3 -3
- angr/analyses/decompiler/structuring/phoenix.py +19 -20
- angr/analyses/decompiler/structuring/structurer_base.py +2 -2
- angr/analyses/decompiler/structuring/structurer_nodes.py +14 -14
- angr/analyses/deobfuscator/__init__.py +3 -3
- 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/loop_analysis.py +1 -1
- angr/analyses/loopfinder.py +1 -1
- angr/analyses/propagator/outdated_definition_walker.py +12 -6
- angr/analyses/propagator/vex_vars.py +3 -3
- angr/analyses/reaching_definitions/__init__.py +9 -9
- angr/analyses/reaching_definitions/call_trace.py +2 -2
- angr/analyses/reaching_definitions/function_handler_library/__init__.py +1 -1
- angr/analyses/reaching_definitions/rd_state.py +10 -10
- angr/analyses/reassembler.py +26 -31
- angr/analyses/s_liveness.py +8 -0
- angr/analyses/s_reaching_definitions/s_rda_view.py +2 -5
- angr/analyses/stack_pointer_tracker.py +4 -4
- angr/analyses/typehoon/simple_solver.py +7 -9
- angr/analyses/typehoon/translator.py +2 -2
- angr/analyses/typehoon/typeconsts.py +1 -1
- angr/analyses/typehoon/typevars.py +17 -19
- angr/analyses/unpacker/__init__.py +1 -1
- angr/analyses/variable_recovery/engine_base.py +3 -4
- angr/analyses/variable_recovery/variable_recovery_base.py +1 -1
- angr/analyses/variable_recovery/variable_recovery_fast.py +2 -6
- angr/analyses/veritesting.py +2 -2
- angr/analyses/vfg.py +5 -5
- angr/angrdb/serializers/__init__.py +1 -1
- angr/annocfg.py +1 -1
- angr/blade.py +2 -2
- angr/block.py +16 -16
- angr/calling_conventions.py +11 -13
- angr/code_location.py +6 -10
- angr/codenode.py +3 -3
- angr/engines/__init__.py +12 -14
- angr/engines/engine.py +1 -54
- angr/engines/light/__init__.py +4 -4
- angr/engines/light/data.py +1 -1
- angr/engines/pcode/__init__.py +1 -1
- angr/engines/pcode/behavior.py +1 -1
- 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 +2 -5
- angr/engines/vex/__init__.py +5 -5
- angr/engines/vex/claripy/ccall.py +2 -2
- angr/engines/vex/claripy/irop.py +18 -18
- 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 +3 -3
- angr/exploration_techniques/__init__.py +18 -18
- angr/exploration_techniques/threading.py +0 -6
- 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 +6 -6
- angr/knowledge_plugins/key_definitions/definition.py +1 -1
- angr/knowledge_plugins/key_definitions/live_definitions.py +14 -14
- 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 +31 -31
- angr/knowledge_plugins/variables/variable_access.py +2 -2
- angr/knowledge_plugins/variables/variable_manager.py +1 -1
- 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 +2 -2
- angr/sim_state.py +1 -1
- angr/sim_state_options.py +3 -3
- angr/sim_type.py +10 -14
- angr/sim_variable.py +13 -17
- 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 +3 -3
- 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/dynamic_dictlist.py +1 -1
- angr/utils/graph.py +1 -1
- angr/utils/segment_list.py +2 -2
- angr/utils/ssa/__init__.py +12 -5
- {angr-9.2.132.dist-info → angr-9.2.134.dist-info}/METADATA +6 -6
- {angr-9.2.132.dist-info → angr-9.2.134.dist-info}/RECORD +202 -202
- {angr-9.2.132.dist-info → angr-9.2.134.dist-info}/LICENSE +0 -0
- {angr-9.2.132.dist-info → angr-9.2.134.dist-info}/WHEEL +0 -0
- {angr-9.2.132.dist-info → angr-9.2.134.dist-info}/entry_points.txt +0 -0
- {angr-9.2.132.dist-info → angr-9.2.134.dist-info}/top_level.txt +0 -0
angr/state_plugins/uc_manager.py
CHANGED
|
@@ -48,7 +48,7 @@ class SimUCManager(SimStatePlugin):
|
|
|
48
48
|
dst_uc_alloc_depth = self._uc_alloc_depth[dst_addr_ast]
|
|
49
49
|
if dst_uc_alloc_depth > self._max_alloc_depth:
|
|
50
50
|
raise SimUCManagerAllocationError(
|
|
51
|
-
"Current allocation depth
|
|
51
|
+
f"Current allocation depth {dst_uc_alloc_depth} is greater than the cap ({self._max_alloc_depth})"
|
|
52
52
|
)
|
|
53
53
|
|
|
54
54
|
abs_addr = self._region_base + self._pos
|
angr/state_plugins/view.py
CHANGED
|
@@ -90,8 +90,8 @@ class SimRegNameView(SimStatePlugin):
|
|
|
90
90
|
if self.state.arch.name in ("X86", "AMD64"):
|
|
91
91
|
return (
|
|
92
92
|
list(self.state.arch.registers.keys())
|
|
93
|
-
+ ["st
|
|
94
|
-
+ ["tag
|
|
93
|
+
+ [f"st{n}" for n in range(8)]
|
|
94
|
+
+ [f"tag{n}" for n in range(8)]
|
|
95
95
|
+ ["flags", "eflags", "rflags"]
|
|
96
96
|
)
|
|
97
97
|
if is_arm_arch(self.state.arch):
|
angr/storage/__init__.py
CHANGED
angr/storage/file.py
CHANGED
|
@@ -109,7 +109,7 @@ class SimFileBase(SimStatePlugin):
|
|
|
109
109
|
yield "?"
|
|
110
110
|
|
|
111
111
|
nice_name = "".join(generate())
|
|
112
|
-
return "file_
|
|
112
|
+
return f"file_{next(file_counter)}_{nice_name}"
|
|
113
113
|
|
|
114
114
|
def concretize(self, **kwargs):
|
|
115
115
|
"""
|
|
@@ -250,7 +250,7 @@ class SimFile(SimFileBase, DefaultMemory): # TODO: pick a better base class omg
|
|
|
250
250
|
if type(self._size) is int:
|
|
251
251
|
self._size = claripy.BVV(self._size, state.arch.bits)
|
|
252
252
|
elif len(self._size) != state.arch.bits:
|
|
253
|
-
raise TypeError("SimFile size must be a bitvector of size
|
|
253
|
+
raise TypeError(f"SimFile size must be a bitvector of size {state.arch.bits} (arch.bits)")
|
|
254
254
|
|
|
255
255
|
@property
|
|
256
256
|
def size(self):
|
|
@@ -379,7 +379,7 @@ class SimFileStream(SimFile):
|
|
|
379
379
|
if type(self.pos) is int:
|
|
380
380
|
self.pos = claripy.BVV(self.pos, state.arch.bits)
|
|
381
381
|
elif len(self.pos) != state.arch.bits:
|
|
382
|
-
raise TypeError("SimFileStream position must be a bitvector of size
|
|
382
|
+
raise TypeError(f"SimFileStream position must be a bitvector of size {state.arch.bits} (arch.bits)")
|
|
383
383
|
|
|
384
384
|
def read(self, pos, size, **kwargs):
|
|
385
385
|
no_stream = kwargs.pop("no_stream", False)
|
|
@@ -509,9 +509,9 @@ class SimPackets(SimFileBase):
|
|
|
509
509
|
if pos is None:
|
|
510
510
|
pos = len(self.content)
|
|
511
511
|
if pos < 0:
|
|
512
|
-
raise SimFileError("SimPacket.read(
|
|
512
|
+
raise SimFileError(f"SimPacket.read({pos}): Negative packet number?")
|
|
513
513
|
if pos > len(self.content):
|
|
514
|
-
raise SimFileError("SimPacket.read(
|
|
514
|
+
raise SimFileError(f"SimPacket.read({pos}): Packet number is past frontier of {len(self.content)}?")
|
|
515
515
|
if pos != len(self.content):
|
|
516
516
|
_, realsize = self.content[pos]
|
|
517
517
|
self.state.add_constraints(realsize <= size) # assert that the packet fits within the read request
|
|
@@ -533,7 +533,7 @@ class SimPackets(SimFileBase):
|
|
|
533
533
|
# if short reads are enabled, replace size with a symbol
|
|
534
534
|
if short_reads is True or (short_reads is None and sim_options.SHORT_READS in self.state.options):
|
|
535
535
|
size = self.state.solver.BVS(
|
|
536
|
-
"packetsize_
|
|
536
|
+
f"packetsize_{len(self.content)}_{self.ident}",
|
|
537
537
|
self.state.arch.bits,
|
|
538
538
|
key=("file", self.ident, "packetsize", len(self.content)),
|
|
539
539
|
)
|
|
@@ -561,7 +561,7 @@ class SimPackets(SimFileBase):
|
|
|
561
561
|
|
|
562
562
|
# generate the packet data and return it
|
|
563
563
|
data = self.state.solver.BVS(
|
|
564
|
-
"packet_
|
|
564
|
+
f"packet_{len(self.content)}_{self.ident}",
|
|
565
565
|
max_size * self.state.arch.byte_width,
|
|
566
566
|
key=("file", self.ident, "packet", len(self.content)),
|
|
567
567
|
)
|
|
@@ -601,9 +601,9 @@ class SimPackets(SimFileBase):
|
|
|
601
601
|
if pos is None:
|
|
602
602
|
pos = len(self.content)
|
|
603
603
|
if pos < 0:
|
|
604
|
-
raise SimFileError("SimPacket.write(
|
|
604
|
+
raise SimFileError(f"SimPacket.write({pos}): Negative packet number?")
|
|
605
605
|
if pos > len(self.content):
|
|
606
|
-
raise SimFileError("SimPacket.write(
|
|
606
|
+
raise SimFileError(f"SimPacket.write({pos}): Packet number is past frontier of {len(self.content)}?")
|
|
607
607
|
if pos != len(self.content):
|
|
608
608
|
realdata, realsize = self.content[pos]
|
|
609
609
|
maxlen = max(len(realdata), len(data))
|
|
@@ -1171,7 +1171,7 @@ class SimPacketsSlots(SimFileBase):
|
|
|
1171
1171
|
self.read_sizes.pop(0)
|
|
1172
1172
|
|
|
1173
1173
|
data = self.state.solver.BVS(
|
|
1174
|
-
"packet_
|
|
1174
|
+
f"packet_{len(self.read_data)}_{self.ident}",
|
|
1175
1175
|
real_size * self.state.arch.byte_width,
|
|
1176
1176
|
key=("file", self.ident, "packet", len(self.read_data)),
|
|
1177
1177
|
)
|
|
@@ -249,69 +249,69 @@ SimState.register_default("javavm_memory", JavaVmMemory)
|
|
|
249
249
|
|
|
250
250
|
|
|
251
251
|
__all__ = (
|
|
252
|
+
"AbstractMemory",
|
|
253
|
+
"AbstractMergerMixin",
|
|
252
254
|
"ActionsMixinHigh",
|
|
253
255
|
"ActionsMixinLow",
|
|
254
256
|
"AddressConcretizationMixin",
|
|
255
|
-
"
|
|
256
|
-
"
|
|
257
|
+
"ClemoryBackerMixin",
|
|
258
|
+
"ConcreteBackerMixin",
|
|
257
259
|
"ConditionalMixin",
|
|
258
260
|
"ConvenientMappingsMixin",
|
|
261
|
+
"CooperationBase",
|
|
262
|
+
"DataNormalizationMixin",
|
|
259
263
|
"DefaultFillerMixin",
|
|
260
|
-
"
|
|
261
|
-
"
|
|
264
|
+
"DefaultListPagesMemory",
|
|
265
|
+
"DefaultMemory",
|
|
266
|
+
"DictBackerMixin",
|
|
262
267
|
"DirtyAddrsMixin",
|
|
268
|
+
"ExplicitFillerMixin",
|
|
269
|
+
"FastMemory",
|
|
263
270
|
"HexDumperMixin",
|
|
271
|
+
"HistoryTrackingMixin",
|
|
272
|
+
"ISPOMixin",
|
|
273
|
+
"InspectMixinHigh",
|
|
274
|
+
"JavaVmMemory",
|
|
275
|
+
"JavaVmMemoryMixin",
|
|
276
|
+
"KeyValueMemory",
|
|
277
|
+
"KeyValueMemoryMixin",
|
|
264
278
|
"LabelMergerMixin",
|
|
265
|
-
"
|
|
266
|
-
"
|
|
267
|
-
"SimplificationMixin",
|
|
268
|
-
"SimpleInterfaceMixin",
|
|
269
|
-
"SizeNormalizationMixin",
|
|
270
|
-
"SizeConcretizationMixin",
|
|
271
|
-
"SmartFindMixin",
|
|
272
|
-
"SymbolicMergerMixin",
|
|
273
|
-
"TopMergerMixin",
|
|
274
|
-
"UnderconstrainedMixin",
|
|
275
|
-
"UnwrapperMixin",
|
|
276
|
-
"ClemoryBackerMixin",
|
|
277
|
-
"ConcreteBackerMixin",
|
|
278
|
-
"DictBackerMixin",
|
|
279
|
-
"PagedMemoryMixin",
|
|
279
|
+
"LabeledMemory",
|
|
280
|
+
"ListPage",
|
|
280
281
|
"ListPagesMixin",
|
|
281
|
-
"UltraPagesMixin",
|
|
282
282
|
"ListPagesWithLabelsMixin",
|
|
283
|
+
"MVListPage",
|
|
283
284
|
"MVListPagesMixin",
|
|
284
285
|
"MVListPagesWithLabelsMixin",
|
|
285
|
-
"PrivilegedPagingMixin",
|
|
286
|
-
"StackAllocationMixin",
|
|
287
|
-
"PagedMemoryMultiValueMixin",
|
|
288
|
-
"CooperationBase",
|
|
289
286
|
"MemoryObjectMixin",
|
|
290
|
-
"
|
|
291
|
-
"
|
|
292
|
-
"
|
|
293
|
-
"
|
|
287
|
+
"MemoryRegionMetaMixin",
|
|
288
|
+
"MultiValueMergerMixin",
|
|
289
|
+
"MultiValuedMemory",
|
|
290
|
+
"NameResolutionMixin",
|
|
294
291
|
"PageBase",
|
|
295
292
|
"PageType",
|
|
296
|
-
"
|
|
297
|
-
"
|
|
298
|
-
"
|
|
299
|
-
"
|
|
300
|
-
"
|
|
293
|
+
"PagedMemoryMixin",
|
|
294
|
+
"PagedMemoryMultiValueMixin",
|
|
295
|
+
"PermissionsMixin",
|
|
296
|
+
"PrivilegedPagingMixin",
|
|
297
|
+
"RefcountMixin",
|
|
301
298
|
"RegionCategoryMixin",
|
|
302
|
-
"StaticFindMixin",
|
|
303
|
-
"AbstractMergerMixin",
|
|
304
|
-
"MemoryRegionMetaMixin",
|
|
305
299
|
"RegionedAddressConcretizationMixin",
|
|
306
|
-
"KeyValueMemoryMixin",
|
|
307
|
-
"JavaVmMemoryMixin",
|
|
308
|
-
"DefaultMemory",
|
|
309
|
-
"DefaultListPagesMemory",
|
|
310
|
-
"FastMemory",
|
|
311
|
-
"AbstractMemory",
|
|
312
300
|
"RegionedMemory",
|
|
313
|
-
"
|
|
314
|
-
"
|
|
315
|
-
"
|
|
316
|
-
"
|
|
301
|
+
"RegionedMemoryMixin",
|
|
302
|
+
"SimpleInterfaceMixin",
|
|
303
|
+
"SimplificationMixin",
|
|
304
|
+
"SizeConcretizationMixin",
|
|
305
|
+
"SizeNormalizationMixin",
|
|
306
|
+
"SlottedMemoryMixin",
|
|
307
|
+
"SmartFindMixin",
|
|
308
|
+
"SpecialFillerMixin",
|
|
309
|
+
"StackAllocationMixin",
|
|
310
|
+
"StaticFindMixin",
|
|
311
|
+
"SymbolicMergerMixin",
|
|
312
|
+
"TopMergerMixin",
|
|
313
|
+
"UltraPage",
|
|
314
|
+
"UltraPagesMixin",
|
|
315
|
+
"UnderconstrainedMixin",
|
|
316
|
+
"UnwrapperMixin",
|
|
317
317
|
)
|
|
@@ -30,9 +30,7 @@ class DefaultFillerMixin(MemoryMixin):
|
|
|
30
30
|
type(addr) is int
|
|
31
31
|
and self.category == "mem"
|
|
32
32
|
and options.ZERO_FILL_UNCONSTRAINED_MEMORY in self.state.options
|
|
33
|
-
|
|
34
|
-
and options.ZERO_FILL_UNCONSTRAINED_REGISTERS in self.state.options
|
|
35
|
-
):
|
|
33
|
+
) or (self.category == "reg" and options.ZERO_FILL_UNCONSTRAINED_REGISTERS in self.state.options):
|
|
36
34
|
return claripy.BVV(0, bits)
|
|
37
35
|
|
|
38
36
|
if self.category == "reg" and type(addr) is int and addr == self.state.arch.ip_offset:
|
|
@@ -192,7 +192,7 @@ class JavaVmMemoryMixin(MemoryMixin):
|
|
|
192
192
|
self.state.add_constraints(constraint_on_start_idx)
|
|
193
193
|
|
|
194
194
|
def _store_array_element_on_heap(self, array, idx, value, value_type, store_condition=None):
|
|
195
|
-
heap_elem_id = "
|
|
195
|
+
heap_elem_id = f"{array.id}[{idx}]"
|
|
196
196
|
l.debug("Set %s to %s with condition %s", heap_elem_id, value, store_condition)
|
|
197
197
|
if store_condition is not None:
|
|
198
198
|
current_value = self._load_array_element_from_heap(array, idx)
|
|
@@ -267,7 +267,7 @@ class JavaVmMemoryMixin(MemoryMixin):
|
|
|
267
267
|
|
|
268
268
|
def _load_array_element_from_heap(self, array: SimSootValue_ArrayBaseRef, idx):
|
|
269
269
|
# try to load the element
|
|
270
|
-
heap_elem_id = "
|
|
270
|
+
heap_elem_id = f"{array.id}[{idx}]"
|
|
271
271
|
value = self.heap.load(heap_elem_id, none_if_missing=True)
|
|
272
272
|
# if it's not available, initialize it
|
|
273
273
|
if value is None:
|
|
@@ -5,8 +5,8 @@ from archinfo.arch_arm import is_arm_arch
|
|
|
5
5
|
|
|
6
6
|
from angr.storage.memory_mixins.memory_mixin import MemoryMixin
|
|
7
7
|
|
|
8
|
-
stn_map = {"st
|
|
9
|
-
tag_map = {"tag
|
|
8
|
+
stn_map = {f"st{n}": n for n in range(8)}
|
|
9
|
+
tag_map = {f"tag{n}": n for n in range(8)}
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class NameResolutionMixin(MemoryMixin):
|
|
@@ -33,7 +33,7 @@ class NameResolutionMixin(MemoryMixin):
|
|
|
33
33
|
self.store("cc_dep1", _get_flags(self.state)) # constraints cannot be added by this
|
|
34
34
|
self.store("cc_op", 0) # OP_COPY
|
|
35
35
|
return self.state.arch.registers["cc_dep1"]
|
|
36
|
-
if is_arm_arch(self.state.arch) and name == "flags":
|
|
36
|
+
if (is_arm_arch(self.state.arch) or self.state.arch.name == "AARCH64") and name == "flags":
|
|
37
37
|
if not is_write:
|
|
38
38
|
self.store("cc_dep1", _get_flags(self.state))
|
|
39
39
|
self.store("cc_op", 0)
|
|
@@ -107,9 +107,7 @@ class PagedMemoryMixin(
|
|
|
107
107
|
permissions = perms
|
|
108
108
|
break
|
|
109
109
|
|
|
110
|
-
return dict(
|
|
111
|
-
memory=self, memory_id="%s_%d" % (self.id, pageno), permissions=permissions, **self._extra_page_kwargs
|
|
112
|
-
)
|
|
110
|
+
return dict(memory=self, memory_id=f"{self.id}_{pageno}", permissions=permissions, **self._extra_page_kwargs)
|
|
113
111
|
|
|
114
112
|
def _divide_addr(self, addr: int) -> tuple[int, int]:
|
|
115
113
|
return divmod(addr, self.page_size)
|
|
@@ -34,14 +34,14 @@ from .ultra_page import UltraPage
|
|
|
34
34
|
|
|
35
35
|
__all__ = (
|
|
36
36
|
"CooperationBase",
|
|
37
|
-
"MemoryObjectMixin",
|
|
38
|
-
"ISPOMixin",
|
|
39
|
-
"RefcountMixin",
|
|
40
|
-
"PermissionsMixin",
|
|
41
37
|
"HistoryTrackingMixin",
|
|
42
|
-
"
|
|
43
|
-
"PageType",
|
|
38
|
+
"ISPOMixin",
|
|
44
39
|
"ListPage",
|
|
45
40
|
"MVListPage",
|
|
41
|
+
"MemoryObjectMixin",
|
|
42
|
+
"PageBase",
|
|
43
|
+
"PageType",
|
|
44
|
+
"PermissionsMixin",
|
|
45
|
+
"RefcountMixin",
|
|
46
46
|
"UltraPage",
|
|
47
47
|
)
|
|
@@ -263,7 +263,7 @@ class ListPage(MemoryObjectMixin, PageBase):
|
|
|
263
263
|
for c in candidates:
|
|
264
264
|
s_contains = self._contains(c, page_addr)
|
|
265
265
|
o_contains = other._contains(c, page_addr)
|
|
266
|
-
if not s_contains and o_contains or s_contains and not o_contains:
|
|
266
|
+
if (not s_contains and o_contains) or (s_contains and not o_contains):
|
|
267
267
|
differences.add(c)
|
|
268
268
|
else:
|
|
269
269
|
if self.content[c] is None:
|
|
@@ -330,7 +330,7 @@ class MVListPage(
|
|
|
330
330
|
for c in candidates:
|
|
331
331
|
s_contains = self._contains(c, page_addr)
|
|
332
332
|
o_contains = other._contains(c, page_addr)
|
|
333
|
-
if not s_contains and o_contains or s_contains and not o_contains:
|
|
333
|
+
if (not s_contains and o_contains) or (s_contains and not o_contains):
|
|
334
334
|
differences.add(c)
|
|
335
335
|
else:
|
|
336
336
|
if self.content[c] is None and self.sinkhole is not None:
|
|
@@ -430,10 +430,8 @@ class UltraPage(MemoryObjectMixin, PageBase):
|
|
|
430
430
|
return None
|
|
431
431
|
else:
|
|
432
432
|
obj = self.symbolic_data[place]
|
|
433
|
-
if (
|
|
434
|
-
obj.includes(start + page_addr)
|
|
435
|
-
or memory is not None
|
|
436
|
-
and obj.includes(start + page_addr + (1 << memory.state.arch.bits))
|
|
433
|
+
if obj.includes(start + page_addr) or (
|
|
434
|
+
memory is not None and obj.includes(start + page_addr + (1 << memory.state.arch.bits))
|
|
437
435
|
):
|
|
438
436
|
return obj
|
|
439
437
|
return None
|
|
@@ -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/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/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
|
@@ -14,6 +14,9 @@ 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
|
+
|
|
17
20
|
@overload
|
|
18
21
|
def get_reg_offset_base_and_size(
|
|
19
22
|
reg_offset: int, arch: archinfo.Arch, size: int | None = None, resilient: Literal[True] = True
|
|
@@ -206,16 +209,20 @@ def phi_assignment_get_src(stmt: Statement) -> Phi | None:
|
|
|
206
209
|
return None
|
|
207
210
|
|
|
208
211
|
|
|
212
|
+
def is_dephi_vvar(vvar: VirtualVariable) -> bool:
|
|
213
|
+
return vvar.varid == DEPHI_VVAR_REG_OFFSET
|
|
214
|
+
|
|
215
|
+
|
|
209
216
|
__all__ = (
|
|
210
217
|
"VVarUsesCollector",
|
|
218
|
+
"get_tmp_deflocs",
|
|
219
|
+
"get_tmp_uselocs",
|
|
211
220
|
"get_vvar_deflocs",
|
|
212
221
|
"get_vvar_uselocs",
|
|
213
|
-
"is_const_assignment",
|
|
214
|
-
"is_phi_assignment",
|
|
215
|
-
"phi_assignment_get_src",
|
|
216
222
|
"is_const_and_vvar_assignment",
|
|
223
|
+
"is_const_assignment",
|
|
217
224
|
"is_const_vvar_load_assignment",
|
|
218
225
|
"is_const_vvar_load_dirty_assignment",
|
|
219
|
-
"
|
|
220
|
-
"
|
|
226
|
+
"is_phi_assignment",
|
|
227
|
+
"phi_assignment_get_src",
|
|
221
228
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: angr
|
|
3
|
-
Version: 9.2.
|
|
3
|
+
Version: 9.2.134
|
|
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.134
|
|
20
|
+
Requires-Dist: archinfo==9.2.134
|
|
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.134
|
|
25
|
+
Requires-Dist: cle==9.2.134
|
|
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.134
|
|
35
35
|
Requires-Dist: rich>=13.1.0
|
|
36
36
|
Requires-Dist: sortedcontainers
|
|
37
37
|
Requires-Dist: sympy
|