smallworld-re 1.0.3__py3-none-any.whl → 2.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/analyses/__init__.py +8 -0
- smallworld/analyses/analysis.py +8 -67
- smallworld/analyses/code_coverage.py +1 -2
- smallworld/analyses/colorizer.py +301 -534
- smallworld/analyses/colorizer_def_use.py +217 -0
- smallworld/analyses/colorizer_summary.py +173 -83
- smallworld/analyses/field_detection/field_analysis.py +7 -8
- smallworld/analyses/field_detection/hints.py +1 -1
- smallworld/analyses/field_detection/malloc.py +2 -2
- smallworld/analyses/trace_execution.py +160 -0
- smallworld/analyses/trace_execution_types.py +42 -0
- smallworld/analyses/unstable/angr/divergence.py +1 -2
- smallworld/analyses/unstable/angr/model.py +5 -6
- smallworld/analyses/unstable/angr_nwbt.py +3 -4
- smallworld/analyses/unstable/code_coverage.py +2 -3
- smallworld/analyses/unstable/code_reachable.py +2 -3
- smallworld/analyses/unstable/control_flow_tracer.py +2 -3
- smallworld/analyses/unstable/pointer_finder.py +2 -3
- smallworld/analyses/unstable/utils/tui.py +71 -0
- smallworld/emulators/__init__.py +3 -1
- smallworld/emulators/angr/angr.py +30 -9
- smallworld/emulators/angr/machdefs/__init__.py +2 -0
- smallworld/emulators/angr/machdefs/aarch64.py +1 -1
- smallworld/emulators/angr/machdefs/amd64.py +0 -4
- smallworld/emulators/angr/machdefs/arm.py +0 -2
- smallworld/emulators/angr/machdefs/i386.py +0 -2
- smallworld/emulators/angr/machdefs/loongarch.py +340 -0
- smallworld/emulators/angr/machdefs/machdef.py +1 -8
- smallworld/emulators/angr/machdefs/mips.py +0 -2
- smallworld/emulators/angr/machdefs/mips64.py +0 -2
- smallworld/emulators/angr/machdefs/ppc.py +1 -2
- smallworld/emulators/angr/machdefs/riscv.py +8 -10
- smallworld/emulators/angr/machdefs/xtensa.py +7 -4
- smallworld/emulators/emulator.py +22 -0
- smallworld/emulators/ghidra/__init__.py +37 -0
- smallworld/emulators/ghidra/ghidra.py +513 -0
- smallworld/emulators/ghidra/machdefs/__init__.py +31 -0
- smallworld/emulators/ghidra/machdefs/aarch64.py +289 -0
- smallworld/emulators/ghidra/machdefs/amd64.py +185 -0
- smallworld/emulators/ghidra/machdefs/arm.py +370 -0
- smallworld/emulators/ghidra/machdefs/i386.py +109 -0
- smallworld/emulators/ghidra/machdefs/loongarch.py +162 -0
- smallworld/emulators/ghidra/machdefs/machdef.py +81 -0
- smallworld/emulators/ghidra/machdefs/mips.py +163 -0
- smallworld/emulators/ghidra/machdefs/mips64.py +186 -0
- smallworld/emulators/ghidra/machdefs/ppc.py +98 -0
- smallworld/emulators/ghidra/machdefs/riscv.py +208 -0
- smallworld/emulators/ghidra/machdefs/xtensa.py +21 -0
- smallworld/emulators/ghidra/typing.py +28 -0
- smallworld/emulators/hookable.py +18 -4
- smallworld/emulators/panda/machdefs/__init__.py +2 -2
- smallworld/emulators/panda/machdefs/aarch64.py +186 -11
- smallworld/emulators/panda/machdefs/amd64.py +103 -11
- smallworld/emulators/panda/machdefs/arm.py +216 -20
- smallworld/emulators/panda/machdefs/i386.py +30 -7
- smallworld/emulators/panda/machdefs/machdef.py +9 -16
- smallworld/emulators/panda/machdefs/mips.py +49 -5
- smallworld/emulators/panda/machdefs/mips64.py +57 -5
- smallworld/emulators/panda/machdefs/ppc.py +38 -13
- smallworld/emulators/panda/panda.py +146 -44
- smallworld/emulators/unicorn/__init__.py +2 -0
- smallworld/emulators/unicorn/machdefs/aarch64.py +253 -264
- smallworld/emulators/unicorn/machdefs/amd64.py +254 -259
- smallworld/emulators/unicorn/machdefs/arm.py +200 -212
- smallworld/emulators/unicorn/machdefs/i386.py +84 -90
- smallworld/emulators/unicorn/machdefs/machdef.py +2 -23
- smallworld/emulators/unicorn/machdefs/mips.py +127 -135
- smallworld/emulators/unicorn/unicorn.py +52 -13
- smallworld/helpers.py +4 -19
- smallworld/hinting/hinting.py +22 -192
- smallworld/hinting/hints.py +50 -18
- smallworld/instructions/bsid.py +8 -8
- smallworld/logging.py +4 -2
- smallworld/platforms/__init__.py +12 -0
- smallworld/platforms/defs/__init__.py +36 -0
- smallworld/platforms/defs/aarch64.py +450 -0
- smallworld/platforms/defs/amd64.py +463 -0
- smallworld/platforms/defs/arm.py +519 -0
- smallworld/platforms/defs/i386.py +258 -0
- smallworld/platforms/defs/loongarch.py +270 -0
- smallworld/platforms/defs/mips.py +321 -0
- smallworld/platforms/defs/mips64.py +313 -0
- smallworld/platforms/defs/platformdef.py +97 -0
- smallworld/platforms/defs/powerpc.py +259 -0
- smallworld/platforms/defs/riscv.py +257 -0
- smallworld/platforms/defs/xtensa.py +96 -0
- smallworld/{platforms.py → platforms/platforms.py} +3 -0
- smallworld/state/cpus/__init__.py +2 -0
- smallworld/state/cpus/aarch64.py +0 -9
- smallworld/state/cpus/amd64.py +6 -28
- smallworld/state/cpus/arm.py +0 -11
- smallworld/state/cpus/cpu.py +0 -11
- smallworld/state/cpus/i386.py +0 -7
- smallworld/state/cpus/loongarch.py +299 -0
- smallworld/state/cpus/mips.py +4 -47
- smallworld/state/cpus/mips64.py +18 -58
- smallworld/state/cpus/powerpc.py +2 -9
- smallworld/state/cpus/riscv.py +1 -11
- smallworld/state/cpus/xtensa.py +0 -5
- smallworld/state/memory/code.py +38 -2
- smallworld/state/memory/elf/__init__.py +5 -1
- smallworld/state/memory/elf/coredump/__init__.py +3 -0
- smallworld/state/memory/elf/coredump/coredump.py +46 -0
- smallworld/state/memory/elf/coredump/prstatus/__init__.py +27 -0
- smallworld/state/memory/elf/coredump/prstatus/aarch64.py +46 -0
- smallworld/state/memory/elf/coredump/prstatus/amd64.py +40 -0
- smallworld/state/memory/elf/coredump/prstatus/arm.py +53 -0
- smallworld/state/memory/elf/coredump/prstatus/i386.py +30 -0
- smallworld/state/memory/elf/coredump/prstatus/mips.py +55 -0
- smallworld/state/memory/elf/coredump/prstatus/mips64.py +57 -0
- smallworld/state/memory/elf/coredump/prstatus/ppc.py +82 -0
- smallworld/state/memory/elf/coredump/prstatus/prstatus.py +129 -0
- smallworld/state/memory/elf/elf.py +211 -57
- smallworld/state/memory/elf/register_state.py +36 -0
- smallworld/state/memory/elf/rela/__init__.py +2 -0
- smallworld/state/memory/elf/rela/aarch64.py +3 -1
- smallworld/state/memory/elf/rela/amd64.py +4 -2
- smallworld/state/memory/elf/rela/arm.py +4 -2
- smallworld/state/memory/elf/rela/i386.py +4 -2
- smallworld/state/memory/elf/rela/loongarch.py +32 -0
- smallworld/state/memory/elf/rela/mips.py +39 -18
- smallworld/state/memory/elf/rela/ppc.py +31 -14
- smallworld/state/memory/elf/structs.py +3 -0
- smallworld/state/memory/heap.py +2 -2
- smallworld/state/memory/memory.py +18 -0
- smallworld/state/memory/pe/__init__.py +3 -0
- smallworld/state/memory/pe/pe.py +361 -0
- smallworld/state/memory/pe/structs.py +60 -0
- smallworld/state/memory/stack/__init__.py +2 -0
- smallworld/state/memory/stack/loongarch.py +26 -0
- smallworld/state/models/__init__.py +29 -2
- smallworld/state/models/aarch64/__init__.py +1 -0
- smallworld/state/models/aarch64/systemv/__init__.py +6 -0
- smallworld/state/models/aarch64/systemv/c99/__init__.py +12 -0
- smallworld/state/models/aarch64/systemv/c99/signal.py +16 -0
- smallworld/state/models/aarch64/systemv/c99/stdio.py +265 -0
- smallworld/state/models/aarch64/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/aarch64/systemv/c99/string.py +139 -0
- smallworld/state/models/aarch64/systemv/c99/time.py +61 -0
- smallworld/state/models/aarch64/systemv/posix/__init__.py +6 -0
- smallworld/state/models/aarch64/systemv/posix/libgen.py +16 -0
- smallworld/state/models/aarch64/systemv/posix/signal.py +157 -0
- smallworld/state/models/aarch64/systemv/systemv.py +80 -0
- smallworld/state/models/amd64/__init__.py +1 -0
- smallworld/state/models/amd64/systemv/__init__.py +6 -0
- smallworld/state/models/amd64/systemv/c99/__init__.py +12 -0
- smallworld/state/models/amd64/systemv/c99/signal.py +16 -0
- smallworld/state/models/amd64/systemv/c99/stdio.py +265 -0
- smallworld/state/models/amd64/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/amd64/systemv/c99/string.py +139 -0
- smallworld/state/models/amd64/systemv/c99/time.py +61 -0
- smallworld/state/models/amd64/systemv/posix/__init__.py +6 -0
- smallworld/state/models/amd64/systemv/posix/libgen.py +16 -0
- smallworld/state/models/amd64/systemv/posix/signal.py +157 -0
- smallworld/state/models/amd64/systemv/systemv.py +78 -0
- smallworld/state/models/armel/__init__.py +1 -0
- smallworld/state/models/armel/systemv/__init__.py +6 -0
- smallworld/state/models/armel/systemv/c99/__init__.py +12 -0
- smallworld/state/models/armel/systemv/c99/signal.py +16 -0
- smallworld/state/models/armel/systemv/c99/stdio.py +265 -0
- smallworld/state/models/armel/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/armel/systemv/c99/string.py +139 -0
- smallworld/state/models/armel/systemv/c99/time.py +61 -0
- smallworld/state/models/armel/systemv/posix/__init__.py +6 -0
- smallworld/state/models/armel/systemv/posix/libgen.py +16 -0
- smallworld/state/models/armel/systemv/posix/signal.py +157 -0
- smallworld/state/models/armel/systemv/systemv.py +82 -0
- smallworld/state/models/armhf/__init__.py +1 -0
- smallworld/state/models/armhf/systemv/__init__.py +6 -0
- smallworld/state/models/armhf/systemv/c99/__init__.py +12 -0
- smallworld/state/models/armhf/systemv/c99/signal.py +16 -0
- smallworld/state/models/armhf/systemv/c99/stdio.py +265 -0
- smallworld/state/models/armhf/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/armhf/systemv/c99/string.py +139 -0
- smallworld/state/models/armhf/systemv/c99/time.py +61 -0
- smallworld/state/models/armhf/systemv/posix/__init__.py +6 -0
- smallworld/state/models/armhf/systemv/posix/libgen.py +16 -0
- smallworld/state/models/armhf/systemv/posix/signal.py +157 -0
- smallworld/state/models/armhf/systemv/systemv.py +77 -0
- smallworld/state/models/c99/__init__.py +12 -0
- smallworld/state/models/c99/fmt_print.py +915 -0
- smallworld/state/models/c99/fmt_scan.py +864 -0
- smallworld/state/models/c99/math.py +362 -0
- smallworld/state/models/c99/signal.py +71 -0
- smallworld/state/models/c99/stdio.py +1305 -0
- smallworld/state/models/c99/stdlib.py +595 -0
- smallworld/state/models/c99/string.py +674 -0
- smallworld/state/models/c99/time.py +340 -0
- smallworld/state/models/c99/utils.py +89 -0
- smallworld/state/models/cstd.py +759 -0
- smallworld/state/models/errno.py +581 -0
- smallworld/state/models/filedesc.py +515 -0
- smallworld/state/models/i386/__init__.py +1 -0
- smallworld/state/models/i386/systemv/__init__.py +6 -0
- smallworld/state/models/i386/systemv/c99/__init__.py +12 -0
- smallworld/state/models/i386/systemv/c99/signal.py +16 -0
- smallworld/state/models/i386/systemv/c99/stdio.py +265 -0
- smallworld/state/models/i386/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/i386/systemv/c99/string.py +139 -0
- smallworld/state/models/i386/systemv/c99/time.py +61 -0
- smallworld/state/models/i386/systemv/posix/__init__.py +6 -0
- smallworld/state/models/i386/systemv/posix/libgen.py +16 -0
- smallworld/state/models/i386/systemv/posix/signal.py +157 -0
- smallworld/state/models/i386/systemv/systemv.py +71 -0
- smallworld/state/models/loongarch64/__init__.py +1 -0
- smallworld/state/models/loongarch64/systemv/__init__.py +6 -0
- smallworld/state/models/loongarch64/systemv/c99/__init__.py +12 -0
- smallworld/state/models/loongarch64/systemv/c99/signal.py +16 -0
- smallworld/state/models/loongarch64/systemv/c99/stdio.py +265 -0
- smallworld/state/models/loongarch64/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/loongarch64/systemv/c99/string.py +139 -0
- smallworld/state/models/loongarch64/systemv/c99/time.py +61 -0
- smallworld/state/models/loongarch64/systemv/posix/__init__.py +6 -0
- smallworld/state/models/loongarch64/systemv/posix/libgen.py +16 -0
- smallworld/state/models/loongarch64/systemv/posix/signal.py +157 -0
- smallworld/state/models/loongarch64/systemv/systemv.py +83 -0
- smallworld/state/models/mips/__init__.py +1 -0
- smallworld/state/models/mips/systemv/__init__.py +6 -0
- smallworld/state/models/mips/systemv/c99/__init__.py +12 -0
- smallworld/state/models/mips/systemv/c99/signal.py +16 -0
- smallworld/state/models/mips/systemv/c99/stdio.py +265 -0
- smallworld/state/models/mips/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/mips/systemv/c99/string.py +139 -0
- smallworld/state/models/mips/systemv/c99/time.py +61 -0
- smallworld/state/models/mips/systemv/posix/__init__.py +6 -0
- smallworld/state/models/mips/systemv/posix/libgen.py +16 -0
- smallworld/state/models/mips/systemv/posix/signal.py +157 -0
- smallworld/state/models/mips/systemv/systemv.py +78 -0
- smallworld/state/models/mips64/__init__.py +1 -0
- smallworld/state/models/mips64/systemv/__init__.py +6 -0
- smallworld/state/models/mips64/systemv/c99/__init__.py +12 -0
- smallworld/state/models/mips64/systemv/c99/signal.py +16 -0
- smallworld/state/models/mips64/systemv/c99/stdio.py +265 -0
- smallworld/state/models/mips64/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/mips64/systemv/c99/string.py +139 -0
- smallworld/state/models/mips64/systemv/c99/time.py +61 -0
- smallworld/state/models/mips64/systemv/posix/__init__.py +6 -0
- smallworld/state/models/mips64/systemv/posix/libgen.py +16 -0
- smallworld/state/models/mips64/systemv/posix/signal.py +157 -0
- smallworld/state/models/mips64/systemv/systemv.py +98 -0
- smallworld/state/models/mips64el/__init__.py +1 -0
- smallworld/state/models/mips64el/systemv/__init__.py +6 -0
- smallworld/state/models/mips64el/systemv/c99/__init__.py +12 -0
- smallworld/state/models/mips64el/systemv/c99/signal.py +16 -0
- smallworld/state/models/mips64el/systemv/c99/stdio.py +265 -0
- smallworld/state/models/mips64el/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/mips64el/systemv/c99/string.py +139 -0
- smallworld/state/models/mips64el/systemv/c99/time.py +61 -0
- smallworld/state/models/mips64el/systemv/posix/__init__.py +6 -0
- smallworld/state/models/mips64el/systemv/posix/libgen.py +16 -0
- smallworld/state/models/mips64el/systemv/posix/signal.py +157 -0
- smallworld/state/models/mips64el/systemv/systemv.py +96 -0
- smallworld/state/models/mipsel/__init__.py +1 -0
- smallworld/state/models/mipsel/systemv/__init__.py +6 -0
- smallworld/state/models/mipsel/systemv/c99/__init__.py +12 -0
- smallworld/state/models/mipsel/systemv/c99/signal.py +16 -0
- smallworld/state/models/mipsel/systemv/c99/stdio.py +265 -0
- smallworld/state/models/mipsel/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/mipsel/systemv/c99/string.py +139 -0
- smallworld/state/models/mipsel/systemv/c99/time.py +61 -0
- smallworld/state/models/mipsel/systemv/posix/__init__.py +6 -0
- smallworld/state/models/mipsel/systemv/posix/libgen.py +16 -0
- smallworld/state/models/mipsel/systemv/posix/signal.py +157 -0
- smallworld/state/models/mipsel/systemv/systemv.py +78 -0
- smallworld/state/models/model.py +27 -2
- smallworld/state/models/posix/__init__.py +6 -0
- smallworld/state/models/posix/libgen.py +123 -0
- smallworld/state/models/posix/signal.py +690 -0
- smallworld/state/models/powerpc/__init__.py +1 -0
- smallworld/state/models/powerpc/systemv/__init__.py +6 -0
- smallworld/state/models/powerpc/systemv/c99/__init__.py +12 -0
- smallworld/state/models/powerpc/systemv/c99/signal.py +16 -0
- smallworld/state/models/powerpc/systemv/c99/stdio.py +265 -0
- smallworld/state/models/powerpc/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/powerpc/systemv/c99/string.py +139 -0
- smallworld/state/models/powerpc/systemv/c99/time.py +61 -0
- smallworld/state/models/powerpc/systemv/posix/__init__.py +6 -0
- smallworld/state/models/powerpc/systemv/posix/libgen.py +16 -0
- smallworld/state/models/powerpc/systemv/posix/signal.py +157 -0
- smallworld/state/models/powerpc/systemv/systemv.py +93 -0
- smallworld/state/models/riscv64/__init__.py +1 -0
- smallworld/state/models/riscv64/systemv/__init__.py +6 -0
- smallworld/state/models/riscv64/systemv/c99/__init__.py +12 -0
- smallworld/state/models/riscv64/systemv/c99/signal.py +16 -0
- smallworld/state/models/riscv64/systemv/c99/stdio.py +265 -0
- smallworld/state/models/riscv64/systemv/c99/stdlib.py +169 -0
- smallworld/state/models/riscv64/systemv/c99/string.py +139 -0
- smallworld/state/models/riscv64/systemv/c99/time.py +61 -0
- smallworld/state/models/riscv64/systemv/posix/__init__.py +6 -0
- smallworld/state/models/riscv64/systemv/posix/libgen.py +16 -0
- smallworld/state/models/riscv64/systemv/posix/signal.py +157 -0
- smallworld/state/models/riscv64/systemv/systemv.py +85 -0
- smallworld/state/state.py +65 -24
- smallworld/state/unstable/elf.py +16 -31
- smallworld/utils.py +6 -1
- {smallworld_re-1.0.3.dist-info → smallworld_re-2.0.0.dist-info}/METADATA +74 -42
- smallworld_re-2.0.0.dist-info/RECORD +374 -0
- {smallworld_re-1.0.3.dist-info → smallworld_re-2.0.0.dist-info}/WHEEL +1 -1
- smallworld/state/models/x86/__init__.py +0 -2
- smallworld/state/models/x86/microsoftcdecl.py +0 -35
- smallworld/state/models/x86/systemv.py +0 -240
- smallworld_re-1.0.3.dist-info/RECORD +0 -166
- /smallworld/state/models/{posix.py → _posix.py} +0 -0
- {smallworld_re-1.0.3.dist-info → smallworld_re-2.0.0.dist-info}/entry_points.txt +0 -0
- {smallworld_re-1.0.3.dist-info → smallworld_re-2.0.0.dist-info}/licenses/LICENSE.txt +0 -0
- {smallworld_re-1.0.3.dist-info → smallworld_re-2.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,139 @@
|
|
1
|
+
from ....c99 import (
|
2
|
+
Memchr,
|
3
|
+
Memcmp,
|
4
|
+
Memcpy,
|
5
|
+
Memmove,
|
6
|
+
Memset,
|
7
|
+
Strcat,
|
8
|
+
Strchr,
|
9
|
+
Strcmp,
|
10
|
+
Strcoll,
|
11
|
+
Strcpy,
|
12
|
+
Strcspn,
|
13
|
+
Strerror,
|
14
|
+
Strlen,
|
15
|
+
Strncat,
|
16
|
+
Strncmp,
|
17
|
+
Strncpy,
|
18
|
+
Strpbrk,
|
19
|
+
Strrchr,
|
20
|
+
Strspn,
|
21
|
+
Strstr,
|
22
|
+
Strtok,
|
23
|
+
Strxfrm,
|
24
|
+
)
|
25
|
+
from ..systemv import RiscV64SysVModel
|
26
|
+
|
27
|
+
|
28
|
+
class RiscV64SysVMemcpy(Memcpy, RiscV64SysVModel):
|
29
|
+
pass
|
30
|
+
|
31
|
+
|
32
|
+
class RiscV64SysVMemmove(Memmove, RiscV64SysVModel):
|
33
|
+
pass
|
34
|
+
|
35
|
+
|
36
|
+
class RiscV64SysVStrcpy(Strcpy, RiscV64SysVModel):
|
37
|
+
pass
|
38
|
+
|
39
|
+
|
40
|
+
class RiscV64SysVStrncpy(Strncpy, RiscV64SysVModel):
|
41
|
+
pass
|
42
|
+
|
43
|
+
|
44
|
+
class RiscV64SysVStrcat(Strcat, RiscV64SysVModel):
|
45
|
+
pass
|
46
|
+
|
47
|
+
|
48
|
+
class RiscV64SysVStrncat(Strncat, RiscV64SysVModel):
|
49
|
+
pass
|
50
|
+
|
51
|
+
|
52
|
+
class RiscV64SysVMemcmp(Memcmp, RiscV64SysVModel):
|
53
|
+
pass
|
54
|
+
|
55
|
+
|
56
|
+
class RiscV64SysVStrncmp(Strncmp, RiscV64SysVModel):
|
57
|
+
pass
|
58
|
+
|
59
|
+
|
60
|
+
class RiscV64SysVStrcmp(Strcmp, RiscV64SysVModel):
|
61
|
+
pass
|
62
|
+
|
63
|
+
|
64
|
+
class RiscV64SysVStrcoll(Strcoll, RiscV64SysVModel):
|
65
|
+
pass
|
66
|
+
|
67
|
+
|
68
|
+
class RiscV64SysVStrxfrm(Strxfrm, RiscV64SysVModel):
|
69
|
+
pass
|
70
|
+
|
71
|
+
|
72
|
+
class RiscV64SysVMemchr(Memchr, RiscV64SysVModel):
|
73
|
+
pass
|
74
|
+
|
75
|
+
|
76
|
+
class RiscV64SysVStrchr(Strchr, RiscV64SysVModel):
|
77
|
+
pass
|
78
|
+
|
79
|
+
|
80
|
+
class RiscV64SysVStrcspn(Strcspn, RiscV64SysVModel):
|
81
|
+
pass
|
82
|
+
|
83
|
+
|
84
|
+
class RiscV64SysVStrpbrk(Strpbrk, RiscV64SysVModel):
|
85
|
+
pass
|
86
|
+
|
87
|
+
|
88
|
+
class RiscV64SysVStrrchr(Strrchr, RiscV64SysVModel):
|
89
|
+
pass
|
90
|
+
|
91
|
+
|
92
|
+
class RiscV64SysVStrspn(Strspn, RiscV64SysVModel):
|
93
|
+
pass
|
94
|
+
|
95
|
+
|
96
|
+
class RiscV64SysVStrstr(Strstr, RiscV64SysVModel):
|
97
|
+
pass
|
98
|
+
|
99
|
+
|
100
|
+
class RiscV64SysVStrtok(Strtok, RiscV64SysVModel):
|
101
|
+
pass
|
102
|
+
|
103
|
+
|
104
|
+
class RiscV64SysVMemset(Memset, RiscV64SysVModel):
|
105
|
+
pass
|
106
|
+
|
107
|
+
|
108
|
+
class RiscV64SysVStrerror(Strerror, RiscV64SysVModel):
|
109
|
+
pass
|
110
|
+
|
111
|
+
|
112
|
+
class RiscV64SysVStrlen(Strlen, RiscV64SysVModel):
|
113
|
+
pass
|
114
|
+
|
115
|
+
|
116
|
+
__all__ = [
|
117
|
+
"RiscV64SysVMemcpy",
|
118
|
+
"RiscV64SysVMemmove",
|
119
|
+
"RiscV64SysVStrcpy",
|
120
|
+
"RiscV64SysVStrncpy",
|
121
|
+
"RiscV64SysVStrcat",
|
122
|
+
"RiscV64SysVStrncat",
|
123
|
+
"RiscV64SysVMemcmp",
|
124
|
+
"RiscV64SysVStrncmp",
|
125
|
+
"RiscV64SysVStrcmp",
|
126
|
+
"RiscV64SysVStrcoll",
|
127
|
+
"RiscV64SysVStrxfrm",
|
128
|
+
"RiscV64SysVMemchr",
|
129
|
+
"RiscV64SysVStrchr",
|
130
|
+
"RiscV64SysVStrcspn",
|
131
|
+
"RiscV64SysVStrpbrk",
|
132
|
+
"RiscV64SysVStrrchr",
|
133
|
+
"RiscV64SysVStrspn",
|
134
|
+
"RiscV64SysVStrstr",
|
135
|
+
"RiscV64SysVStrtok",
|
136
|
+
"RiscV64SysVMemset",
|
137
|
+
"RiscV64SysVStrerror",
|
138
|
+
"RiscV64SysVStrlen",
|
139
|
+
]
|
@@ -0,0 +1,61 @@
|
|
1
|
+
from ....c99 import (
|
2
|
+
Asctime,
|
3
|
+
Clock,
|
4
|
+
Ctime,
|
5
|
+
Difftime,
|
6
|
+
Gmtime,
|
7
|
+
Localtime,
|
8
|
+
Mktime,
|
9
|
+
Strftime,
|
10
|
+
Time,
|
11
|
+
)
|
12
|
+
from ..systemv import RiscV64SysVModel
|
13
|
+
|
14
|
+
|
15
|
+
class RiscV64SysVTime(Time, RiscV64SysVModel):
|
16
|
+
pass
|
17
|
+
|
18
|
+
|
19
|
+
class RiscV64SysVLocaltime(Localtime, RiscV64SysVModel):
|
20
|
+
pass
|
21
|
+
|
22
|
+
|
23
|
+
class RiscV64SysVGmtime(Gmtime, RiscV64SysVModel):
|
24
|
+
pass
|
25
|
+
|
26
|
+
|
27
|
+
class RiscV64SysVCtime(Ctime, RiscV64SysVModel):
|
28
|
+
pass
|
29
|
+
|
30
|
+
|
31
|
+
class RiscV64SysVAsctime(Asctime, RiscV64SysVModel):
|
32
|
+
pass
|
33
|
+
|
34
|
+
|
35
|
+
class RiscV64SysVStrftime(Strftime, RiscV64SysVModel):
|
36
|
+
pass
|
37
|
+
|
38
|
+
|
39
|
+
class RiscV64SysVDifftime(Difftime, RiscV64SysVModel):
|
40
|
+
pass
|
41
|
+
|
42
|
+
|
43
|
+
class RiscV64SysVMktime(Mktime, RiscV64SysVModel):
|
44
|
+
pass
|
45
|
+
|
46
|
+
|
47
|
+
class RiscV64SysVClock(Clock, RiscV64SysVModel):
|
48
|
+
pass
|
49
|
+
|
50
|
+
|
51
|
+
__all__ = [
|
52
|
+
"RiscV64SysVTime",
|
53
|
+
"RiscV64SysVLocaltime",
|
54
|
+
"RiscV64SysVGmtime",
|
55
|
+
"RiscV64SysVCtime",
|
56
|
+
"RiscV64SysVAsctime",
|
57
|
+
"RiscV64SysVStrftime",
|
58
|
+
"RiscV64SysVDifftime",
|
59
|
+
"RiscV64SysVMktime",
|
60
|
+
"RiscV64SysVClock",
|
61
|
+
]
|
@@ -0,0 +1,16 @@
|
|
1
|
+
from ....posix.libgen import Basename, Dirname
|
2
|
+
from ..systemv import RiscV64SysVModel
|
3
|
+
|
4
|
+
|
5
|
+
class RiscV64SysVBasename(Basename, RiscV64SysVModel):
|
6
|
+
pass
|
7
|
+
|
8
|
+
|
9
|
+
class RiscV64SysVDirname(Dirname, RiscV64SysVModel):
|
10
|
+
pass
|
11
|
+
|
12
|
+
|
13
|
+
__all__ = [
|
14
|
+
"RiscV64SysVBasename",
|
15
|
+
"RiscV64SysVDirname",
|
16
|
+
]
|
@@ -0,0 +1,157 @@
|
|
1
|
+
from ....posix.signal import (
|
2
|
+
BsdSignal,
|
3
|
+
Kill,
|
4
|
+
Killpg,
|
5
|
+
PthreadKill,
|
6
|
+
PthreadSigmask,
|
7
|
+
Sigaction,
|
8
|
+
Sigaddset,
|
9
|
+
Sigaltstack,
|
10
|
+
Sigdelset,
|
11
|
+
Sigemptyset,
|
12
|
+
Sigfillset,
|
13
|
+
Sighold,
|
14
|
+
Sigignore,
|
15
|
+
Siginterrupt,
|
16
|
+
Sigismember,
|
17
|
+
Sigpause,
|
18
|
+
Sigpending,
|
19
|
+
Sigprocmask,
|
20
|
+
Sigqueue,
|
21
|
+
Sigrelse,
|
22
|
+
Sigset,
|
23
|
+
Sigsuspend,
|
24
|
+
Sigtimedwait,
|
25
|
+
Sigwait,
|
26
|
+
Sigwaitinfo,
|
27
|
+
)
|
28
|
+
from ..systemv import RiscV64SysVModel
|
29
|
+
|
30
|
+
|
31
|
+
class RiscV64SysVBsdSignal(BsdSignal, RiscV64SysVModel):
|
32
|
+
pass
|
33
|
+
|
34
|
+
|
35
|
+
class RiscV64SysVKill(Kill, RiscV64SysVModel):
|
36
|
+
pass
|
37
|
+
|
38
|
+
|
39
|
+
class RiscV64SysVKillpg(Killpg, RiscV64SysVModel):
|
40
|
+
pass
|
41
|
+
|
42
|
+
|
43
|
+
class RiscV64SysVPthreadKill(PthreadKill, RiscV64SysVModel):
|
44
|
+
pass
|
45
|
+
|
46
|
+
|
47
|
+
class RiscV64SysVPthreadSigmask(PthreadSigmask, RiscV64SysVModel):
|
48
|
+
pass
|
49
|
+
|
50
|
+
|
51
|
+
class RiscV64SysVSigaction(Sigaction, RiscV64SysVModel):
|
52
|
+
pass
|
53
|
+
|
54
|
+
|
55
|
+
class RiscV64SysVSigaddset(Sigaddset, RiscV64SysVModel):
|
56
|
+
pass
|
57
|
+
|
58
|
+
|
59
|
+
class RiscV64SysVSigaltstack(Sigaltstack, RiscV64SysVModel):
|
60
|
+
pass
|
61
|
+
|
62
|
+
|
63
|
+
class RiscV64SysVSigdelset(Sigdelset, RiscV64SysVModel):
|
64
|
+
pass
|
65
|
+
|
66
|
+
|
67
|
+
class RiscV64SysVSigemptyset(Sigemptyset, RiscV64SysVModel):
|
68
|
+
pass
|
69
|
+
|
70
|
+
|
71
|
+
class RiscV64SysVSigfillset(Sigfillset, RiscV64SysVModel):
|
72
|
+
pass
|
73
|
+
|
74
|
+
|
75
|
+
class RiscV64SysVSighold(Sighold, RiscV64SysVModel):
|
76
|
+
pass
|
77
|
+
|
78
|
+
|
79
|
+
class RiscV64SysVSigignore(Sigignore, RiscV64SysVModel):
|
80
|
+
pass
|
81
|
+
|
82
|
+
|
83
|
+
class RiscV64SysVSiginterrupt(Siginterrupt, RiscV64SysVModel):
|
84
|
+
pass
|
85
|
+
|
86
|
+
|
87
|
+
class RiscV64SysVSigismember(Sigismember, RiscV64SysVModel):
|
88
|
+
pass
|
89
|
+
|
90
|
+
|
91
|
+
class RiscV64SysVSigpause(Sigpause, RiscV64SysVModel):
|
92
|
+
pass
|
93
|
+
|
94
|
+
|
95
|
+
class RiscV64SysVSigpending(Sigpending, RiscV64SysVModel):
|
96
|
+
pass
|
97
|
+
|
98
|
+
|
99
|
+
class RiscV64SysVSigprocmask(Sigprocmask, RiscV64SysVModel):
|
100
|
+
pass
|
101
|
+
|
102
|
+
|
103
|
+
class RiscV64SysVSigqueue(Sigqueue, RiscV64SysVModel):
|
104
|
+
pass
|
105
|
+
|
106
|
+
|
107
|
+
class RiscV64SysVSigrelse(Sigrelse, RiscV64SysVModel):
|
108
|
+
pass
|
109
|
+
|
110
|
+
|
111
|
+
class RiscV64SysVSigset(Sigset, RiscV64SysVModel):
|
112
|
+
pass
|
113
|
+
|
114
|
+
|
115
|
+
class RiscV64SysVSigsuspend(Sigsuspend, RiscV64SysVModel):
|
116
|
+
pass
|
117
|
+
|
118
|
+
|
119
|
+
class RiscV64SysVSigtimedwait(Sigtimedwait, RiscV64SysVModel):
|
120
|
+
pass
|
121
|
+
|
122
|
+
|
123
|
+
class RiscV64SysVSigwait(Sigwait, RiscV64SysVModel):
|
124
|
+
pass
|
125
|
+
|
126
|
+
|
127
|
+
class RiscV64SysVSigwaitinfo(Sigwaitinfo, RiscV64SysVModel):
|
128
|
+
pass
|
129
|
+
|
130
|
+
|
131
|
+
__all__ = [
|
132
|
+
"RiscV64SysVBsdSignal",
|
133
|
+
"RiscV64SysVKill",
|
134
|
+
"RiscV64SysVKillpg",
|
135
|
+
"RiscV64SysVPthreadKill",
|
136
|
+
"RiscV64SysVPthreadSigmask",
|
137
|
+
"RiscV64SysVSigaction",
|
138
|
+
"RiscV64SysVSigaddset",
|
139
|
+
"RiscV64SysVSigaltstack",
|
140
|
+
"RiscV64SysVSigdelset",
|
141
|
+
"RiscV64SysVSigemptyset",
|
142
|
+
"RiscV64SysVSigfillset",
|
143
|
+
"RiscV64SysVSighold",
|
144
|
+
"RiscV64SysVSigignore",
|
145
|
+
"RiscV64SysVSiginterrupt",
|
146
|
+
"RiscV64SysVSigismember",
|
147
|
+
"RiscV64SysVSigpause",
|
148
|
+
"RiscV64SysVSigpending",
|
149
|
+
"RiscV64SysVSigprocmask",
|
150
|
+
"RiscV64SysVSigqueue",
|
151
|
+
"RiscV64SysVSigrelse",
|
152
|
+
"RiscV64SysVSigset",
|
153
|
+
"RiscV64SysVSigsuspend",
|
154
|
+
"RiscV64SysVSigtimedwait",
|
155
|
+
"RiscV64SysVSigwait",
|
156
|
+
"RiscV64SysVSigwaitinfo",
|
157
|
+
]
|
@@ -0,0 +1,85 @@
|
|
1
|
+
import struct
|
2
|
+
|
3
|
+
from ..... import emulators, platforms
|
4
|
+
from ...cstd import ArgumentType, CStdModel
|
5
|
+
|
6
|
+
|
7
|
+
class RiscV64SysVModel(CStdModel):
|
8
|
+
"""Base class for C models using the AArch64 System V ABI"""
|
9
|
+
|
10
|
+
platform = platforms.Platform(
|
11
|
+
platforms.Architecture.RISCV64, platforms.Byteorder.LITTLE
|
12
|
+
)
|
13
|
+
abi = platforms.ABI.SYSTEMV
|
14
|
+
|
15
|
+
_int_sign_mask = 0x80000000
|
16
|
+
_int_inv_mask = 0xFFFFFFFF
|
17
|
+
_long_sign_mask = 0x8000000000000000
|
18
|
+
_long_inv_mask = 0xFFFFFFFFFFFFFFFF
|
19
|
+
_long_long_sign_mask = 0x8000000000000000
|
20
|
+
_long_long_inv_mask = 0xFFFFFFFFFFFFFFFF
|
21
|
+
|
22
|
+
_four_byte_types = {ArgumentType.INT, ArgumentType.UINT}
|
23
|
+
|
24
|
+
_eight_byte_types = {
|
25
|
+
ArgumentType.LONG,
|
26
|
+
ArgumentType.ULONG,
|
27
|
+
ArgumentType.LONGLONG,
|
28
|
+
ArgumentType.ULONGLONG,
|
29
|
+
ArgumentType.SIZE_T,
|
30
|
+
ArgumentType.SSIZE_T,
|
31
|
+
ArgumentType.POINTER,
|
32
|
+
}
|
33
|
+
|
34
|
+
_four_byte_arg_regs = ["a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7"]
|
35
|
+
|
36
|
+
_eight_byte_arg_regs = [
|
37
|
+
"a0",
|
38
|
+
"a1",
|
39
|
+
"a2",
|
40
|
+
"a3",
|
41
|
+
"a4",
|
42
|
+
"a5",
|
43
|
+
"a6",
|
44
|
+
"a7",
|
45
|
+
]
|
46
|
+
|
47
|
+
_soft_float = False
|
48
|
+
_variadic_soft_float = True
|
49
|
+
_floats_are_doubles = False
|
50
|
+
_float_arg_regs = ["fa0", "fa1", "fa2", "fa3", "fa4", "fa5", "fa6"]
|
51
|
+
|
52
|
+
_double_arg_regs = ["fa0", "fa1", "fa2", "fa3", "fa4", "fa5", "fa6"]
|
53
|
+
|
54
|
+
_init_stack_offset = 0
|
55
|
+
_align_stack = False
|
56
|
+
_eight_byte_reg_size = 1
|
57
|
+
_double_reg_size = 1
|
58
|
+
_four_byte_stack_size = 8
|
59
|
+
_eight_byte_stack_size = 8
|
60
|
+
_float_stack_size = 8
|
61
|
+
_double_stack_size = 8
|
62
|
+
|
63
|
+
def _return_4_byte(self, emulator: emulators.Emulator, val: int) -> None:
|
64
|
+
"""Return a four-byte type"""
|
65
|
+
val &= self._int_inv_mask
|
66
|
+
# riscv64 sign-extends 4-byte ints to fill the register.
|
67
|
+
if val & self._int_sign_mask != 0:
|
68
|
+
val |= self._int_signext_mask
|
69
|
+
emulator.write_register("a0", val)
|
70
|
+
|
71
|
+
def _return_8_byte(self, emulator: emulators.Emulator, val: int) -> None:
|
72
|
+
"""Return an eight-byte type"""
|
73
|
+
emulator.write_register("a0", val)
|
74
|
+
|
75
|
+
def _return_float(self, emulator: emulators.Emulator, val: float) -> None:
|
76
|
+
"""Return a float"""
|
77
|
+
data = struct.pack("<f", val)
|
78
|
+
intval = int.from_bytes(data, "little")
|
79
|
+
emulator.write_register("fa0", intval)
|
80
|
+
|
81
|
+
def _return_double(self, emulator: emulators.Emulator, val: float) -> None:
|
82
|
+
"""Return a double"""
|
83
|
+
data = struct.pack("<d", val)
|
84
|
+
intval = int.from_bytes(data, "little")
|
85
|
+
emulator.write_register("fa0", intval)
|
smallworld/state/state.py
CHANGED
@@ -42,7 +42,7 @@ class Stateful(metaclass=abc.ABCMeta):
|
|
42
42
|
|
43
43
|
|
44
44
|
class Value(metaclass=abc.ABCMeta):
|
45
|
-
"""An abstract class whose subclasses all have a tuple of content, type, and label.
|
45
|
+
"""An abstract class whose subclasses all have a tuple of content, type, and label. Content is the value which must be convertable into bytes. The type is a ctype reprensenting the type of content. Label is a string that is a human label for the object. Any or all are optional."""
|
46
46
|
|
47
47
|
def __init__(self: typing.Any) -> None:
|
48
48
|
self._content: typing.Union[None, int, bytes, claripy.ast.bv.BV] = None
|
@@ -197,6 +197,14 @@ class Value(metaclass=abc.ABCMeta):
|
|
197
197
|
else:
|
198
198
|
return None
|
199
199
|
|
200
|
+
def __getstate__(self):
|
201
|
+
# Override default pickling operation
|
202
|
+
# The '_type' field is a ctypes class which won't be pickleable.
|
203
|
+
# TODO: figure out how to pickle ctypes classes
|
204
|
+
state = self.__dict__.copy()
|
205
|
+
state["_type"] = None
|
206
|
+
return state
|
207
|
+
|
200
208
|
@abc.abstractmethod
|
201
209
|
def to_bytes(self, byteorder: platforms.Byteorder) -> bytes:
|
202
210
|
"""Convert this value into a byte string.
|
@@ -222,17 +230,26 @@ class Value(metaclass=abc.ABCMeta):
|
|
222
230
|
"""
|
223
231
|
|
224
232
|
class CTypeValue(Value):
|
225
|
-
|
226
|
-
|
227
|
-
|
233
|
+
def __init__(self, ctype: typing.Any, label: str):
|
234
|
+
self._content = ctype
|
235
|
+
self._label = label
|
236
|
+
self._type = ctype.__class__
|
237
|
+
|
238
|
+
def __getstate__(self):
|
239
|
+
state = self.__dict__.copy()
|
240
|
+
del state["_content"]
|
241
|
+
del state["_type"]
|
242
|
+
return state
|
243
|
+
|
244
|
+
# def __setstate__(self, state):
|
228
245
|
|
229
246
|
def get_size(self) -> int:
|
230
|
-
return ctypes.sizeof(self._content)
|
247
|
+
return ctypes.sizeof(self._content) # type: ignore
|
231
248
|
|
232
249
|
def to_bytes(self, byteorder: platforms.Byteorder) -> bytes:
|
233
|
-
return bytes(self._content)
|
250
|
+
return bytes(self._content) # type: ignore
|
234
251
|
|
235
|
-
return CTypeValue()
|
252
|
+
return CTypeValue(ctype, label)
|
236
253
|
|
237
254
|
|
238
255
|
class SymbolicValue(Value):
|
@@ -812,18 +829,12 @@ class Machine(StatefulSet):
|
|
812
829
|
machine_copy = copy.deepcopy(self)
|
813
830
|
machine_copy.extract(emulator)
|
814
831
|
yield machine_copy
|
832
|
+
|
815
833
|
except exceptions.EmulationBounds:
|
816
|
-
# import pdb
|
817
|
-
# pdb.set_trace()
|
818
834
|
print(
|
819
835
|
"emulation complete; encountered exit point or went out of bounds"
|
820
836
|
)
|
821
837
|
break
|
822
|
-
except Exception as e:
|
823
|
-
# import pdb
|
824
|
-
# pdb.set_trace()
|
825
|
-
print(f"emulation ended; raised exception {e}")
|
826
|
-
break
|
827
838
|
return None
|
828
839
|
|
829
840
|
def fuzz(
|
@@ -839,26 +850,56 @@ class Machine(StatefulSet):
|
|
839
850
|
Arguments:
|
840
851
|
emulator: Currently, must be the unicorn emulator
|
841
852
|
input_callback: A callback that applies an input to a machine
|
853
|
+
input_file_path: The path of the input file AFL will mutate. If not given, we assume argv[1].
|
842
854
|
crash_callback: An optional callback that is given the unicorn state and can decide whether or not to record it as a crash. (See unicornafl documentation for more info)
|
843
855
|
always_validate: Whether to run the crash_callback on every run or only when unicorn returns an error.
|
844
856
|
iterations: The number of iterations to run before forking a new child
|
845
857
|
Returns:
|
846
858
|
Bytes for this value with the given byteorder.
|
847
859
|
"""
|
848
|
-
|
849
|
-
import argparse
|
850
|
-
|
851
|
-
import unicornafl
|
852
|
-
except ImportError:
|
853
|
-
raise RuntimeError(
|
854
|
-
"missing `unicornafl` - afl++ must be installed manually from source"
|
855
|
-
)
|
860
|
+
import argparse
|
856
861
|
|
857
862
|
arg_parser = argparse.ArgumentParser(description="AFL Harness")
|
858
863
|
arg_parser.add_argument(
|
859
864
|
"input_file", type=str, help="File path AFL will mutate"
|
860
865
|
)
|
861
866
|
args = arg_parser.parse_args()
|
867
|
+
self.fuzz_with_file(
|
868
|
+
emulator,
|
869
|
+
input_callback,
|
870
|
+
args.input_file,
|
871
|
+
crash_callback,
|
872
|
+
always_validate,
|
873
|
+
iterations,
|
874
|
+
)
|
875
|
+
|
876
|
+
def fuzz_with_file(
|
877
|
+
self,
|
878
|
+
emulator: emulators.Emulator,
|
879
|
+
input_callback: typing.Callable,
|
880
|
+
input_file_path: str,
|
881
|
+
crash_callback: typing.Optional[typing.Callable] = None,
|
882
|
+
always_validate: bool = False,
|
883
|
+
iterations: int = 1,
|
884
|
+
) -> None:
|
885
|
+
"""Fuzz the machine using unicornafl.
|
886
|
+
|
887
|
+
Arguments:
|
888
|
+
emulator: Currently, must be the unicorn emulator
|
889
|
+
input_callback: A callback that applies an input to a machine
|
890
|
+
input_file_path: The path of the input file AFL will mutate. If not given, we assume argv[1].
|
891
|
+
crash_callback: An optional callback that is given the unicorn state and can decide whether or not to record it as a crash. (See unicornafl documentation for more info)
|
892
|
+
always_validate: Whether to run the crash_callback on every run or only when unicorn returns an error.
|
893
|
+
iterations: The number of iterations to run before forking a new child
|
894
|
+
Returns:
|
895
|
+
Bytes for this value with the given byteorder.
|
896
|
+
"""
|
897
|
+
try:
|
898
|
+
import unicornafl
|
899
|
+
except ImportError:
|
900
|
+
raise RuntimeError(
|
901
|
+
"missing `unicornafl` - afl++ must be installed manually from source"
|
902
|
+
)
|
862
903
|
|
863
904
|
if not isinstance(emulator, emulators.UnicornEmulator):
|
864
905
|
raise RuntimeError("you must use a unicorn emulator to fuzz")
|
@@ -867,7 +908,7 @@ class Machine(StatefulSet):
|
|
867
908
|
|
868
909
|
unicornafl.uc_afl_fuzz(
|
869
910
|
uc=emulator.engine,
|
870
|
-
input_file=
|
911
|
+
input_file=input_file_path,
|
871
912
|
place_input_callback=input_callback,
|
872
913
|
exits=emulator.get_exit_points(),
|
873
914
|
validate_crash_callback=crash_callback,
|
@@ -942,7 +983,7 @@ class Machine(StatefulSet):
|
|
942
983
|
for m in self:
|
943
984
|
if issubclass(type(m), state.memory.Memory):
|
944
985
|
for po, v in m.items():
|
945
|
-
if m.address + po <= address <= m.address + po + v.
|
986
|
+
if m.address + po <= address <= m.address + po + v.get_size():
|
946
987
|
c = m[po].get()
|
947
988
|
o = address - (m.address + po)
|
948
989
|
return c[o : o + size]
|