smallworld-re 1.0.0__py3-none-any.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.
- smallworld/__init__.py +35 -0
- smallworld/analyses/__init__.py +14 -0
- smallworld/analyses/analysis.py +88 -0
- smallworld/analyses/code_coverage.py +31 -0
- smallworld/analyses/colorizer.py +682 -0
- smallworld/analyses/colorizer_summary.py +100 -0
- smallworld/analyses/field_detection/__init__.py +14 -0
- smallworld/analyses/field_detection/field_analysis.py +536 -0
- smallworld/analyses/field_detection/guards.py +26 -0
- smallworld/analyses/field_detection/hints.py +133 -0
- smallworld/analyses/field_detection/malloc.py +211 -0
- smallworld/analyses/forced_exec/__init__.py +3 -0
- smallworld/analyses/forced_exec/forced_exec.py +87 -0
- smallworld/analyses/underlays/__init__.py +4 -0
- smallworld/analyses/underlays/basic.py +13 -0
- smallworld/analyses/underlays/underlay.py +31 -0
- smallworld/analyses/unstable/__init__.py +4 -0
- smallworld/analyses/unstable/angr/__init__.py +0 -0
- smallworld/analyses/unstable/angr/base.py +12 -0
- smallworld/analyses/unstable/angr/divergence.py +274 -0
- smallworld/analyses/unstable/angr/model.py +383 -0
- smallworld/analyses/unstable/angr/nwbt.py +63 -0
- smallworld/analyses/unstable/angr/typedefs.py +170 -0
- smallworld/analyses/unstable/angr/utils.py +25 -0
- smallworld/analyses/unstable/angr/visitor.py +315 -0
- smallworld/analyses/unstable/angr_nwbt.py +106 -0
- smallworld/analyses/unstable/code_coverage.py +54 -0
- smallworld/analyses/unstable/code_reachable.py +44 -0
- smallworld/analyses/unstable/control_flow_tracer.py +71 -0
- smallworld/analyses/unstable/pointer_finder.py +90 -0
- smallworld/arch/__init__.py +0 -0
- smallworld/arch/aarch64_arch.py +286 -0
- smallworld/arch/amd64_arch.py +86 -0
- smallworld/arch/i386_arch.py +44 -0
- smallworld/emulators/__init__.py +14 -0
- smallworld/emulators/angr/__init__.py +7 -0
- smallworld/emulators/angr/angr.py +1652 -0
- smallworld/emulators/angr/default.py +15 -0
- smallworld/emulators/angr/exceptions.py +7 -0
- smallworld/emulators/angr/exploration/__init__.py +9 -0
- smallworld/emulators/angr/exploration/bounds.py +27 -0
- smallworld/emulators/angr/exploration/default.py +17 -0
- smallworld/emulators/angr/exploration/terminate.py +22 -0
- smallworld/emulators/angr/factory.py +55 -0
- smallworld/emulators/angr/machdefs/__init__.py +35 -0
- smallworld/emulators/angr/machdefs/aarch64.py +292 -0
- smallworld/emulators/angr/machdefs/amd64.py +192 -0
- smallworld/emulators/angr/machdefs/arm.py +387 -0
- smallworld/emulators/angr/machdefs/i386.py +221 -0
- smallworld/emulators/angr/machdefs/machdef.py +138 -0
- smallworld/emulators/angr/machdefs/mips.py +184 -0
- smallworld/emulators/angr/machdefs/mips64.py +189 -0
- smallworld/emulators/angr/machdefs/ppc.py +101 -0
- smallworld/emulators/angr/machdefs/riscv.py +261 -0
- smallworld/emulators/angr/machdefs/xtensa.py +255 -0
- smallworld/emulators/angr/memory/__init__.py +7 -0
- smallworld/emulators/angr/memory/default.py +10 -0
- smallworld/emulators/angr/memory/fixups.py +43 -0
- smallworld/emulators/angr/memory/memtrack.py +105 -0
- smallworld/emulators/angr/scratch.py +43 -0
- smallworld/emulators/angr/simos.py +53 -0
- smallworld/emulators/angr/utils.py +70 -0
- smallworld/emulators/emulator.py +1013 -0
- smallworld/emulators/hookable.py +252 -0
- smallworld/emulators/panda/__init__.py +5 -0
- smallworld/emulators/panda/machdefs/__init__.py +28 -0
- smallworld/emulators/panda/machdefs/aarch64.py +93 -0
- smallworld/emulators/panda/machdefs/amd64.py +71 -0
- smallworld/emulators/panda/machdefs/arm.py +89 -0
- smallworld/emulators/panda/machdefs/i386.py +36 -0
- smallworld/emulators/panda/machdefs/machdef.py +86 -0
- smallworld/emulators/panda/machdefs/mips.py +94 -0
- smallworld/emulators/panda/machdefs/mips64.py +91 -0
- smallworld/emulators/panda/machdefs/ppc.py +79 -0
- smallworld/emulators/panda/panda.py +575 -0
- smallworld/emulators/unicorn/__init__.py +13 -0
- smallworld/emulators/unicorn/machdefs/__init__.py +28 -0
- smallworld/emulators/unicorn/machdefs/aarch64.py +310 -0
- smallworld/emulators/unicorn/machdefs/amd64.py +326 -0
- smallworld/emulators/unicorn/machdefs/arm.py +321 -0
- smallworld/emulators/unicorn/machdefs/i386.py +137 -0
- smallworld/emulators/unicorn/machdefs/machdef.py +117 -0
- smallworld/emulators/unicorn/machdefs/mips.py +202 -0
- smallworld/emulators/unicorn/unicorn.py +684 -0
- smallworld/exceptions/__init__.py +5 -0
- smallworld/exceptions/exceptions.py +85 -0
- smallworld/exceptions/unstable/__init__.py +1 -0
- smallworld/exceptions/unstable/exceptions.py +25 -0
- smallworld/extern/__init__.py +4 -0
- smallworld/extern/ctypes.py +94 -0
- smallworld/extern/unstable/__init__.py +1 -0
- smallworld/extern/unstable/ghidra.py +129 -0
- smallworld/helpers.py +107 -0
- smallworld/hinting/__init__.py +8 -0
- smallworld/hinting/hinting.py +214 -0
- smallworld/hinting/hints.py +427 -0
- smallworld/hinting/unstable/__init__.py +2 -0
- smallworld/hinting/utils.py +19 -0
- smallworld/instructions/__init__.py +18 -0
- smallworld/instructions/aarch64.py +20 -0
- smallworld/instructions/arm.py +18 -0
- smallworld/instructions/bsid.py +67 -0
- smallworld/instructions/instructions.py +258 -0
- smallworld/instructions/mips.py +21 -0
- smallworld/instructions/x86.py +100 -0
- smallworld/logging.py +90 -0
- smallworld/platforms.py +95 -0
- smallworld/py.typed +0 -0
- smallworld/state/__init__.py +6 -0
- smallworld/state/cpus/__init__.py +32 -0
- smallworld/state/cpus/aarch64.py +563 -0
- smallworld/state/cpus/amd64.py +676 -0
- smallworld/state/cpus/arm.py +630 -0
- smallworld/state/cpus/cpu.py +71 -0
- smallworld/state/cpus/i386.py +239 -0
- smallworld/state/cpus/mips.py +374 -0
- smallworld/state/cpus/mips64.py +372 -0
- smallworld/state/cpus/powerpc.py +229 -0
- smallworld/state/cpus/riscv.py +357 -0
- smallworld/state/cpus/xtensa.py +80 -0
- smallworld/state/memory/__init__.py +7 -0
- smallworld/state/memory/code.py +70 -0
- smallworld/state/memory/elf/__init__.py +3 -0
- smallworld/state/memory/elf/elf.py +564 -0
- smallworld/state/memory/elf/rela/__init__.py +32 -0
- smallworld/state/memory/elf/rela/aarch64.py +27 -0
- smallworld/state/memory/elf/rela/amd64.py +32 -0
- smallworld/state/memory/elf/rela/arm.py +51 -0
- smallworld/state/memory/elf/rela/i386.py +32 -0
- smallworld/state/memory/elf/rela/mips.py +45 -0
- smallworld/state/memory/elf/rela/ppc.py +45 -0
- smallworld/state/memory/elf/rela/rela.py +63 -0
- smallworld/state/memory/elf/rela/riscv64.py +27 -0
- smallworld/state/memory/elf/rela/xtensa.py +15 -0
- smallworld/state/memory/elf/structs.py +55 -0
- smallworld/state/memory/heap.py +85 -0
- smallworld/state/memory/memory.py +181 -0
- smallworld/state/memory/stack/__init__.py +31 -0
- smallworld/state/memory/stack/aarch64.py +22 -0
- smallworld/state/memory/stack/amd64.py +42 -0
- smallworld/state/memory/stack/arm.py +66 -0
- smallworld/state/memory/stack/i386.py +22 -0
- smallworld/state/memory/stack/mips.py +34 -0
- smallworld/state/memory/stack/mips64.py +34 -0
- smallworld/state/memory/stack/ppc.py +34 -0
- smallworld/state/memory/stack/riscv.py +22 -0
- smallworld/state/memory/stack/stack.py +127 -0
- smallworld/state/memory/stack/xtensa.py +34 -0
- smallworld/state/models/__init__.py +6 -0
- smallworld/state/models/mmio.py +186 -0
- smallworld/state/models/model.py +163 -0
- smallworld/state/models/posix.py +455 -0
- smallworld/state/models/x86/__init__.py +2 -0
- smallworld/state/models/x86/microsoftcdecl.py +35 -0
- smallworld/state/models/x86/systemv.py +240 -0
- smallworld/state/state.py +962 -0
- smallworld/state/unstable/__init__.py +0 -0
- smallworld/state/unstable/elf.py +393 -0
- smallworld/state/x86_registers.py +30 -0
- smallworld/utils.py +935 -0
- smallworld_re-1.0.0.dist-info/LICENSE.txt +21 -0
- smallworld_re-1.0.0.dist-info/METADATA +189 -0
- smallworld_re-1.0.0.dist-info/RECORD +166 -0
- smallworld_re-1.0.0.dist-info/WHEEL +5 -0
- smallworld_re-1.0.0.dist-info/entry_points.txt +2 -0
- smallworld_re-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,240 @@
|
|
1
|
+
from .... import platforms
|
2
|
+
from ..model import Model
|
3
|
+
from ..posix import (
|
4
|
+
BasenameModel,
|
5
|
+
CallocModel,
|
6
|
+
DaemonModel,
|
7
|
+
FlockModel,
|
8
|
+
Getopt_longModel,
|
9
|
+
GetpagesizeModel,
|
10
|
+
GetppidModel,
|
11
|
+
GetsModel,
|
12
|
+
MallocModel,
|
13
|
+
Open64Model,
|
14
|
+
OpenModel,
|
15
|
+
PthreadCondInitModel,
|
16
|
+
PthreadCondSignalModel,
|
17
|
+
PthreadCondWaitModel,
|
18
|
+
PthreadCreateModel,
|
19
|
+
PthreadMutexInitModel,
|
20
|
+
PthreadMutexLockModel,
|
21
|
+
PthreadMutexUnlockModel,
|
22
|
+
PtraceModel,
|
23
|
+
PutsModel,
|
24
|
+
RandModel,
|
25
|
+
RandomModel,
|
26
|
+
SleepModel,
|
27
|
+
SrandModel,
|
28
|
+
SrandomModel,
|
29
|
+
StrcatModel,
|
30
|
+
StrcpyModel,
|
31
|
+
StrdupModel,
|
32
|
+
StrlenModel,
|
33
|
+
StrncatModel,
|
34
|
+
StrncpyModel,
|
35
|
+
StrnlenModel,
|
36
|
+
SysconfModel,
|
37
|
+
TimeModel,
|
38
|
+
UnlinkModel,
|
39
|
+
WriteModel,
|
40
|
+
)
|
41
|
+
|
42
|
+
|
43
|
+
class AMD64SystemVModel(Model):
|
44
|
+
platform = platforms.Platform(
|
45
|
+
platforms.Architecture.X86_64, platforms.Byteorder.LITTLE
|
46
|
+
)
|
47
|
+
|
48
|
+
abi = platforms.ABI.SYSTEMV
|
49
|
+
|
50
|
+
argument1 = "rdi"
|
51
|
+
argument2 = "rsi"
|
52
|
+
argument3 = "rdx"
|
53
|
+
argument4 = "rcx"
|
54
|
+
argument5 = "r8"
|
55
|
+
argument6 = "r9"
|
56
|
+
return_val = "rax"
|
57
|
+
|
58
|
+
|
59
|
+
class AMD64SystemVBasenameModel(AMD64SystemVModel, BasenameModel):
|
60
|
+
pass
|
61
|
+
|
62
|
+
|
63
|
+
class AMD64SystemVCallocModel(AMD64SystemVModel, CallocModel):
|
64
|
+
pass
|
65
|
+
|
66
|
+
|
67
|
+
class AMD64SystemVDaemonModel(AMD64SystemVModel, DaemonModel):
|
68
|
+
pass
|
69
|
+
|
70
|
+
|
71
|
+
class AMD64SystemVFlockModel(AMD64SystemVModel, FlockModel):
|
72
|
+
pass
|
73
|
+
|
74
|
+
|
75
|
+
class AMD64SystemVGetopt_longModel(AMD64SystemVModel, Getopt_longModel):
|
76
|
+
pass
|
77
|
+
|
78
|
+
|
79
|
+
class AMD64SystemVGetpagesizeModel(AMD64SystemVModel, GetpagesizeModel):
|
80
|
+
pass
|
81
|
+
|
82
|
+
|
83
|
+
class AMD64SystemVGetppidModel(AMD64SystemVModel, GetppidModel):
|
84
|
+
pass
|
85
|
+
|
86
|
+
|
87
|
+
class AMD64SystemVGetsModel(AMD64SystemVModel, GetsModel):
|
88
|
+
pass
|
89
|
+
|
90
|
+
|
91
|
+
class AMD64SystemVMallocModel(AMD64SystemVModel, MallocModel):
|
92
|
+
pass
|
93
|
+
|
94
|
+
|
95
|
+
class AMD64SystemVOpenModel(AMD64SystemVModel, OpenModel):
|
96
|
+
pass
|
97
|
+
|
98
|
+
|
99
|
+
class AMD64SystemVOpen64Model(AMD64SystemVModel, Open64Model):
|
100
|
+
pass
|
101
|
+
|
102
|
+
|
103
|
+
class AMD64SystemVPutsModel(AMD64SystemVModel, PutsModel):
|
104
|
+
pass
|
105
|
+
|
106
|
+
|
107
|
+
class AMD64SystemVPthreadCondInitModel(AMD64SystemVModel, PthreadCondInitModel):
|
108
|
+
pass
|
109
|
+
|
110
|
+
|
111
|
+
class AMD64SystemVPthreadCondSignalModel(AMD64SystemVModel, PthreadCondSignalModel):
|
112
|
+
pass
|
113
|
+
|
114
|
+
|
115
|
+
class AMD64SystemVPthreadCondWaitModel(AMD64SystemVModel, PthreadCondWaitModel):
|
116
|
+
pass
|
117
|
+
|
118
|
+
|
119
|
+
class AMD64SystemVPthreadCreateModel(AMD64SystemVModel, PthreadCreateModel):
|
120
|
+
pass
|
121
|
+
|
122
|
+
|
123
|
+
class AMD64SystemVPthreadMutexInitModel(AMD64SystemVModel, PthreadMutexInitModel):
|
124
|
+
pass
|
125
|
+
|
126
|
+
|
127
|
+
class AMD64SystemVPthreadMutexLockModel(AMD64SystemVModel, PthreadMutexLockModel):
|
128
|
+
pass
|
129
|
+
|
130
|
+
|
131
|
+
class AMD64SystemVPthreadMutexUnlockModel(AMD64SystemVModel, PthreadMutexUnlockModel):
|
132
|
+
pass
|
133
|
+
|
134
|
+
|
135
|
+
class AMD64SystemVPtraceModel(AMD64SystemVModel, PtraceModel):
|
136
|
+
pass
|
137
|
+
|
138
|
+
|
139
|
+
class AMD64SystemVRandModel(AMD64SystemVModel, RandModel):
|
140
|
+
pass
|
141
|
+
|
142
|
+
|
143
|
+
class AMD64SystemVRandomModel(AMD64SystemVModel, RandomModel):
|
144
|
+
pass
|
145
|
+
|
146
|
+
|
147
|
+
class AMD64SystemVSleepModel(AMD64SystemVModel, SleepModel):
|
148
|
+
pass
|
149
|
+
|
150
|
+
|
151
|
+
class AMD64SystemVSrandModel(AMD64SystemVModel, SrandModel):
|
152
|
+
pass
|
153
|
+
|
154
|
+
|
155
|
+
class AMD64SystemVSrandomModel(AMD64SystemVModel, SrandomModel):
|
156
|
+
pass
|
157
|
+
|
158
|
+
|
159
|
+
class AMD64SystemVStrcatModel(AMD64SystemVModel, StrcatModel):
|
160
|
+
pass
|
161
|
+
|
162
|
+
|
163
|
+
class AMD64SystemVStrncatModel(AMD64SystemVModel, StrncatModel):
|
164
|
+
pass
|
165
|
+
|
166
|
+
|
167
|
+
class AMD64SystemVStrcpyModel(AMD64SystemVModel, StrcpyModel):
|
168
|
+
pass
|
169
|
+
|
170
|
+
|
171
|
+
class AMD64SystemVStrncpyModel(AMD64SystemVModel, StrncpyModel):
|
172
|
+
pass
|
173
|
+
|
174
|
+
|
175
|
+
class AMD64SystemVStrdupModel(AMD64SystemVModel, StrdupModel):
|
176
|
+
pass
|
177
|
+
|
178
|
+
|
179
|
+
class AMD64SystemVStrlenModel(AMD64SystemVModel, StrlenModel):
|
180
|
+
pass
|
181
|
+
|
182
|
+
|
183
|
+
class AMD64SystemVStrnlenModel(AMD64SystemVModel, StrnlenModel):
|
184
|
+
pass
|
185
|
+
|
186
|
+
|
187
|
+
class AMD64SystemVSysconfModel(AMD64SystemVModel, SysconfModel):
|
188
|
+
pass
|
189
|
+
|
190
|
+
|
191
|
+
class AMD64SystemVTimeModel(AMD64SystemVModel, TimeModel):
|
192
|
+
pass
|
193
|
+
|
194
|
+
|
195
|
+
class AMD64SystemVUnlinkModel(AMD64SystemVModel, UnlinkModel):
|
196
|
+
pass
|
197
|
+
|
198
|
+
|
199
|
+
class AMD64SystemVWriteModel(AMD64SystemVModel, WriteModel):
|
200
|
+
pass
|
201
|
+
|
202
|
+
|
203
|
+
__all__ = [
|
204
|
+
"AMD64SystemVBasenameModel",
|
205
|
+
"AMD64SystemVCallocModel",
|
206
|
+
"AMD64SystemVDaemonModel",
|
207
|
+
"AMD64SystemVFlockModel",
|
208
|
+
"AMD64SystemVGetopt_longModel",
|
209
|
+
"AMD64SystemVGetpagesizeModel",
|
210
|
+
"AMD64SystemVGetppidModel",
|
211
|
+
"AMD64SystemVGetsModel",
|
212
|
+
"AMD64SystemVMallocModel",
|
213
|
+
"AMD64SystemVOpenModel",
|
214
|
+
"AMD64SystemVOpen64Model",
|
215
|
+
"AMD64SystemVPutsModel",
|
216
|
+
"AMD64SystemVPthreadCondInitModel",
|
217
|
+
"AMD64SystemVPthreadCondSignalModel",
|
218
|
+
"AMD64SystemVPthreadCondWaitModel",
|
219
|
+
"AMD64SystemVPthreadCreateModel",
|
220
|
+
"AMD64SystemVPthreadMutexInitModel",
|
221
|
+
"AMD64SystemVPthreadMutexLockModel",
|
222
|
+
"AMD64SystemVPthreadMutexUnlockModel",
|
223
|
+
"AMD64SystemVPtraceModel",
|
224
|
+
"AMD64SystemVRandModel",
|
225
|
+
"AMD64SystemVRandomModel",
|
226
|
+
"AMD64SystemVSleepModel",
|
227
|
+
"AMD64SystemVSrandModel",
|
228
|
+
"AMD64SystemVSrandomModel",
|
229
|
+
"AMD64SystemVStrcatModel",
|
230
|
+
"AMD64SystemVStrncatModel",
|
231
|
+
"AMD64SystemVStrcpyModel",
|
232
|
+
"AMD64SystemVStrncpyModel",
|
233
|
+
"AMD64SystemVStrdupModel",
|
234
|
+
"AMD64SystemVStrlenModel",
|
235
|
+
"AMD64SystemVStrnlenModel",
|
236
|
+
"AMD64SystemVSysconfModel",
|
237
|
+
"AMD64SystemVTimeModel",
|
238
|
+
"AMD64SystemVUnlinkModel",
|
239
|
+
"AMD64SystemVWriteModel",
|
240
|
+
]
|