smallworld-re 1.0.2__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 +44 -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 +225 -61
- 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.2.dist-info → smallworld_re-2.0.0.dist-info}/METADATA +76 -43
- smallworld_re-2.0.0.dist-info/RECORD +374 -0
- {smallworld_re-1.0.2.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.2.dist-info/RECORD +0 -166
- /smallworld/state/models/{posix.py → _posix.py} +0 -0
- {smallworld_re-1.0.2.dist-info → smallworld_re-2.0.0.dist-info}/entry_points.txt +0 -0
- {smallworld_re-1.0.2.dist-info → smallworld_re-2.0.0.dist-info/licenses}/LICENSE.txt +0 -0
- {smallworld_re-1.0.2.dist-info → smallworld_re-2.0.0.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,3 @@
|
|
1
|
-
import capstone
|
2
1
|
import unicorn
|
3
2
|
|
4
3
|
from ....platforms import Architecture, Byteorder
|
@@ -11,37 +10,32 @@ class ARMMachineDef(UnicornMachineDef):
|
|
11
10
|
uc_arch = unicorn.UC_ARCH_ARM
|
12
11
|
uc_mode = unicorn.UC_MODE_ARM
|
13
12
|
|
14
|
-
cs_arch = capstone.CS_ARCH_ARM
|
15
|
-
cs_mode = capstone.CS_MODE_ARM
|
16
|
-
|
17
|
-
pc_reg = "pc"
|
18
|
-
|
19
13
|
def __init__(self):
|
20
14
|
self._registers = {
|
21
|
-
"r0":
|
22
|
-
"r1":
|
23
|
-
"r2":
|
24
|
-
"r3":
|
25
|
-
"r4":
|
26
|
-
"r5":
|
27
|
-
"r6":
|
28
|
-
"r7":
|
29
|
-
"r8":
|
15
|
+
"r0": unicorn.arm_const.UC_ARM_REG_R0,
|
16
|
+
"r1": unicorn.arm_const.UC_ARM_REG_R1,
|
17
|
+
"r2": unicorn.arm_const.UC_ARM_REG_R2,
|
18
|
+
"r3": unicorn.arm_const.UC_ARM_REG_R3,
|
19
|
+
"r4": unicorn.arm_const.UC_ARM_REG_R4,
|
20
|
+
"r5": unicorn.arm_const.UC_ARM_REG_R5,
|
21
|
+
"r6": unicorn.arm_const.UC_ARM_REG_R6,
|
22
|
+
"r7": unicorn.arm_const.UC_ARM_REG_R7,
|
23
|
+
"r8": unicorn.arm_const.UC_ARM_REG_R8,
|
30
24
|
# r9 doubles as the Static base pointer
|
31
|
-
"r9":
|
32
|
-
"sb":
|
25
|
+
"r9": unicorn.arm_const.UC_ARM_REG_R9,
|
26
|
+
"sb": unicorn.arm_const.UC_ARM_REG_SB,
|
33
27
|
# r10 doubles as the Stack Limit pointer
|
34
|
-
"r10":
|
35
|
-
"sl":
|
28
|
+
"r10": unicorn.arm_const.UC_ARM_REG_R10,
|
29
|
+
"sl": unicorn.arm_const.UC_ARM_REG_SL,
|
36
30
|
# r11 doubles as the Frame Pointer, if desired.
|
37
|
-
"r11":
|
38
|
-
"fp":
|
31
|
+
"r11": unicorn.arm_const.UC_ARM_REG_R11,
|
32
|
+
"fp": unicorn.arm_const.UC_ARM_REG_FP,
|
39
33
|
# r12 doubles as the Intra-call scratch register
|
40
|
-
"r12":
|
41
|
-
"ip":
|
42
|
-
"sp":
|
43
|
-
"lr":
|
44
|
-
"pc":
|
34
|
+
"r12": unicorn.arm_const.UC_ARM_REG_R12,
|
35
|
+
"ip": unicorn.arm_const.UC_ARM_REG_IP,
|
36
|
+
"sp": unicorn.arm_const.UC_ARM_REG_SP,
|
37
|
+
"lr": unicorn.arm_const.UC_ARM_REG_LR,
|
38
|
+
"pc": unicorn.arm_const.UC_ARM_REG_PC,
|
45
39
|
}
|
46
40
|
|
47
41
|
|
@@ -55,18 +49,13 @@ class ARMMachineMixinM:
|
|
55
49
|
# NOTE: PSR is aliased to CPSR
|
56
50
|
# This is an artifact of the fact that Unicorn
|
57
51
|
# seems to emulate a mash-up of M- and A-series arm.
|
58
|
-
"psr":
|
59
|
-
"primask":
|
60
|
-
"basepri":
|
61
|
-
"faultmask":
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
4,
|
66
|
-
),
|
67
|
-
"control": (unicorn.arm_const.UC_ARM_REG_CONTROL, "control", 0, 4),
|
68
|
-
"msp": (unicorn.arm_const.UC_ARM_REG_MSP, "msp", 0, 4),
|
69
|
-
"psp": (unicorn.arm_const.UC_ARM_REG_PSP, "psp", 0, 4),
|
52
|
+
"psr": unicorn.arm_const.UC_ARM_REG_CPSR,
|
53
|
+
"primask": unicorn.arm_const.UC_ARM_REG_PRIMASK,
|
54
|
+
"basepri": unicorn.arm_const.UC_ARM_REG_BASEPRI,
|
55
|
+
"faultmask": unicorn.arm_const.UC_ARM_REG_FAULTMASK,
|
56
|
+
"control": unicorn.arm_const.UC_ARM_REG_CONTROL,
|
57
|
+
"msp": unicorn.arm_const.UC_ARM_REG_MSP,
|
58
|
+
"psp": unicorn.arm_const.UC_ARM_REG_PSP,
|
70
59
|
}
|
71
60
|
)
|
72
61
|
|
@@ -78,42 +67,42 @@ class ARMMachineMixinRA:
|
|
78
67
|
super().__init__()
|
79
68
|
self._registers.update(
|
80
69
|
{
|
81
|
-
"cpsr":
|
82
|
-
"spsr":
|
70
|
+
"cpsr": unicorn.arm_const.UC_ARM_REG_CPSR,
|
71
|
+
"spsr": unicorn.arm_const.UC_ARM_REG_SPSR,
|
83
72
|
# NOTE: None of the banked registers have Unicorn IDs
|
84
|
-
"sp_usr":
|
85
|
-
"lr_usr":
|
86
|
-
"r8_usr":
|
87
|
-
"r9_usr":
|
88
|
-
"r10_usr":
|
89
|
-
"r11_usr":
|
90
|
-
"r12_usr":
|
91
|
-
"sp_hyp":
|
92
|
-
"spsr_hyp":
|
93
|
-
"elr_hyp":
|
94
|
-
"sp_svc":
|
95
|
-
"lr_svc":
|
96
|
-
"spsr_svc":
|
97
|
-
"sp_abt":
|
98
|
-
"lr_abt":
|
99
|
-
"spsr_abt":
|
100
|
-
"sp_und":
|
101
|
-
"lr_und":
|
102
|
-
"spsr_und":
|
103
|
-
"sp_mon":
|
104
|
-
"lr_mon":
|
105
|
-
"spsr_mon":
|
106
|
-
"sp_irq":
|
107
|
-
"lr_irq":
|
108
|
-
"spsr_irq":
|
109
|
-
"sp_fiq":
|
110
|
-
"lr_fiq":
|
111
|
-
"spsr_fiq":
|
112
|
-
"r8_fiq":
|
113
|
-
"r9_fiq":
|
114
|
-
"r10_fiq":
|
115
|
-
"r11_fiq":
|
116
|
-
"r12_fiq":
|
73
|
+
"sp_usr": unicorn.arm_const.UC_ARM_REG_INVALID,
|
74
|
+
"lr_usr": unicorn.arm_const.UC_ARM_REG_INVALID,
|
75
|
+
"r8_usr": unicorn.arm_const.UC_ARM_REG_INVALID,
|
76
|
+
"r9_usr": unicorn.arm_const.UC_ARM_REG_INVALID,
|
77
|
+
"r10_usr": unicorn.arm_const.UC_ARM_REG_INVALID,
|
78
|
+
"r11_usr": unicorn.arm_const.UC_ARM_REG_INVALID,
|
79
|
+
"r12_usr": unicorn.arm_const.UC_ARM_REG_INVALID,
|
80
|
+
"sp_hyp": unicorn.arm_const.UC_ARM_REG_INVALID,
|
81
|
+
"spsr_hyp": unicorn.arm_const.UC_ARM_REG_INVALID,
|
82
|
+
"elr_hyp": unicorn.arm_const.UC_ARM_REG_INVALID,
|
83
|
+
"sp_svc": unicorn.arm_const.UC_ARM_REG_INVALID,
|
84
|
+
"lr_svc": unicorn.arm_const.UC_ARM_REG_INVALID,
|
85
|
+
"spsr_svc": unicorn.arm_const.UC_ARM_REG_INVALID,
|
86
|
+
"sp_abt": unicorn.arm_const.UC_ARM_REG_INVALID,
|
87
|
+
"lr_abt": unicorn.arm_const.UC_ARM_REG_INVALID,
|
88
|
+
"spsr_abt": unicorn.arm_const.UC_ARM_REG_INVALID,
|
89
|
+
"sp_und": unicorn.arm_const.UC_ARM_REG_INVALID,
|
90
|
+
"lr_und": unicorn.arm_const.UC_ARM_REG_INVALID,
|
91
|
+
"spsr_und": unicorn.arm_const.UC_ARM_REG_INVALID,
|
92
|
+
"sp_mon": unicorn.arm_const.UC_ARM_REG_INVALID,
|
93
|
+
"lr_mon": unicorn.arm_const.UC_ARM_REG_INVALID,
|
94
|
+
"spsr_mon": unicorn.arm_const.UC_ARM_REG_INVALID,
|
95
|
+
"sp_irq": unicorn.arm_const.UC_ARM_REG_INVALID,
|
96
|
+
"lr_irq": unicorn.arm_const.UC_ARM_REG_INVALID,
|
97
|
+
"spsr_irq": unicorn.arm_const.UC_ARM_REG_INVALID,
|
98
|
+
"sp_fiq": unicorn.arm_const.UC_ARM_REG_INVALID,
|
99
|
+
"lr_fiq": unicorn.arm_const.UC_ARM_REG_INVALID,
|
100
|
+
"spsr_fiq": unicorn.arm_const.UC_ARM_REG_INVALID,
|
101
|
+
"r8_fiq": unicorn.arm_const.UC_ARM_REG_INVALID,
|
102
|
+
"r9_fiq": unicorn.arm_const.UC_ARM_REG_INVALID,
|
103
|
+
"r10_fiq": unicorn.arm_const.UC_ARM_REG_INVALID,
|
104
|
+
"r11_fiq": unicorn.arm_const.UC_ARM_REG_INVALID,
|
105
|
+
"r12_fiq": unicorn.arm_const.UC_ARM_REG_INVALID,
|
117
106
|
}
|
118
107
|
)
|
119
108
|
|
@@ -125,59 +114,59 @@ class ARMMachineMixinFP:
|
|
125
114
|
super().__init__()
|
126
115
|
self._registers.update(
|
127
116
|
{
|
128
|
-
"fpscr":
|
129
|
-
"fpexc":
|
130
|
-
"fpsid":
|
131
|
-
"mvfr0":
|
132
|
-
"mvfr1":
|
133
|
-
"d0":
|
134
|
-
"s0":
|
135
|
-
"s1":
|
136
|
-
"d1":
|
137
|
-
"s2":
|
138
|
-
"s3":
|
139
|
-
"d2":
|
140
|
-
"s4":
|
141
|
-
"s5":
|
142
|
-
"d3":
|
143
|
-
"s6":
|
144
|
-
"s7":
|
145
|
-
"d4":
|
146
|
-
"s8":
|
147
|
-
"s9":
|
148
|
-
"d5":
|
149
|
-
"s10":
|
150
|
-
"s11":
|
151
|
-
"d6":
|
152
|
-
"s12":
|
153
|
-
"s13":
|
154
|
-
"d7":
|
155
|
-
"s14":
|
156
|
-
"s15":
|
157
|
-
"d8":
|
158
|
-
"s16":
|
159
|
-
"s17":
|
160
|
-
"d9":
|
161
|
-
"s18":
|
162
|
-
"s19":
|
163
|
-
"d10":
|
164
|
-
"s20":
|
165
|
-
"s21":
|
166
|
-
"d11":
|
167
|
-
"s22":
|
168
|
-
"s23":
|
169
|
-
"d12":
|
170
|
-
"s24":
|
171
|
-
"s25":
|
172
|
-
"d13":
|
173
|
-
"s26":
|
174
|
-
"s27":
|
175
|
-
"d14":
|
176
|
-
"s28":
|
177
|
-
"s29":
|
178
|
-
"d15":
|
179
|
-
"s30":
|
180
|
-
"s31":
|
117
|
+
"fpscr": unicorn.arm_const.UC_ARM_REG_FPSCR,
|
118
|
+
"fpexc": unicorn.arm_const.UC_ARM_REG_FPEXC,
|
119
|
+
"fpsid": unicorn.arm_const.UC_ARM_REG_FPSID,
|
120
|
+
"mvfr0": unicorn.arm_const.UC_ARM_REG_INVALID,
|
121
|
+
"mvfr1": unicorn.arm_const.UC_ARM_REG_INVALID,
|
122
|
+
"d0": unicorn.arm_const.UC_ARM_REG_D0,
|
123
|
+
"s0": unicorn.arm_const.UC_ARM_REG_S0,
|
124
|
+
"s1": unicorn.arm_const.UC_ARM_REG_S1,
|
125
|
+
"d1": unicorn.arm_const.UC_ARM_REG_D1,
|
126
|
+
"s2": unicorn.arm_const.UC_ARM_REG_S2,
|
127
|
+
"s3": unicorn.arm_const.UC_ARM_REG_S3,
|
128
|
+
"d2": unicorn.arm_const.UC_ARM_REG_D2,
|
129
|
+
"s4": unicorn.arm_const.UC_ARM_REG_S4,
|
130
|
+
"s5": unicorn.arm_const.UC_ARM_REG_S5,
|
131
|
+
"d3": unicorn.arm_const.UC_ARM_REG_D3,
|
132
|
+
"s6": unicorn.arm_const.UC_ARM_REG_S6,
|
133
|
+
"s7": unicorn.arm_const.UC_ARM_REG_S7,
|
134
|
+
"d4": unicorn.arm_const.UC_ARM_REG_D4,
|
135
|
+
"s8": unicorn.arm_const.UC_ARM_REG_S8,
|
136
|
+
"s9": unicorn.arm_const.UC_ARM_REG_S9,
|
137
|
+
"d5": unicorn.arm_const.UC_ARM_REG_D5,
|
138
|
+
"s10": unicorn.arm_const.UC_ARM_REG_S10,
|
139
|
+
"s11": unicorn.arm_const.UC_ARM_REG_S11,
|
140
|
+
"d6": unicorn.arm_const.UC_ARM_REG_D6,
|
141
|
+
"s12": unicorn.arm_const.UC_ARM_REG_S12,
|
142
|
+
"s13": unicorn.arm_const.UC_ARM_REG_S13,
|
143
|
+
"d7": unicorn.arm_const.UC_ARM_REG_D7,
|
144
|
+
"s14": unicorn.arm_const.UC_ARM_REG_S14,
|
145
|
+
"s15": unicorn.arm_const.UC_ARM_REG_S15,
|
146
|
+
"d8": unicorn.arm_const.UC_ARM_REG_D8,
|
147
|
+
"s16": unicorn.arm_const.UC_ARM_REG_S16,
|
148
|
+
"s17": unicorn.arm_const.UC_ARM_REG_S17,
|
149
|
+
"d9": unicorn.arm_const.UC_ARM_REG_D9,
|
150
|
+
"s18": unicorn.arm_const.UC_ARM_REG_S18,
|
151
|
+
"s19": unicorn.arm_const.UC_ARM_REG_S19,
|
152
|
+
"d10": unicorn.arm_const.UC_ARM_REG_D10,
|
153
|
+
"s20": unicorn.arm_const.UC_ARM_REG_S20,
|
154
|
+
"s21": unicorn.arm_const.UC_ARM_REG_S21,
|
155
|
+
"d11": unicorn.arm_const.UC_ARM_REG_D11,
|
156
|
+
"s22": unicorn.arm_const.UC_ARM_REG_S22,
|
157
|
+
"s23": unicorn.arm_const.UC_ARM_REG_S23,
|
158
|
+
"d12": unicorn.arm_const.UC_ARM_REG_D12,
|
159
|
+
"s24": unicorn.arm_const.UC_ARM_REG_S24,
|
160
|
+
"s25": unicorn.arm_const.UC_ARM_REG_S25,
|
161
|
+
"d13": unicorn.arm_const.UC_ARM_REG_D13,
|
162
|
+
"s26": unicorn.arm_const.UC_ARM_REG_S26,
|
163
|
+
"s27": unicorn.arm_const.UC_ARM_REG_S27,
|
164
|
+
"d14": unicorn.arm_const.UC_ARM_REG_D14,
|
165
|
+
"s28": unicorn.arm_const.UC_ARM_REG_S28,
|
166
|
+
"s29": unicorn.arm_const.UC_ARM_REG_S29,
|
167
|
+
"d15": unicorn.arm_const.UC_ARM_REG_D15,
|
168
|
+
"s30": unicorn.arm_const.UC_ARM_REG_S30,
|
169
|
+
"s31": unicorn.arm_const.UC_ARM_REG_S31,
|
181
170
|
}
|
182
171
|
)
|
183
172
|
|
@@ -189,91 +178,91 @@ class ARMMachineMixinVFP:
|
|
189
178
|
super().__init__()
|
190
179
|
self._registers.update(
|
191
180
|
{
|
192
|
-
"fpscr":
|
193
|
-
"fpexc":
|
194
|
-
"fpsid":
|
195
|
-
"mvfr0":
|
196
|
-
"mvfr1":
|
197
|
-
"q0":
|
198
|
-
"d0":
|
199
|
-
"s0":
|
200
|
-
"s1":
|
201
|
-
"d1":
|
202
|
-
"s2":
|
203
|
-
"s3":
|
204
|
-
"q1":
|
205
|
-
"d2":
|
206
|
-
"s4":
|
207
|
-
"s5":
|
208
|
-
"d3":
|
209
|
-
"s6":
|
210
|
-
"s7":
|
211
|
-
"q2":
|
212
|
-
"d4":
|
213
|
-
"s8":
|
214
|
-
"s9":
|
215
|
-
"d5":
|
216
|
-
"s10":
|
217
|
-
"s11":
|
218
|
-
"q3":
|
219
|
-
"d6":
|
220
|
-
"s12":
|
221
|
-
"s13":
|
222
|
-
"d7":
|
223
|
-
"s14":
|
224
|
-
"s15":
|
225
|
-
"q4":
|
226
|
-
"d8":
|
227
|
-
"s16":
|
228
|
-
"s17":
|
229
|
-
"d9":
|
230
|
-
"s18":
|
231
|
-
"s19":
|
232
|
-
"q5":
|
233
|
-
"d10":
|
234
|
-
"s20":
|
235
|
-
"s21":
|
236
|
-
"d11":
|
237
|
-
"s22":
|
238
|
-
"s23":
|
239
|
-
"q6":
|
240
|
-
"d12":
|
241
|
-
"s24":
|
242
|
-
"s25":
|
243
|
-
"d13":
|
244
|
-
"s26":
|
245
|
-
"s27":
|
246
|
-
"q7":
|
247
|
-
"d14":
|
248
|
-
"s28":
|
249
|
-
"s29":
|
250
|
-
"d15":
|
251
|
-
"s30":
|
252
|
-
"s31":
|
253
|
-
"q8":
|
254
|
-
"d16":
|
255
|
-
"d17":
|
256
|
-
"q9":
|
257
|
-
"d18":
|
258
|
-
"d19":
|
259
|
-
"q10":
|
260
|
-
"d20":
|
261
|
-
"d21":
|
262
|
-
"q11":
|
263
|
-
"d22":
|
264
|
-
"d23":
|
265
|
-
"q12":
|
266
|
-
"d24":
|
267
|
-
"d25":
|
268
|
-
"q13":
|
269
|
-
"d26":
|
270
|
-
"d27":
|
271
|
-
"q14":
|
272
|
-
"d28":
|
273
|
-
"d29":
|
274
|
-
"q15":
|
275
|
-
"d30":
|
276
|
-
"d31":
|
181
|
+
"fpscr": unicorn.arm_const.UC_ARM_REG_FPSCR,
|
182
|
+
"fpexc": unicorn.arm_const.UC_ARM_REG_FPEXC,
|
183
|
+
"fpsid": unicorn.arm_const.UC_ARM_REG_FPSID,
|
184
|
+
"mvfr0": unicorn.arm_const.UC_ARM_REG_INVALID,
|
185
|
+
"mvfr1": unicorn.arm_const.UC_ARM_REG_INVALID,
|
186
|
+
"q0": unicorn.arm_const.UC_ARM_REG_Q0,
|
187
|
+
"d0": unicorn.arm_const.UC_ARM_REG_D0,
|
188
|
+
"s0": unicorn.arm_const.UC_ARM_REG_S0,
|
189
|
+
"s1": unicorn.arm_const.UC_ARM_REG_S1,
|
190
|
+
"d1": unicorn.arm_const.UC_ARM_REG_D1,
|
191
|
+
"s2": unicorn.arm_const.UC_ARM_REG_S2,
|
192
|
+
"s3": unicorn.arm_const.UC_ARM_REG_S3,
|
193
|
+
"q1": unicorn.arm_const.UC_ARM_REG_Q1,
|
194
|
+
"d2": unicorn.arm_const.UC_ARM_REG_D2,
|
195
|
+
"s4": unicorn.arm_const.UC_ARM_REG_S4,
|
196
|
+
"s5": unicorn.arm_const.UC_ARM_REG_S5,
|
197
|
+
"d3": unicorn.arm_const.UC_ARM_REG_D3,
|
198
|
+
"s6": unicorn.arm_const.UC_ARM_REG_S6,
|
199
|
+
"s7": unicorn.arm_const.UC_ARM_REG_S7,
|
200
|
+
"q2": unicorn.arm_const.UC_ARM_REG_Q2,
|
201
|
+
"d4": unicorn.arm_const.UC_ARM_REG_D4,
|
202
|
+
"s8": unicorn.arm_const.UC_ARM_REG_S8,
|
203
|
+
"s9": unicorn.arm_const.UC_ARM_REG_S9,
|
204
|
+
"d5": unicorn.arm_const.UC_ARM_REG_D5,
|
205
|
+
"s10": unicorn.arm_const.UC_ARM_REG_S10,
|
206
|
+
"s11": unicorn.arm_const.UC_ARM_REG_S11,
|
207
|
+
"q3": unicorn.arm_const.UC_ARM_REG_Q3,
|
208
|
+
"d6": unicorn.arm_const.UC_ARM_REG_D6,
|
209
|
+
"s12": unicorn.arm_const.UC_ARM_REG_S12,
|
210
|
+
"s13": unicorn.arm_const.UC_ARM_REG_S13,
|
211
|
+
"d7": unicorn.arm_const.UC_ARM_REG_D7,
|
212
|
+
"s14": unicorn.arm_const.UC_ARM_REG_S14,
|
213
|
+
"s15": unicorn.arm_const.UC_ARM_REG_S15,
|
214
|
+
"q4": unicorn.arm_const.UC_ARM_REG_Q4,
|
215
|
+
"d8": unicorn.arm_const.UC_ARM_REG_D8,
|
216
|
+
"s16": unicorn.arm_const.UC_ARM_REG_S16,
|
217
|
+
"s17": unicorn.arm_const.UC_ARM_REG_S17,
|
218
|
+
"d9": unicorn.arm_const.UC_ARM_REG_D9,
|
219
|
+
"s18": unicorn.arm_const.UC_ARM_REG_S18,
|
220
|
+
"s19": unicorn.arm_const.UC_ARM_REG_S19,
|
221
|
+
"q5": unicorn.arm_const.UC_ARM_REG_Q5,
|
222
|
+
"d10": unicorn.arm_const.UC_ARM_REG_D10,
|
223
|
+
"s20": unicorn.arm_const.UC_ARM_REG_S20,
|
224
|
+
"s21": unicorn.arm_const.UC_ARM_REG_S21,
|
225
|
+
"d11": unicorn.arm_const.UC_ARM_REG_D11,
|
226
|
+
"s22": unicorn.arm_const.UC_ARM_REG_S22,
|
227
|
+
"s23": unicorn.arm_const.UC_ARM_REG_S23,
|
228
|
+
"q6": unicorn.arm_const.UC_ARM_REG_Q6,
|
229
|
+
"d12": unicorn.arm_const.UC_ARM_REG_D12,
|
230
|
+
"s24": unicorn.arm_const.UC_ARM_REG_S24,
|
231
|
+
"s25": unicorn.arm_const.UC_ARM_REG_S25,
|
232
|
+
"d13": unicorn.arm_const.UC_ARM_REG_D13,
|
233
|
+
"s26": unicorn.arm_const.UC_ARM_REG_S26,
|
234
|
+
"s27": unicorn.arm_const.UC_ARM_REG_S27,
|
235
|
+
"q7": unicorn.arm_const.UC_ARM_REG_Q7,
|
236
|
+
"d14": unicorn.arm_const.UC_ARM_REG_D14,
|
237
|
+
"s28": unicorn.arm_const.UC_ARM_REG_S28,
|
238
|
+
"s29": unicorn.arm_const.UC_ARM_REG_S29,
|
239
|
+
"d15": unicorn.arm_const.UC_ARM_REG_D15,
|
240
|
+
"s30": unicorn.arm_const.UC_ARM_REG_S30,
|
241
|
+
"s31": unicorn.arm_const.UC_ARM_REG_S31,
|
242
|
+
"q8": unicorn.arm_const.UC_ARM_REG_Q8,
|
243
|
+
"d16": unicorn.arm_const.UC_ARM_REG_D16,
|
244
|
+
"d17": unicorn.arm_const.UC_ARM_REG_D17,
|
245
|
+
"q9": unicorn.arm_const.UC_ARM_REG_Q9,
|
246
|
+
"d18": unicorn.arm_const.UC_ARM_REG_D18,
|
247
|
+
"d19": unicorn.arm_const.UC_ARM_REG_D19,
|
248
|
+
"q10": unicorn.arm_const.UC_ARM_REG_Q10,
|
249
|
+
"d20": unicorn.arm_const.UC_ARM_REG_D20,
|
250
|
+
"d21": unicorn.arm_const.UC_ARM_REG_D21,
|
251
|
+
"q11": unicorn.arm_const.UC_ARM_REG_Q11,
|
252
|
+
"d22": unicorn.arm_const.UC_ARM_REG_D22,
|
253
|
+
"d23": unicorn.arm_const.UC_ARM_REG_D23,
|
254
|
+
"q12": unicorn.arm_const.UC_ARM_REG_Q12,
|
255
|
+
"d24": unicorn.arm_const.UC_ARM_REG_D24,
|
256
|
+
"d25": unicorn.arm_const.UC_ARM_REG_D25,
|
257
|
+
"q13": unicorn.arm_const.UC_ARM_REG_Q13,
|
258
|
+
"d26": unicorn.arm_const.UC_ARM_REG_D26,
|
259
|
+
"d27": unicorn.arm_const.UC_ARM_REG_D27,
|
260
|
+
"q14": unicorn.arm_const.UC_ARM_REG_Q14,
|
261
|
+
"d28": unicorn.arm_const.UC_ARM_REG_D28,
|
262
|
+
"d29": unicorn.arm_const.UC_ARM_REG_D29,
|
263
|
+
"q15": unicorn.arm_const.UC_ARM_REG_Q15,
|
264
|
+
"d30": unicorn.arm_const.UC_ARM_REG_D30,
|
265
|
+
"d31": unicorn.arm_const.UC_ARM_REG_D31,
|
277
266
|
}
|
278
267
|
)
|
279
268
|
|
@@ -297,7 +286,6 @@ class ARMv6MThumbMachineDef(ARMv6MMachineDef):
|
|
297
286
|
|
298
287
|
arch = Architecture.ARM_V6M_THUMB
|
299
288
|
uc_mode = unicorn.UC_MODE_THUMB
|
300
|
-
cs_mode = capstone.CS_MODE_THUMB
|
301
289
|
|
302
290
|
|
303
291
|
class ARMv7MMachineDef(ARMMachineMixinFP, ARMMachineMixinM, ARMMachineDef):
|