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
angr/slicer.py
CHANGED
|
@@ -11,10 +11,10 @@ class SimLightState:
|
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
13
|
__slots__ = (
|
|
14
|
-
"
|
|
14
|
+
"options",
|
|
15
15
|
"regs",
|
|
16
16
|
"stack_offsets",
|
|
17
|
-
"
|
|
17
|
+
"temps",
|
|
18
18
|
)
|
|
19
19
|
|
|
20
20
|
def __init__(self, temps=None, regs=None, stack_offsets=None, options=None):
|
|
@@ -155,11 +155,8 @@ class SimSlicer:
|
|
|
155
155
|
def _forward_handler_expr_Get(self, expr, state):
|
|
156
156
|
reg = expr.offset
|
|
157
157
|
|
|
158
|
-
if (
|
|
159
|
-
state.options["
|
|
160
|
-
and reg == self._arch.sp_offset
|
|
161
|
-
or state.options["mock_bp"]
|
|
162
|
-
and reg == self._arch.bp_offset
|
|
158
|
+
if (state.options["mock_sp"] and reg == self._arch.sp_offset) or (
|
|
159
|
+
state.options["mock_bp"] and reg == self._arch.bp_offset
|
|
163
160
|
):
|
|
164
161
|
return state.regs[reg]
|
|
165
162
|
|
angr/state_plugins/__init__.py
CHANGED
|
@@ -31,56 +31,56 @@ from .debug_variables import SimDebugVariable, SimDebugVariablePlugin
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
__all__ = (
|
|
34
|
-
"SimStatePlugin",
|
|
35
|
-
"SimStateLibc",
|
|
36
|
-
"SimInspector",
|
|
37
|
-
"NO_OVERRIDE",
|
|
38
|
-
"BP_BEFORE",
|
|
39
34
|
"BP_AFTER",
|
|
35
|
+
"BP_BEFORE",
|
|
40
36
|
"BP_BOTH",
|
|
41
37
|
"BP_IPDB",
|
|
42
38
|
"BP_IPYTHON",
|
|
39
|
+
"GDB",
|
|
40
|
+
"NO_OVERRIDE",
|
|
41
|
+
"CallStack",
|
|
42
|
+
"Concrete",
|
|
43
|
+
"PTChunk",
|
|
44
|
+
"PTChunkIterator",
|
|
43
45
|
"PosixDevFS",
|
|
44
46
|
"PosixProcFS",
|
|
45
|
-
"SimSystemPosix",
|
|
46
|
-
"SimSolver",
|
|
47
|
-
"SimLightRegisters",
|
|
48
|
-
"SimStateLog",
|
|
49
|
-
"SimStateHistory",
|
|
50
|
-
"SimStateScratch",
|
|
51
|
-
"SimStateCGC",
|
|
52
|
-
"GDB",
|
|
53
|
-
"SimUCManager",
|
|
54
|
-
"Unicorn",
|
|
55
47
|
"SimAction",
|
|
56
|
-
"SimActionExit",
|
|
57
48
|
"SimActionConstraint",
|
|
58
|
-
"SimActionOperation",
|
|
59
49
|
"SimActionData",
|
|
50
|
+
"SimActionExit",
|
|
60
51
|
"SimActionObject",
|
|
52
|
+
"SimActionOperation",
|
|
53
|
+
"SimDebugVariable",
|
|
54
|
+
"SimDebugVariablePlugin",
|
|
61
55
|
"SimEvent",
|
|
62
|
-
"resource_event",
|
|
63
|
-
"CallStack",
|
|
64
|
-
"SimStateGlobals",
|
|
65
|
-
"SimStatePreconstrainer",
|
|
66
|
-
"SimStateLoopData",
|
|
67
|
-
"SimRegNameView",
|
|
68
|
-
"SimMemView",
|
|
69
|
-
"StructMode",
|
|
70
|
-
"Stat",
|
|
71
56
|
"SimFilesystem",
|
|
72
|
-
"SimMount",
|
|
73
|
-
"SimHostFilesystem",
|
|
74
57
|
"SimHeapBase",
|
|
75
58
|
"SimHeapBrk",
|
|
76
59
|
"SimHeapLibc",
|
|
77
60
|
"SimHeapPTMalloc",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"Concrete",
|
|
81
|
-
"SimStateJNIReferences",
|
|
61
|
+
"SimHostFilesystem",
|
|
62
|
+
"SimInspector",
|
|
82
63
|
"SimJavaVmClassloader",
|
|
64
|
+
"SimLightRegisters",
|
|
65
|
+
"SimMemView",
|
|
66
|
+
"SimMount",
|
|
67
|
+
"SimRegNameView",
|
|
68
|
+
"SimSolver",
|
|
69
|
+
"SimStateCGC",
|
|
70
|
+
"SimStateGlobals",
|
|
71
|
+
"SimStateHistory",
|
|
72
|
+
"SimStateJNIReferences",
|
|
73
|
+
"SimStateLibc",
|
|
74
|
+
"SimStateLog",
|
|
75
|
+
"SimStateLoopData",
|
|
76
|
+
"SimStatePlugin",
|
|
77
|
+
"SimStatePreconstrainer",
|
|
78
|
+
"SimStateScratch",
|
|
83
79
|
"SimSymbolizer",
|
|
84
|
-
"
|
|
85
|
-
"
|
|
80
|
+
"SimSystemPosix",
|
|
81
|
+
"SimUCManager",
|
|
82
|
+
"Stat",
|
|
83
|
+
"StructMode",
|
|
84
|
+
"Unicorn",
|
|
85
|
+
"resource_event",
|
|
86
86
|
)
|
angr/state_plugins/callstack.py
CHANGED
|
@@ -119,14 +119,11 @@ class CallStack(SimStatePlugin):
|
|
|
119
119
|
:return: A printable representation of the CallStack object
|
|
120
120
|
:rtype: str
|
|
121
121
|
"""
|
|
122
|
-
return "<CallStack (depth
|
|
122
|
+
return f"<CallStack (depth {len(self)})>"
|
|
123
123
|
|
|
124
124
|
def __str__(self):
|
|
125
|
-
return "Backtrace:\n
|
|
126
|
-
"
|
|
127
|
-
"Frame %d: %#x => %#x, sp = %#x" % (i, f.call_site_addr, f.func_addr, f.stack_ptr)
|
|
128
|
-
for i, f in enumerate(self)
|
|
129
|
-
)
|
|
125
|
+
return "Backtrace:\n" + "\n".join(
|
|
126
|
+
f"Frame {i}: {f.call_site_addr:#x} => {f.func_addr:#x}, sp = {f.stack_ptr:#x}" for i, f in enumerate(self)
|
|
130
127
|
)
|
|
131
128
|
|
|
132
129
|
def __eq__(self, other):
|
|
@@ -319,13 +316,9 @@ class CallStack(SimStatePlugin):
|
|
|
319
316
|
|
|
320
317
|
stack = []
|
|
321
318
|
for i, frame in enumerate(self):
|
|
322
|
-
|
|
323
|
-
i,
|
|
324
|
-
"None" if frame.call_site_addr is None else f"{frame.call_site_addr:#x}",
|
|
325
|
-
"None" if frame.func_addr is None else f"{frame.func_addr:#x}",
|
|
326
|
-
"None" if frame.current_return_target is None else f"{frame.current_return_target:#x}",
|
|
319
|
+
stack.append(
|
|
320
|
+
f"{i} | {frame.call_site_addr:#x} -> {frame.func_addr:#x}, returning to {frame.current_return_target:#x}"
|
|
327
321
|
)
|
|
328
|
-
stack.append(s)
|
|
329
322
|
|
|
330
323
|
return "\n".join(stack)
|
|
331
324
|
|
|
@@ -6,10 +6,10 @@ from .heap_libc import SimHeapLibc
|
|
|
6
6
|
from .heap_ptmalloc import SimHeapPTMalloc, PTChunk, PTChunkIterator
|
|
7
7
|
|
|
8
8
|
__all__ = (
|
|
9
|
+
"PTChunk",
|
|
10
|
+
"PTChunkIterator",
|
|
9
11
|
"SimHeapBase",
|
|
10
12
|
"SimHeapBrk",
|
|
11
13
|
"SimHeapLibc",
|
|
12
14
|
"SimHeapPTMalloc",
|
|
13
|
-
"PTChunk",
|
|
14
|
-
"PTChunkIterator",
|
|
15
15
|
)
|
|
@@ -90,10 +90,8 @@ class SimHeapBrk(SimHeapBase):
|
|
|
90
90
|
|
|
91
91
|
final_size = size * nmemb
|
|
92
92
|
|
|
93
|
-
if (
|
|
94
|
-
self.state.solver.symbolic(
|
|
95
|
-
or self.state.solver.symbolic(sim_size)
|
|
96
|
-
and final_size > plugin.max_variable_size
|
|
93
|
+
if self.state.solver.symbolic(sim_nmemb) or (
|
|
94
|
+
self.state.solver.symbolic(sim_size) and final_size > plugin.max_variable_size
|
|
97
95
|
):
|
|
98
96
|
final_size = plugin.max_variable_size
|
|
99
97
|
|
|
@@ -75,7 +75,7 @@ class PTChunk(Chunk):
|
|
|
75
75
|
next_chunk.set_prev_freeness(is_free)
|
|
76
76
|
else:
|
|
77
77
|
self.heap._set_final_freeness(is_free)
|
|
78
|
-
if (is_free is not None and is_free or self.is_free()) and next_chunk is not None:
|
|
78
|
+
if ((is_free is not None and is_free) or self.is_free()) and next_chunk is not None:
|
|
79
79
|
self.state.memory.store(next_chunk.base, size, size=self.state.arch.bytes)
|
|
80
80
|
|
|
81
81
|
def set_prev_freeness(self, is_free):
|
|
@@ -30,8 +30,9 @@ class SimStateJNIReferences(SimStatePlugin):
|
|
|
30
30
|
if opaque_ref_value in self.global_refs:
|
|
31
31
|
return self.global_refs[opaque_ref_value]
|
|
32
32
|
raise KeyError(
|
|
33
|
-
"Unknown JNI reference
|
|
34
|
-
|
|
33
|
+
f"Unknown JNI reference {opaque_ref_value}. "
|
|
34
|
+
f"Local references: {self.local_refs} "
|
|
35
|
+
f"Global references: {self.global_refs}"
|
|
35
36
|
)
|
|
36
37
|
|
|
37
38
|
def create_new_reference(self, obj, global_ref=False):
|
angr/state_plugins/scratch.py
CHANGED
|
@@ -108,7 +108,7 @@ class SimStateScratch(SimStatePlugin):
|
|
|
108
108
|
v = self.temps[tmp]
|
|
109
109
|
if v is None:
|
|
110
110
|
raise SimMissingTempError(
|
|
111
|
-
"VEX temp variable
|
|
111
|
+
f"VEX temp variable {tmp} does not exist. This is usually the result of an incorrect slicing."
|
|
112
112
|
)
|
|
113
113
|
except IndexError as err:
|
|
114
114
|
raise SimMissingTempError("Accessing a temp that is illegal in this tyenv") from err
|
angr/state_plugins/sim_action.py
CHANGED
|
@@ -38,10 +38,7 @@ class SimAction(SimEvent):
|
|
|
38
38
|
if self.sim_procedure is not None:
|
|
39
39
|
location = f"{self.sim_procedure.display_name}()"
|
|
40
40
|
else:
|
|
41
|
-
if self.stmt_idx is not None:
|
|
42
|
-
location = "0x%x:%d" % (self.ins_addr, self.stmt_idx) # TODO: Revert this!
|
|
43
|
-
else:
|
|
44
|
-
location = f"0x{self.bbl_addr:x}"
|
|
41
|
+
location = f"0x{self.ins_addr:x}:{self.stmt_idx}" if self.stmt_idx is not None else f"0x{self.bbl_addr:x}"
|
|
45
42
|
return f"<{self.__class__.__name__} {location} {self._desc()}>"
|
|
46
43
|
|
|
47
44
|
def _desc(self):
|
angr/state_plugins/sim_event.py
CHANGED
|
@@ -25,7 +25,7 @@ class SimEvent:
|
|
|
25
25
|
self.arch = state.arch
|
|
26
26
|
|
|
27
27
|
def __repr__(self):
|
|
28
|
-
return "<SimEvent
|
|
28
|
+
return f"<SimEvent {self.type} {self.id}, with fields {', '.join(self.objects.keys())}>"
|
|
29
29
|
|
|
30
30
|
def _copy_event(self):
|
|
31
31
|
c = self.__class__.__new__(self.__class__)
|
angr/state_plugins/solver.py
CHANGED
|
@@ -112,7 +112,7 @@ def error_converter(f):
|
|
|
112
112
|
def _concrete_bool(e):
|
|
113
113
|
if isinstance(e, bool):
|
|
114
114
|
return e
|
|
115
|
-
if isinstance(e, claripy.ast.Base) and e.op == "BoolV" or isinstance(e, SimActionObject) and e.op == "BoolV":
|
|
115
|
+
if (isinstance(e, claripy.ast.Base) and e.op == "BoolV") or (isinstance(e, SimActionObject) and e.op == "BoolV"):
|
|
116
116
|
return e.args[0]
|
|
117
117
|
return None
|
|
118
118
|
|
|
@@ -302,10 +302,8 @@ class SimSolver(SimStatePlugin):
|
|
|
302
302
|
elif o.SYMBOLIC in self.state.options and o.COMPOSITE_SOLVER in self.state.options:
|
|
303
303
|
self._stored_solver = claripy.SolverComposite(track=track)
|
|
304
304
|
elif (
|
|
305
|
-
o.SYMBOLIC in self.state.options
|
|
306
|
-
|
|
307
|
-
or o.HYBRID_SOLVER in self.state.options
|
|
308
|
-
):
|
|
305
|
+
o.SYMBOLIC in self.state.options and any(opt in self.state.options for opt in o.approximation)
|
|
306
|
+
) or o.HYBRID_SOLVER in self.state.options:
|
|
309
307
|
self._stored_solver = claripy.SolverHybrid(track=track, approximate_first=approximate_first)
|
|
310
308
|
elif o.SYMBOLIC in self.state.options:
|
|
311
309
|
self._stored_solver = claripy.Solver(track=track)
|
|
@@ -856,7 +854,7 @@ class SimSolver(SimStatePlugin):
|
|
|
856
854
|
|
|
857
855
|
cast_vals = [self._cast_to(e, v, cast_to) for v in self._eval(e, n, **kwargs)]
|
|
858
856
|
if len(cast_vals) == 0:
|
|
859
|
-
raise SimUnsatError("Not satisfiable:
|
|
857
|
+
raise SimUnsatError(f"Not satisfiable: {e.shallow_repr()}, expected up to {n} solutions")
|
|
860
858
|
return cast_vals
|
|
861
859
|
|
|
862
860
|
@overload
|
|
@@ -967,7 +965,7 @@ class SimSolver(SimStatePlugin):
|
|
|
967
965
|
"""
|
|
968
966
|
r = self.eval_upto(e, n + 1, cast_to, **kwargs)
|
|
969
967
|
if len(r) > n:
|
|
970
|
-
raise SimValueError("Concretized
|
|
968
|
+
raise SimValueError(f"Concretized {len(r)} values (must be at most {n}) in eval_atmost")
|
|
971
969
|
return r
|
|
972
970
|
|
|
973
971
|
@overload
|
|
@@ -1002,7 +1000,7 @@ class SimSolver(SimStatePlugin):
|
|
|
1002
1000
|
"""
|
|
1003
1001
|
r = self.eval_upto(e, n, cast_to, **kwargs)
|
|
1004
1002
|
if len(r) != n:
|
|
1005
|
-
raise SimValueError("Concretized
|
|
1003
|
+
raise SimValueError(f"Concretized {len(r)} values (must be at least {n}) in eval_atleast")
|
|
1006
1004
|
return r
|
|
1007
1005
|
|
|
1008
1006
|
@overload
|
|
@@ -1038,7 +1036,7 @@ class SimSolver(SimStatePlugin):
|
|
|
1038
1036
|
"""
|
|
1039
1037
|
r = self.eval_upto(e, n + 1, cast_to, **kwargs)
|
|
1040
1038
|
if len(r) != n:
|
|
1041
|
-
raise SimValueError("Concretized
|
|
1039
|
+
raise SimValueError(f"Concretized {len(r)} values (must be exactly {n}) in eval_exact")
|
|
1042
1040
|
return r
|
|
1043
1041
|
|
|
1044
1042
|
min_int = min
|
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):
|
|
@@ -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
|