angr 9.2.120__py3-none-win_amd64.whl → 9.2.121__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of angr might be problematic. Click here for more details.
- angr/__init__.py +1 -1
- angr/analyses/cfg/cfg_fast.py +2 -1
- angr/analyses/cfg/indirect_jump_resolvers/__init__.py +2 -0
- angr/analyses/cfg/indirect_jump_resolvers/default_resolvers.py +2 -0
- angr/analyses/cfg/indirect_jump_resolvers/jumptable.py +10 -6
- angr/analyses/cfg/indirect_jump_resolvers/mips_elf_fast.py +138 -367
- angr/analyses/cfg/indirect_jump_resolvers/mips_elf_got.py +148 -0
- angr/analyses/decompiler/ccall_rewriters/amd64_ccalls.py +20 -0
- angr/analyses/typehoon/typevars.py +37 -16
- angr/angrdb/db.py +1 -1
- angr/block.py +9 -1
- angr/calling_conventions.py +1 -1
- angr/engines/engine.py +8 -15
- angr/engines/pcode/lifter.py +8 -0
- angr/engines/successors.py +1 -1
- angr/engines/vex/claripy/ccall.py +1 -1
- angr/engines/vex/claripy/datalayer.py +7 -10
- angr/engines/vex/heavy/actions.py +19 -24
- angr/engines/vex/heavy/heavy.py +7 -1
- angr/engines/vex/lifter.py +3 -1
- angr/engines/vex/light/light.py +2 -2
- angr/factory.py +5 -0
- angr/knowledge_plugins/cfg/memory_data.py +1 -0
- angr/lib/angr_native.dll +0 -0
- angr/protos/cfg_pb2.py +23 -15
- angr/protos/function_pb2.py +19 -21
- angr/protos/primitives_pb2.py +46 -112
- angr/protos/variables_pb2.py +38 -114
- angr/protos/xrefs_pb2.py +17 -18
- angr/sim_state.py +2 -78
- angr/state_plugins/solver.py +72 -15
- angr/storage/__init__.py +1 -2
- angr/storage/memory_mixins/__init__.py +5 -160
- angr/storage/memory_mixins/actions_mixin.py +1 -1
- angr/storage/memory_mixins/address_concretization_mixin.py +1 -1
- angr/storage/memory_mixins/bvv_conversion_mixin.py +1 -1
- angr/storage/memory_mixins/clouseau_mixin.py +2 -1
- angr/storage/memory_mixins/conditional_store_mixin.py +1 -1
- angr/storage/memory_mixins/convenient_mappings_mixin.py +1 -1
- angr/storage/memory_mixins/default_filler_mixin.py +1 -1
- angr/storage/memory_mixins/dirty_addrs_mixin.py +2 -1
- angr/storage/memory_mixins/hex_dumper_mixin.py +1 -1
- angr/storage/memory_mixins/javavm_memory_mixin.py +1 -1
- angr/storage/memory_mixins/keyvalue_memory_mixin.py +1 -1
- angr/storage/memory_mixins/label_merger_mixin.py +1 -1
- angr/storage/memory_mixins/memory_mixin.py +163 -0
- angr/storage/memory_mixins/multi_value_merger_mixin.py +1 -1
- angr/storage/memory_mixins/name_resolution_mixin.py +3 -1
- angr/storage/memory_mixins/paged_memory/paged_memory_mixin.py +1 -1
- angr/storage/memory_mixins/paged_memory/paged_memory_multivalue_mixin.py +2 -1
- angr/storage/memory_mixins/paged_memory/pages/__init__.py +1 -1
- angr/storage/memory_mixins/paged_memory/pages/history_tracking_mixin.py +1 -1
- angr/storage/memory_mixins/paged_memory/pages/ispo_mixin.py +2 -1
- angr/storage/memory_mixins/paged_memory/pages/permissions_mixin.py +1 -1
- angr/storage/memory_mixins/paged_memory/pages/refcount_mixin.py +2 -1
- angr/storage/memory_mixins/paged_memory/pages/ultra_page.py +1 -1
- angr/storage/memory_mixins/regioned_memory/abstract_merger_mixin.py +1 -2
- angr/storage/memory_mixins/regioned_memory/region_category_mixin.py +2 -1
- angr/storage/memory_mixins/regioned_memory/region_meta_mixin.py +1 -1
- angr/storage/memory_mixins/regioned_memory/regioned_address_concretization_mixin.py +1 -1
- angr/storage/memory_mixins/regioned_memory/regioned_memory_mixin.py +2 -2
- angr/storage/memory_mixins/simple_interface_mixin.py +2 -1
- angr/storage/memory_mixins/simplification_mixin.py +2 -1
- angr/storage/memory_mixins/size_resolution_mixin.py +1 -1
- angr/storage/memory_mixins/slotted_memory.py +2 -2
- angr/storage/memory_mixins/smart_find_mixin.py +1 -1
- angr/storage/memory_mixins/symbolic_merger_mixin.py +2 -1
- angr/storage/memory_mixins/top_merger_mixin.py +3 -2
- angr/storage/memory_mixins/underconstrained_mixin.py +4 -2
- angr/storage/memory_mixins/unwrapper_mixin.py +2 -1
- {angr-9.2.120.dist-info → angr-9.2.121.dist-info}/METADATA +7 -7
- {angr-9.2.120.dist-info → angr-9.2.121.dist-info}/RECORD +76 -74
- {angr-9.2.120.dist-info → angr-9.2.121.dist-info}/LICENSE +0 -0
- {angr-9.2.120.dist-info → angr-9.2.121.dist-info}/WHEEL +0 -0
- {angr-9.2.120.dist-info → angr-9.2.121.dist-info}/entry_points.txt +0 -0
- {angr-9.2.120.dist-info → angr-9.2.121.dist-info}/top_level.txt +0 -0
|
@@ -1,160 +1,6 @@
|
|
|
1
|
-
# pylint:disable=abstract-method,wrong-import-position,unused-argument,missing-class-docstring,arguments-differ
|
|
2
1
|
from __future__ import annotations
|
|
3
|
-
from typing import Any
|
|
4
|
-
from collections.abc import Iterable
|
|
5
|
-
|
|
6
|
-
import claripy
|
|
7
|
-
|
|
8
|
-
from angr.state_plugins.plugin import SimStatePlugin
|
|
9
|
-
from angr.errors import SimMemoryError
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class MemoryMixin(SimStatePlugin):
|
|
13
|
-
SUPPORTS_CONCRETE_LOAD = False
|
|
14
|
-
|
|
15
|
-
def __init__(self, memory_id=None, endness="Iend_BE"):
|
|
16
|
-
super().__init__()
|
|
17
|
-
self.id = memory_id
|
|
18
|
-
self.endness = endness
|
|
19
|
-
|
|
20
|
-
def copy(self, memo):
|
|
21
|
-
o = type(self).__new__(type(self))
|
|
22
|
-
o.id = self.id
|
|
23
|
-
o.endness = self.endness
|
|
24
|
-
return o
|
|
25
|
-
|
|
26
|
-
@property
|
|
27
|
-
def category(self):
|
|
28
|
-
"""
|
|
29
|
-
Return the category of this SimMemory instance. It can be one of the three following categories: reg, mem,
|
|
30
|
-
or file.
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
if self.id in ("reg", "mem"):
|
|
34
|
-
return self.id
|
|
35
|
-
|
|
36
|
-
if self.id.startswith("file"):
|
|
37
|
-
return "file"
|
|
38
|
-
|
|
39
|
-
if "_" in self.id:
|
|
40
|
-
return self.id.split("_")[0]
|
|
41
|
-
|
|
42
|
-
raise SimMemoryError(f'Unknown SimMemory category for memory_id "{self.id}"')
|
|
43
|
-
|
|
44
|
-
@property
|
|
45
|
-
def variable_key_prefix(self):
|
|
46
|
-
s = self.category
|
|
47
|
-
if s == "file":
|
|
48
|
-
return (s, self.id)
|
|
49
|
-
return (s,)
|
|
50
|
-
|
|
51
|
-
def find(self, addr, data, max_search, **kwargs):
|
|
52
|
-
pass
|
|
53
|
-
|
|
54
|
-
def _add_constraints(self, c, add_constraints=True, condition=None, **kwargs):
|
|
55
|
-
if add_constraints:
|
|
56
|
-
to_add = c & condition | ~condition if condition is not None else c
|
|
57
|
-
self.state.add_constraints(to_add)
|
|
58
|
-
|
|
59
|
-
def load(self, addr, size=None, **kwargs):
|
|
60
|
-
pass
|
|
61
|
-
|
|
62
|
-
def store(self, addr, data, **kwargs):
|
|
63
|
-
pass
|
|
64
|
-
|
|
65
|
-
def merge(self, others, merge_conditions, common_ancestor=None) -> bool:
|
|
66
|
-
pass
|
|
67
|
-
|
|
68
|
-
def compare(self, other) -> bool:
|
|
69
|
-
pass
|
|
70
|
-
|
|
71
|
-
def widen(self, others):
|
|
72
|
-
pass
|
|
73
|
-
|
|
74
|
-
def permissions(self, addr, permissions=None, **kwargs):
|
|
75
|
-
pass
|
|
76
|
-
|
|
77
|
-
def map_region(self, addr, length, permissions, init_zero=False, **kwargs):
|
|
78
|
-
pass
|
|
79
|
-
|
|
80
|
-
def unmap_region(self, addr, length, **kwargs):
|
|
81
|
-
pass
|
|
82
|
-
|
|
83
|
-
# Optional interface:
|
|
84
|
-
def concrete_load(self, addr, size, writing=False, **kwargs) -> memoryview:
|
|
85
|
-
"""
|
|
86
|
-
Set SUPPORTS_CONCRETE_LOAD to True and implement concrete_load if reading concrete bytes is faster in this
|
|
87
|
-
memory model.
|
|
88
|
-
|
|
89
|
-
:param addr: The address to load from.
|
|
90
|
-
:param size: Size of the memory read.
|
|
91
|
-
:param writing:
|
|
92
|
-
:return: A memoryview into the loaded bytes.
|
|
93
|
-
"""
|
|
94
|
-
raise NotImplementedError
|
|
95
|
-
|
|
96
|
-
def erase(self, addr, size=None, **kwargs) -> None:
|
|
97
|
-
"""
|
|
98
|
-
Set [addr:addr+size) to uninitialized. In many cases this will be faster than overwriting those locations with
|
|
99
|
-
new values. This is commonly used during static data flow analysis.
|
|
100
|
-
|
|
101
|
-
:param addr: The address to start erasing.
|
|
102
|
-
:param size: The number of bytes for erasing.
|
|
103
|
-
:return: None
|
|
104
|
-
"""
|
|
105
|
-
raise NotImplementedError
|
|
106
|
-
|
|
107
|
-
def _default_value(self, addr, size, name=None, inspect=True, events=True, key=None, **kwargs):
|
|
108
|
-
"""
|
|
109
|
-
Override this method to provide default values for a variety of edge cases and base cases.
|
|
110
|
-
|
|
111
|
-
:param addr: If this value is being filled to provide a default memory value, this will be its address.
|
|
112
|
-
Otherwise, None.
|
|
113
|
-
:param size: The size in bytes of the value to return
|
|
114
|
-
:param name: A descriptive identifier for the value, for if a symbol is created.
|
|
115
|
-
|
|
116
|
-
The ``inspect``, ``events``, and ``key`` parameters are for ``state.solver.Unconstrained``, if it is used.
|
|
117
|
-
"""
|
|
118
|
-
|
|
119
|
-
def _merge_values(self, values: Iterable[tuple[Any, Any]], merged_size: int, **kwargs) -> Any | None:
|
|
120
|
-
"""
|
|
121
|
-
Override this method to provide value merging support.
|
|
122
|
-
|
|
123
|
-
:param values: A collection of values with their merge conditions.
|
|
124
|
-
:param merged_size: The size (in bytes) of the merged value.
|
|
125
|
-
:return: The merged value, or None to skip merging of the current value.
|
|
126
|
-
"""
|
|
127
|
-
raise NotImplementedError
|
|
128
|
-
|
|
129
|
-
def _merge_labels(self, labels: Iterable[dict], **kwargs) -> dict | None:
|
|
130
|
-
"""
|
|
131
|
-
Override this method to provide label merging support.
|
|
132
|
-
|
|
133
|
-
:param labels: A collection of labels.
|
|
134
|
-
:return: The merged label, or None to skip merging of the current label.
|
|
135
|
-
"""
|
|
136
|
-
raise NotImplementedError
|
|
137
|
-
|
|
138
|
-
def replace_all(self, old: claripy.ast.BV, new: claripy.ast.BV):
|
|
139
|
-
raise NotImplementedError
|
|
140
|
-
|
|
141
|
-
def _replace_all(self, addrs: Iterable[int], old: claripy.ast.BV, new: claripy.ast.BV):
|
|
142
|
-
raise NotImplementedError
|
|
143
|
-
|
|
144
|
-
def copy_contents(self, dst, src, size, condition=None, **kwargs):
|
|
145
|
-
"""
|
|
146
|
-
Override this method to provide faster copying of large chunks of data.
|
|
147
|
-
|
|
148
|
-
:param dst: The destination of copying.
|
|
149
|
-
:param src: The source of copying.
|
|
150
|
-
:param size: The size of copying.
|
|
151
|
-
:param condition: The storing condition.
|
|
152
|
-
:param kwargs: Other parameters.
|
|
153
|
-
:return: None
|
|
154
|
-
"""
|
|
155
|
-
raise NotImplementedError
|
|
156
|
-
|
|
157
2
|
|
|
3
|
+
from angr.sim_state import SimState
|
|
158
4
|
from .actions_mixin import ActionsMixinHigh, ActionsMixinLow
|
|
159
5
|
from .address_concretization_mixin import AddressConcretizationMixin
|
|
160
6
|
from .bvv_conversion_mixin import DataNormalizationMixin
|
|
@@ -214,6 +60,8 @@ from .regioned_memory import (
|
|
|
214
60
|
from .keyvalue_memory_mixin import KeyValueMemoryMixin
|
|
215
61
|
from .javavm_memory_mixin import JavaVmMemoryMixin
|
|
216
62
|
|
|
63
|
+
# pylint:disable=missing-class-docstring
|
|
64
|
+
|
|
217
65
|
|
|
218
66
|
class DefaultMemory(
|
|
219
67
|
HexDumperMixin,
|
|
@@ -347,7 +195,7 @@ class LabeledMemory(
|
|
|
347
195
|
LabeledMemory is used in static analysis. It allows storing values with labels, such as `Definition`.
|
|
348
196
|
"""
|
|
349
197
|
|
|
350
|
-
def _default_value(self, addr, size, **kwargs):
|
|
198
|
+
def _default_value(self, addr, size, **kwargs): # pylint:disable=arguments-differ
|
|
351
199
|
# TODO: Make _default_value() a separate Mixin
|
|
352
200
|
|
|
353
201
|
if kwargs.get("name", "").startswith("merge_uc_"):
|
|
@@ -368,7 +216,7 @@ class MultiValuedMemory(
|
|
|
368
216
|
PagedMemoryMixin,
|
|
369
217
|
PagedMemoryMultiValueMixin,
|
|
370
218
|
):
|
|
371
|
-
def _default_value(self, addr, size, **kwargs):
|
|
219
|
+
def _default_value(self, addr, size, **kwargs): # pylint:disable=arguments-differ
|
|
372
220
|
# TODO: Make _default_value() a separate Mixin
|
|
373
221
|
|
|
374
222
|
if kwargs.get("name", "").startswith("merge_uc_"):
|
|
@@ -393,8 +241,6 @@ class JavaVmMemory(
|
|
|
393
241
|
pass
|
|
394
242
|
|
|
395
243
|
|
|
396
|
-
from angr.sim_state import SimState
|
|
397
|
-
|
|
398
244
|
SimState.register_default("sym_memory", DefaultMemory)
|
|
399
245
|
SimState.register_default("fast_memory", FastMemory)
|
|
400
246
|
SimState.register_default("abs_memory", AbstractMemory)
|
|
@@ -403,7 +249,6 @@ SimState.register_default("javavm_memory", JavaVmMemory)
|
|
|
403
249
|
|
|
404
250
|
|
|
405
251
|
__all__ = (
|
|
406
|
-
"MemoryMixin",
|
|
407
252
|
"ActionsMixinHigh",
|
|
408
253
|
"ActionsMixinLow",
|
|
409
254
|
"AddressConcretizationMixin",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
import claripy
|
|
3
3
|
|
|
4
|
-
from . import MemoryMixin
|
|
4
|
+
from angr.storage.memory_mixins.memory_mixin import MemoryMixin
|
|
5
5
|
from angr import sim_options as options
|
|
6
6
|
from angr import concretization_strategies
|
|
7
7
|
from angr.sim_state_options import SimStateOptions
|
|
@@ -7,7 +7,7 @@ import claripy
|
|
|
7
7
|
from angr import sim_options as options
|
|
8
8
|
from angr.utils.cowdict import ChainMapCOW
|
|
9
9
|
from angr.errors import SimMemoryError, SimMemoryMissingError
|
|
10
|
-
from . import MemoryMixin
|
|
10
|
+
from angr.storage.memory_mixins.memory_mixin import MemoryMixin
|
|
11
11
|
|
|
12
12
|
l = logging.getLogger(name=__name__)
|
|
13
13
|
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Iterable
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
import claripy
|
|
7
|
+
|
|
8
|
+
from angr.errors import SimMemoryError
|
|
9
|
+
from angr.state_plugins.plugin import SimStatePlugin
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class MemoryMixin(SimStatePlugin):
|
|
13
|
+
"""
|
|
14
|
+
Base class for memory mixins. In angr, all memory objects are made by
|
|
15
|
+
subclassing one or more MemoryMixins, each adding some functionality to the
|
|
16
|
+
memory object.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
SUPPORTS_CONCRETE_LOAD = False
|
|
20
|
+
|
|
21
|
+
def __init__(self, memory_id=None, endness="Iend_BE"):
|
|
22
|
+
super().__init__()
|
|
23
|
+
self.id = memory_id
|
|
24
|
+
self.endness = endness
|
|
25
|
+
|
|
26
|
+
def copy(self, memo): # pylint:disable=unused-argument
|
|
27
|
+
o = type(self).__new__(type(self))
|
|
28
|
+
o.id = self.id
|
|
29
|
+
o.endness = self.endness
|
|
30
|
+
return o
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def category(self):
|
|
34
|
+
"""
|
|
35
|
+
Return the category of this SimMemory instance. It can be one of the three following categories: reg, mem,
|
|
36
|
+
or file.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
if self.id in ("reg", "mem"):
|
|
40
|
+
return self.id
|
|
41
|
+
|
|
42
|
+
if self.id.startswith("file"):
|
|
43
|
+
return "file"
|
|
44
|
+
|
|
45
|
+
if "_" in self.id:
|
|
46
|
+
return self.id.split("_")[0]
|
|
47
|
+
|
|
48
|
+
raise SimMemoryError(f'Unknown SimMemory category for memory_id "{self.id}"')
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def variable_key_prefix(self):
|
|
52
|
+
s = self.category
|
|
53
|
+
if s == "file":
|
|
54
|
+
return (s, self.id)
|
|
55
|
+
return (s,)
|
|
56
|
+
|
|
57
|
+
def find(self, addr, data, max_search, **kwargs):
|
|
58
|
+
pass
|
|
59
|
+
|
|
60
|
+
def _add_constraints(self, c, add_constraints=True, condition=None, **kwargs): # pylint:disable=unused-argument
|
|
61
|
+
if add_constraints:
|
|
62
|
+
to_add = c & condition | ~condition if condition is not None else c
|
|
63
|
+
self.state.add_constraints(to_add)
|
|
64
|
+
|
|
65
|
+
def load(self, addr, size=None, **kwargs):
|
|
66
|
+
pass
|
|
67
|
+
|
|
68
|
+
def store(self, addr, data, **kwargs):
|
|
69
|
+
pass
|
|
70
|
+
|
|
71
|
+
def merge(self, others, merge_conditions, common_ancestor=None) -> bool:
|
|
72
|
+
pass
|
|
73
|
+
|
|
74
|
+
def compare(self, other) -> bool:
|
|
75
|
+
pass
|
|
76
|
+
|
|
77
|
+
def widen(self, others):
|
|
78
|
+
pass
|
|
79
|
+
|
|
80
|
+
def permissions(self, addr, permissions=None, **kwargs):
|
|
81
|
+
pass
|
|
82
|
+
|
|
83
|
+
def map_region(self, addr, length, permissions, init_zero=False, **kwargs):
|
|
84
|
+
pass
|
|
85
|
+
|
|
86
|
+
def unmap_region(self, addr, length, **kwargs):
|
|
87
|
+
pass
|
|
88
|
+
|
|
89
|
+
# Optional interface:
|
|
90
|
+
def concrete_load(self, addr, size, writing=False, **kwargs) -> memoryview:
|
|
91
|
+
"""
|
|
92
|
+
Set SUPPORTS_CONCRETE_LOAD to True and implement concrete_load if reading concrete bytes is faster in this
|
|
93
|
+
memory model.
|
|
94
|
+
|
|
95
|
+
:param addr: The address to load from.
|
|
96
|
+
:param size: Size of the memory read.
|
|
97
|
+
:param writing:
|
|
98
|
+
:return: A memoryview into the loaded bytes.
|
|
99
|
+
"""
|
|
100
|
+
raise NotImplementedError
|
|
101
|
+
|
|
102
|
+
def erase(self, addr, size=None, **kwargs) -> None:
|
|
103
|
+
"""
|
|
104
|
+
Set [addr:addr+size) to uninitialized. In many cases this will be faster than overwriting those locations with
|
|
105
|
+
new values. This is commonly used during static data flow analysis.
|
|
106
|
+
|
|
107
|
+
:param addr: The address to start erasing.
|
|
108
|
+
:param size: The number of bytes for erasing.
|
|
109
|
+
:return: None
|
|
110
|
+
"""
|
|
111
|
+
raise NotImplementedError
|
|
112
|
+
|
|
113
|
+
def _default_value( # pylint:disable=too-many-positional-arguments
|
|
114
|
+
self, addr, size, name=None, inspect=True, events=True, key=None, **kwargs
|
|
115
|
+
):
|
|
116
|
+
"""
|
|
117
|
+
Override this method to provide default values for a variety of edge cases and base cases.
|
|
118
|
+
|
|
119
|
+
:param addr: If this value is being filled to provide a default memory value, this will be its address.
|
|
120
|
+
Otherwise, None.
|
|
121
|
+
:param size: The size in bytes of the value to return
|
|
122
|
+
:param name: A descriptive identifier for the value, for if a symbol is created.
|
|
123
|
+
|
|
124
|
+
The ``inspect``, ``events``, and ``key`` parameters are for ``state.solver.Unconstrained``, if it is used.
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
def _merge_values(self, values: Iterable[tuple[Any, Any]], merged_size: int, **kwargs) -> Any | None:
|
|
128
|
+
"""
|
|
129
|
+
Override this method to provide value merging support.
|
|
130
|
+
|
|
131
|
+
:param values: A collection of values with their merge conditions.
|
|
132
|
+
:param merged_size: The size (in bytes) of the merged value.
|
|
133
|
+
:return: The merged value, or None to skip merging of the current value.
|
|
134
|
+
"""
|
|
135
|
+
raise NotImplementedError
|
|
136
|
+
|
|
137
|
+
def _merge_labels(self, labels: Iterable[dict], **kwargs) -> dict | None:
|
|
138
|
+
"""
|
|
139
|
+
Override this method to provide label merging support.
|
|
140
|
+
|
|
141
|
+
:param labels: A collection of labels.
|
|
142
|
+
:return: The merged label, or None to skip merging of the current label.
|
|
143
|
+
"""
|
|
144
|
+
raise NotImplementedError
|
|
145
|
+
|
|
146
|
+
def replace_all(self, old: claripy.ast.BV, new: claripy.ast.BV):
|
|
147
|
+
raise NotImplementedError
|
|
148
|
+
|
|
149
|
+
def _replace_all(self, addrs: Iterable[int], old: claripy.ast.BV, new: claripy.ast.BV):
|
|
150
|
+
raise NotImplementedError
|
|
151
|
+
|
|
152
|
+
def copy_contents(self, dst, src, size, condition=None, **kwargs):
|
|
153
|
+
"""
|
|
154
|
+
Override this method to provide faster copying of large chunks of data.
|
|
155
|
+
|
|
156
|
+
:param dst: The destination of copying.
|
|
157
|
+
:param src: The source of copying.
|
|
158
|
+
:param size: The size of copying.
|
|
159
|
+
:param condition: The storing condition.
|
|
160
|
+
:param kwargs: Other parameters.
|
|
161
|
+
:return: None
|
|
162
|
+
"""
|
|
163
|
+
raise NotImplementedError
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
|
|
2
3
|
import claripy
|
|
3
4
|
from archinfo.arch_arm import is_arm_arch
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
from angr.storage.memory_mixins.memory_mixin import MemoryMixin
|
|
5
7
|
|
|
6
8
|
stn_map = {"st%d" % n: n for n in range(8)}
|
|
7
9
|
tag_map = {"tag%d" % n: n for n in range(8)}
|
|
@@ -7,7 +7,7 @@ from collections import defaultdict
|
|
|
7
7
|
|
|
8
8
|
import claripy
|
|
9
9
|
|
|
10
|
-
from angr.storage.memory_mixins import MemoryMixin
|
|
10
|
+
from angr.storage.memory_mixins.memory_mixin import MemoryMixin
|
|
11
11
|
from angr.storage.memory_mixins.paged_memory.pages import PageType, ListPage, UltraPage, MVListPage
|
|
12
12
|
from angr.errors import SimMemoryError
|
|
13
13
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
import typing
|
|
3
3
|
|
|
4
|
-
from angr.storage.memory_mixins import MemoryMixin
|
|
4
|
+
from angr.storage.memory_mixins.memory_mixin import MemoryMixin
|
|
5
5
|
from .cooperation import CooperationBase, MemoryObjectMixin
|
|
6
6
|
from .ispo_mixin import ISPOMixin
|
|
7
7
|
from .refcount_mixin import RefcountMixin
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# pylint:disable=arguments-differ,unused-argument,no-member
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
from angr.storage.memory_mixins import MemoryMixin
|
|
4
|
+
from angr.storage.memory_mixins.memory_mixin import MemoryMixin
|
|
5
5
|
from angr.utils.segment_list import SegmentList
|
|
6
6
|
from .refcount_mixin import RefcountMixin
|
|
7
7
|
|
|
@@ -455,7 +455,7 @@ class UltraPage(MemoryObjectMixin, PageBase):
|
|
|
455
455
|
replaced_object = replaced_objects_cache[mo.object]
|
|
456
456
|
|
|
457
457
|
else:
|
|
458
|
-
replaced_object = mo.object
|
|
458
|
+
replaced_object = claripy.replace(mo.object, old, new)
|
|
459
459
|
replaced_objects_cache[mo.object] = replaced_object
|
|
460
460
|
if mo.object is replaced_object:
|
|
461
461
|
# The replace does not really occur
|
|
@@ -6,7 +6,7 @@ import claripy
|
|
|
6
6
|
from angr.sim_options import HYBRID_SOLVER, APPROXIMATE_FIRST
|
|
7
7
|
from angr import concretization_strategies
|
|
8
8
|
from angr.errors import SimMergeError, SimMemoryAddressError
|
|
9
|
-
from angr.storage.memory_mixins import MemoryMixin
|
|
9
|
+
from angr.storage.memory_mixins.memory_mixin import MemoryMixin
|
|
10
10
|
from .abstract_address_descriptor import AbstractAddressDescriptor
|
|
11
11
|
from .region_data import AddressWrapper
|
|
12
12
|
|
|
@@ -11,7 +11,7 @@ from claripy.ast import Bool, Bits, BV
|
|
|
11
11
|
from angr.sim_options import AVOID_MULTIVALUED_READS, CONSERVATIVE_READ_STRATEGY, CONSERVATIVE_WRITE_STRATEGY
|
|
12
12
|
from angr.state_plugins.sim_action_object import _raw_ast
|
|
13
13
|
from angr.errors import SimMemoryError, SimAbstractMemoryError
|
|
14
|
-
from angr.storage.memory_mixins import MemoryMixin
|
|
14
|
+
from angr.storage.memory_mixins.memory_mixin import MemoryMixin
|
|
15
15
|
from .region_data import AddressWrapper, RegionMap
|
|
16
16
|
from .abstract_address_descriptor import AbstractAddressDescriptor
|
|
17
17
|
|
|
@@ -414,7 +414,7 @@ class RegionedMemoryMixin(MemoryMixin):
|
|
|
414
414
|
def _apply_condition_to_symbolic_addr(addr, condition):
|
|
415
415
|
_, converted = claripy.constraint_to_si(condition)
|
|
416
416
|
for original_expr, constrained_expr in converted:
|
|
417
|
-
addr =
|
|
417
|
+
addr = claripy.replace(addr, original_expr, constrained_expr)
|
|
418
418
|
return addr
|
|
419
419
|
|
|
420
420
|
@staticmethod
|