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
@@ -1,4 +1,3 @@
|
|
1
|
-
import capstone
|
2
1
|
import unicorn
|
3
2
|
|
4
3
|
from ....platforms import Architecture, Byteorder
|
@@ -14,101 +13,96 @@ class i386MachineDef(UnicornMachineDef):
|
|
14
13
|
uc_arch = unicorn.UC_ARCH_X86
|
15
14
|
uc_mode = unicorn.UC_MODE_32
|
16
15
|
|
17
|
-
cs_arch = capstone.CS_ARCH_X86
|
18
|
-
cs_mode = capstone.CS_MODE_32
|
19
|
-
|
20
|
-
pc_reg = "eip"
|
21
|
-
|
22
16
|
_registers = {
|
23
17
|
# *** General Purpose Registers ***
|
24
|
-
"eax":
|
25
|
-
"ax":
|
26
|
-
"al":
|
27
|
-
"ah":
|
28
|
-
"ebx":
|
29
|
-
"bx":
|
30
|
-
"bl":
|
31
|
-
"bh":
|
32
|
-
"ecx":
|
33
|
-
"cx":
|
34
|
-
"cl":
|
35
|
-
"ch":
|
36
|
-
"edx":
|
37
|
-
"dx":
|
38
|
-
"dl":
|
39
|
-
"dh":
|
40
|
-
"esi":
|
41
|
-
"si":
|
42
|
-
"sil":
|
43
|
-
"edi":
|
44
|
-
"di":
|
45
|
-
"dil":
|
46
|
-
"ebp":
|
47
|
-
"bp":
|
48
|
-
"bpl":
|
49
|
-
"esp":
|
50
|
-
"sp":
|
51
|
-
"spl":
|
18
|
+
"eax": unicorn.x86_const.UC_X86_REG_EAX,
|
19
|
+
"ax": unicorn.x86_const.UC_X86_REG_AX,
|
20
|
+
"al": unicorn.x86_const.UC_X86_REG_AL,
|
21
|
+
"ah": unicorn.x86_const.UC_X86_REG_AH,
|
22
|
+
"ebx": unicorn.x86_const.UC_X86_REG_EBX,
|
23
|
+
"bx": unicorn.x86_const.UC_X86_REG_BX,
|
24
|
+
"bl": unicorn.x86_const.UC_X86_REG_BL,
|
25
|
+
"bh": unicorn.x86_const.UC_X86_REG_BH,
|
26
|
+
"ecx": unicorn.x86_const.UC_X86_REG_ECX,
|
27
|
+
"cx": unicorn.x86_const.UC_X86_REG_CX,
|
28
|
+
"cl": unicorn.x86_const.UC_X86_REG_CL,
|
29
|
+
"ch": unicorn.x86_const.UC_X86_REG_CH,
|
30
|
+
"edx": unicorn.x86_const.UC_X86_REG_EDX,
|
31
|
+
"dx": unicorn.x86_const.UC_X86_REG_DX,
|
32
|
+
"dl": unicorn.x86_const.UC_X86_REG_DL,
|
33
|
+
"dh": unicorn.x86_const.UC_X86_REG_DH,
|
34
|
+
"esi": unicorn.x86_const.UC_X86_REG_ESI,
|
35
|
+
"si": unicorn.x86_const.UC_X86_REG_SI,
|
36
|
+
"sil": unicorn.x86_const.UC_X86_REG_SIL,
|
37
|
+
"edi": unicorn.x86_const.UC_X86_REG_EDI,
|
38
|
+
"di": unicorn.x86_const.UC_X86_REG_DI,
|
39
|
+
"dil": unicorn.x86_const.UC_X86_REG_DIL,
|
40
|
+
"ebp": unicorn.x86_const.UC_X86_REG_EBP,
|
41
|
+
"bp": unicorn.x86_const.UC_X86_REG_BP,
|
42
|
+
"bpl": unicorn.x86_const.UC_X86_REG_BPL,
|
43
|
+
"esp": unicorn.x86_const.UC_X86_REG_ESP,
|
44
|
+
"sp": unicorn.x86_const.UC_X86_REG_SP,
|
45
|
+
"spl": unicorn.x86_const.UC_X86_REG_SPL,
|
52
46
|
# *** Instruction Pointer ***
|
53
|
-
"eip":
|
54
|
-
"ip":
|
47
|
+
"eip": unicorn.x86_const.UC_X86_REG_EIP,
|
48
|
+
"ip": unicorn.x86_const.UC_X86_REG_IP,
|
55
49
|
# *** Segment Registers ***
|
56
|
-
"cs":
|
57
|
-
"ss":
|
58
|
-
"ds":
|
59
|
-
"es":
|
60
|
-
"fs":
|
61
|
-
"gs":
|
50
|
+
"cs": unicorn.x86_const.UC_X86_REG_CS,
|
51
|
+
"ss": unicorn.x86_const.UC_X86_REG_SS,
|
52
|
+
"ds": unicorn.x86_const.UC_X86_REG_DS,
|
53
|
+
"es": unicorn.x86_const.UC_X86_REG_ES,
|
54
|
+
"fs": unicorn.x86_const.UC_X86_REG_FS,
|
55
|
+
"gs": unicorn.x86_const.UC_X86_REG_GS,
|
62
56
|
# *** Flags Registers ***
|
63
|
-
"eflags":
|
64
|
-
"flags":
|
57
|
+
"eflags": unicorn.x86_const.UC_X86_REG_EFLAGS,
|
58
|
+
"flags": unicorn.x86_const.UC_X86_REG_FLAGS,
|
65
59
|
# *** Control Registers ***
|
66
|
-
"cr0":
|
67
|
-
"cr1":
|
68
|
-
"cr2":
|
69
|
-
"cr3":
|
70
|
-
"cr4":
|
60
|
+
"cr0": unicorn.x86_const.UC_X86_REG_CR0,
|
61
|
+
"cr1": unicorn.x86_const.UC_X86_REG_CR1,
|
62
|
+
"cr2": unicorn.x86_const.UC_X86_REG_CR2,
|
63
|
+
"cr3": unicorn.x86_const.UC_X86_REG_CR3,
|
64
|
+
"cr4": unicorn.x86_const.UC_X86_REG_CR4,
|
71
65
|
# NOTE: I've got conflicting reports whether cr8 exists in i386.
|
72
|
-
"cr8":
|
66
|
+
"cr8": unicorn.x86_const.UC_X86_REG_INVALID,
|
73
67
|
# *** Debug Registers ***
|
74
|
-
"dr0":
|
75
|
-
"dr1":
|
76
|
-
"dr2":
|
77
|
-
"dr3":
|
78
|
-
"dr6":
|
79
|
-
"dr7":
|
68
|
+
"dr0": unicorn.x86_const.UC_X86_REG_DR0,
|
69
|
+
"dr1": unicorn.x86_const.UC_X86_REG_DR1,
|
70
|
+
"dr2": unicorn.x86_const.UC_X86_REG_DR2,
|
71
|
+
"dr3": unicorn.x86_const.UC_X86_REG_DR3,
|
72
|
+
"dr6": unicorn.x86_const.UC_X86_REG_DR6,
|
73
|
+
"dr7": unicorn.x86_const.UC_X86_REG_DR7,
|
80
74
|
# *** Descriptor Table Registers
|
81
75
|
# NOTE: Yes, this is 6 bytes; 2 byte segment selector plus 4 byte offset
|
82
|
-
"gdtr":
|
83
|
-
"idtr":
|
84
|
-
"ldtr":
|
76
|
+
"gdtr": unicorn.x86_const.UC_X86_REG_GDTR,
|
77
|
+
"idtr": unicorn.x86_const.UC_X86_REG_IDTR,
|
78
|
+
"ldtr": unicorn.x86_const.UC_X86_REG_LDTR,
|
85
79
|
# *** Task Register ***
|
86
80
|
# NOTE: Yes, this is 6 bytes; 2 byte segment selector plus 4 byte offset
|
87
|
-
"tr":
|
81
|
+
"tr": unicorn.x86_const.UC_X86_REG_TR,
|
88
82
|
# *** x87 registers ***
|
89
83
|
# NOTE: x87 is supported by Unicorn, but not by SmallWorld.
|
90
84
|
# Values are represented as tuples (exponent: int, mantissa: int).
|
91
85
|
# If you need x87 support, open a ticket.
|
92
|
-
"fpr0":
|
93
|
-
"fpr1":
|
94
|
-
"fpr2":
|
95
|
-
"fpr3":
|
96
|
-
"fpr4":
|
97
|
-
"fpr5":
|
98
|
-
"fpr6":
|
99
|
-
"fpr7":
|
86
|
+
"fpr0": unicorn.x86_const.UC_X86_REG_INVALID,
|
87
|
+
"fpr1": unicorn.x86_const.UC_X86_REG_INVALID,
|
88
|
+
"fpr2": unicorn.x86_const.UC_X86_REG_INVALID,
|
89
|
+
"fpr3": unicorn.x86_const.UC_X86_REG_INVALID,
|
90
|
+
"fpr4": unicorn.x86_const.UC_X86_REG_INVALID,
|
91
|
+
"fpr5": unicorn.x86_const.UC_X86_REG_INVALID,
|
92
|
+
"fpr6": unicorn.x86_const.UC_X86_REG_INVALID,
|
93
|
+
"fpr7": unicorn.x86_const.UC_X86_REG_INVALID,
|
100
94
|
# x87 Control Register
|
101
|
-
"fctrl":
|
95
|
+
"fctrl": unicorn.x86_const.UC_X86_REG_FPCW,
|
102
96
|
# x87 Status Register
|
103
|
-
"fstat":
|
97
|
+
"fstat": unicorn.x86_const.UC_X86_REG_FPSW,
|
104
98
|
# x87 Tag Register
|
105
|
-
"ftag":
|
99
|
+
"ftag": unicorn.x86_const.UC_X86_REG_FPTAG,
|
106
100
|
# x87 Last Instruction Register
|
107
|
-
"fip":
|
101
|
+
"fip": unicorn.x86_const.UC_X86_REG_FIP,
|
108
102
|
# x87 Last Operand Pointer
|
109
|
-
"fdp":
|
103
|
+
"fdp": unicorn.x86_const.UC_X86_REG_FDP,
|
110
104
|
# x87 Last Opcode
|
111
|
-
"fop":
|
105
|
+
"fop": unicorn.x86_const.UC_X86_REG_FOP,
|
112
106
|
# NOTE: Docs disagree on the format of fip and fdp.
|
113
107
|
# One source describes them as 48-bit offset-plus-segment,
|
114
108
|
# the other describes them as 64-bit.
|
@@ -117,21 +111,21 @@ class i386MachineDef(UnicornMachineDef):
|
|
117
111
|
# *** MMX Registers ***
|
118
112
|
# NOTE: The MMX registers are aliases for the low 8 bytes of the x87 registers.
|
119
113
|
# The two subsystems cannot be used simultaneously.
|
120
|
-
"mm0":
|
121
|
-
"mm1":
|
122
|
-
"mm2":
|
123
|
-
"mm3":
|
124
|
-
"mm4":
|
125
|
-
"mm5":
|
126
|
-
"mm6":
|
127
|
-
"mm7":
|
114
|
+
"mm0": unicorn.x86_const.UC_X86_REG_MM0,
|
115
|
+
"mm1": unicorn.x86_const.UC_X86_REG_MM1,
|
116
|
+
"mm2": unicorn.x86_const.UC_X86_REG_MM2,
|
117
|
+
"mm3": unicorn.x86_const.UC_X86_REG_MM3,
|
118
|
+
"mm4": unicorn.x86_const.UC_X86_REG_MM4,
|
119
|
+
"mm5": unicorn.x86_const.UC_X86_REG_MM5,
|
120
|
+
"mm6": unicorn.x86_const.UC_X86_REG_MM6,
|
121
|
+
"mm7": unicorn.x86_const.UC_X86_REG_MM7,
|
128
122
|
# *** SSE Registers ***
|
129
|
-
"xmm0":
|
130
|
-
"xmm1":
|
131
|
-
"xmm2":
|
132
|
-
"xmm3":
|
133
|
-
"xmm4":
|
134
|
-
"xmm5":
|
135
|
-
"xmm6":
|
136
|
-
"xmm7":
|
123
|
+
"xmm0": unicorn.x86_const.UC_X86_REG_XMM0,
|
124
|
+
"xmm1": unicorn.x86_const.UC_X86_REG_XMM1,
|
125
|
+
"xmm2": unicorn.x86_const.UC_X86_REG_XMM2,
|
126
|
+
"xmm3": unicorn.x86_const.UC_X86_REG_XMM3,
|
127
|
+
"xmm4": unicorn.x86_const.UC_X86_REG_XMM4,
|
128
|
+
"xmm5": unicorn.x86_const.UC_X86_REG_XMM5,
|
129
|
+
"xmm6": unicorn.x86_const.UC_X86_REG_XMM6,
|
130
|
+
"xmm7": unicorn.x86_const.UC_X86_REG_XMM7,
|
137
131
|
}
|
@@ -37,30 +37,9 @@ class UnicornMachineDef(metaclass=abc.ABCMeta):
|
|
37
37
|
"""
|
38
38
|
return 0
|
39
39
|
|
40
|
-
|
41
|
-
@abc.abstractmethod
|
42
|
-
def cs_arch(self) -> int:
|
43
|
-
"""The capstone arch ID"""
|
44
|
-
return 0
|
45
|
-
|
46
|
-
@property
|
47
|
-
@abc.abstractmethod
|
48
|
-
def cs_mode(self) -> int:
|
49
|
-
"""The capstone mode ID
|
50
|
-
|
51
|
-
This must include an byteorder flag
|
52
|
-
"""
|
53
|
-
return 0
|
54
|
-
|
55
|
-
@property
|
56
|
-
@abc.abstractmethod
|
57
|
-
def pc_reg(self) -> str:
|
58
|
-
"""The name of the Program Counter register for this machine"""
|
59
|
-
return ""
|
60
|
-
|
61
|
-
_registers: typing.Dict[str, typing.Tuple[typing.Any, str, int, int]] = {}
|
40
|
+
_registers: typing.Dict[str, int] = {}
|
62
41
|
|
63
|
-
def uc_reg(self, name: str) ->
|
42
|
+
def uc_reg(self, name: str) -> int:
|
64
43
|
"""Convert a register name to unicorn constant
|
65
44
|
|
66
45
|
This must cover all names defined in the CPU state model
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import capstone
|
2
1
|
import unicorn
|
3
2
|
|
4
3
|
from ....platforms import Architecture, Byteorder
|
@@ -13,134 +12,129 @@ class MIPSMachineDef(UnicornMachineDef):
|
|
13
12
|
uc_arch = unicorn.UC_ARCH_MIPS
|
14
13
|
uc_mode = unicorn.UC_MODE_MIPS32
|
15
14
|
|
16
|
-
cs_arch = capstone.CS_ARCH_MIPS
|
17
|
-
cs_mode = capstone.CS_MODE_MIPS32
|
18
|
-
|
19
|
-
pc_reg = "pc"
|
20
|
-
|
21
15
|
def __init__(self):
|
22
16
|
self._registers = {
|
23
17
|
# *** General-Purpose Registers ***
|
24
18
|
# Assembler Temporary Register
|
25
|
-
"at":
|
26
|
-
"1":
|
19
|
+
"at": unicorn.mips_const.UC_MIPS_REG_AT,
|
20
|
+
"1": unicorn.mips_const.UC_MIPS_REG_1,
|
27
21
|
# Return Value Registers
|
28
|
-
"v0":
|
29
|
-
"2":
|
30
|
-
"v1":
|
31
|
-
"3":
|
22
|
+
"v0": unicorn.mips_const.UC_MIPS_REG_V0,
|
23
|
+
"2": unicorn.mips_const.UC_MIPS_REG_2,
|
24
|
+
"v1": unicorn.mips_const.UC_MIPS_REG_V1,
|
25
|
+
"3": unicorn.mips_const.UC_MIPS_REG_3,
|
32
26
|
# Argument Registers
|
33
|
-
"a0":
|
34
|
-
"4":
|
35
|
-
"a1":
|
36
|
-
"5":
|
37
|
-
"a2":
|
38
|
-
"6":
|
39
|
-
"a3":
|
40
|
-
"7":
|
27
|
+
"a0": unicorn.mips_const.UC_MIPS_REG_A0,
|
28
|
+
"4": unicorn.mips_const.UC_MIPS_REG_4,
|
29
|
+
"a1": unicorn.mips_const.UC_MIPS_REG_A1,
|
30
|
+
"5": unicorn.mips_const.UC_MIPS_REG_5,
|
31
|
+
"a2": unicorn.mips_const.UC_MIPS_REG_A2,
|
32
|
+
"6": unicorn.mips_const.UC_MIPS_REG_6,
|
33
|
+
"a3": unicorn.mips_const.UC_MIPS_REG_A3,
|
34
|
+
"7": unicorn.mips_const.UC_MIPS_REG_7,
|
41
35
|
# Temporary Registers
|
42
|
-
"t0":
|
43
|
-
"8":
|
44
|
-
"t1":
|
45
|
-
"9":
|
46
|
-
"t2":
|
47
|
-
"10":
|
48
|
-
"t3":
|
49
|
-
"11":
|
50
|
-
"t4":
|
51
|
-
"12":
|
52
|
-
"t5":
|
53
|
-
"13":
|
54
|
-
"t6":
|
55
|
-
"14":
|
56
|
-
"t7":
|
57
|
-
"15":
|
58
|
-
"t8":
|
59
|
-
"24":
|
60
|
-
"t9":
|
61
|
-
"25":
|
36
|
+
"t0": unicorn.mips_const.UC_MIPS_REG_T0,
|
37
|
+
"8": unicorn.mips_const.UC_MIPS_REG_8,
|
38
|
+
"t1": unicorn.mips_const.UC_MIPS_REG_T1,
|
39
|
+
"9": unicorn.mips_const.UC_MIPS_REG_9,
|
40
|
+
"t2": unicorn.mips_const.UC_MIPS_REG_T2,
|
41
|
+
"10": unicorn.mips_const.UC_MIPS_REG_10,
|
42
|
+
"t3": unicorn.mips_const.UC_MIPS_REG_T3,
|
43
|
+
"11": unicorn.mips_const.UC_MIPS_REG_11,
|
44
|
+
"t4": unicorn.mips_const.UC_MIPS_REG_T4,
|
45
|
+
"12": unicorn.mips_const.UC_MIPS_REG_12,
|
46
|
+
"t5": unicorn.mips_const.UC_MIPS_REG_T5,
|
47
|
+
"13": unicorn.mips_const.UC_MIPS_REG_13,
|
48
|
+
"t6": unicorn.mips_const.UC_MIPS_REG_T6,
|
49
|
+
"14": unicorn.mips_const.UC_MIPS_REG_14,
|
50
|
+
"t7": unicorn.mips_const.UC_MIPS_REG_T7,
|
51
|
+
"15": unicorn.mips_const.UC_MIPS_REG_15,
|
52
|
+
"t8": unicorn.mips_const.UC_MIPS_REG_T8,
|
53
|
+
"24": unicorn.mips_const.UC_MIPS_REG_24,
|
54
|
+
"t9": unicorn.mips_const.UC_MIPS_REG_T9,
|
55
|
+
"25": unicorn.mips_const.UC_MIPS_REG_25,
|
62
56
|
# Saved Registers
|
63
|
-
"s0":
|
64
|
-
"16":
|
65
|
-
"s1":
|
66
|
-
"17":
|
67
|
-
"s2":
|
68
|
-
"18":
|
69
|
-
"s3":
|
70
|
-
"19":
|
71
|
-
"s4":
|
72
|
-
"20":
|
73
|
-
"s5":
|
74
|
-
"21":
|
75
|
-
"s6":
|
76
|
-
"22":
|
77
|
-
"s7":
|
78
|
-
"23":
|
57
|
+
"s0": unicorn.mips_const.UC_MIPS_REG_S0,
|
58
|
+
"16": unicorn.mips_const.UC_MIPS_REG_16,
|
59
|
+
"s1": unicorn.mips_const.UC_MIPS_REG_S1,
|
60
|
+
"17": unicorn.mips_const.UC_MIPS_REG_17,
|
61
|
+
"s2": unicorn.mips_const.UC_MIPS_REG_S2,
|
62
|
+
"18": unicorn.mips_const.UC_MIPS_REG_18,
|
63
|
+
"s3": unicorn.mips_const.UC_MIPS_REG_S3,
|
64
|
+
"19": unicorn.mips_const.UC_MIPS_REG_19,
|
65
|
+
"s4": unicorn.mips_const.UC_MIPS_REG_S4,
|
66
|
+
"20": unicorn.mips_const.UC_MIPS_REG_20,
|
67
|
+
"s5": unicorn.mips_const.UC_MIPS_REG_S5,
|
68
|
+
"21": unicorn.mips_const.UC_MIPS_REG_21,
|
69
|
+
"s6": unicorn.mips_const.UC_MIPS_REG_S6,
|
70
|
+
"22": unicorn.mips_const.UC_MIPS_REG_22,
|
71
|
+
"s7": unicorn.mips_const.UC_MIPS_REG_S7,
|
72
|
+
"23": unicorn.mips_const.UC_MIPS_REG_23,
|
79
73
|
# NOTE: Register 30 used to be FP, is now also s8
|
80
|
-
"s8":
|
81
|
-
"fp":
|
82
|
-
"30":
|
74
|
+
"s8": unicorn.mips_const.UC_MIPS_REG_S8,
|
75
|
+
"fp": unicorn.mips_const.UC_MIPS_REG_FP,
|
76
|
+
"30": unicorn.mips_const.UC_MIPS_REG_30,
|
83
77
|
# Kernel-reserved registers
|
84
|
-
"k0":
|
85
|
-
"26":
|
86
|
-
"k1":
|
87
|
-
"27":
|
78
|
+
"k0": unicorn.mips_const.UC_MIPS_REG_K0,
|
79
|
+
"26": unicorn.mips_const.UC_MIPS_REG_26,
|
80
|
+
"k1": unicorn.mips_const.UC_MIPS_REG_K1,
|
81
|
+
"27": unicorn.mips_const.UC_MIPS_REG_27,
|
88
82
|
# *** Pointer Registers ***
|
89
83
|
# Zero Register
|
90
|
-
"zero":
|
91
|
-
"0":
|
84
|
+
"zero": unicorn.mips_const.UC_MIPS_REG_ZERO,
|
85
|
+
"0": unicorn.mips_const.UC_MIPS_REG_0,
|
92
86
|
# Global Pointer Register
|
93
|
-
"gp":
|
94
|
-
"28":
|
87
|
+
"gp": unicorn.mips_const.UC_MIPS_REG_GP,
|
88
|
+
"28": unicorn.mips_const.UC_MIPS_REG_28,
|
95
89
|
# Stack Pointer Register
|
96
|
-
"sp":
|
97
|
-
"29":
|
90
|
+
"sp": unicorn.mips_const.UC_MIPS_REG_SP,
|
91
|
+
"29": unicorn.mips_const.UC_MIPS_REG_29,
|
98
92
|
# Return Address Register
|
99
|
-
"ra":
|
100
|
-
"31":
|
93
|
+
"ra": unicorn.mips_const.UC_MIPS_REG_RA,
|
94
|
+
"31": unicorn.mips_const.UC_MIPS_REG_31,
|
101
95
|
# Program Counter
|
102
|
-
"pc":
|
96
|
+
"pc": unicorn.mips_const.UC_MIPS_REG_PC,
|
103
97
|
# *** Floating-point Registers ***
|
104
|
-
"f0":
|
105
|
-
"f1":
|
106
|
-
"f2":
|
107
|
-
"f3":
|
108
|
-
"f4":
|
109
|
-
"f5":
|
110
|
-
"f6":
|
111
|
-
"f7":
|
112
|
-
"f8":
|
113
|
-
"f9":
|
114
|
-
"f10":
|
115
|
-
"f11":
|
116
|
-
"f12":
|
117
|
-
"f13":
|
118
|
-
"f14":
|
119
|
-
"f15":
|
120
|
-
"f16":
|
121
|
-
"f17":
|
122
|
-
"f18":
|
123
|
-
"f19":
|
124
|
-
"f20":
|
125
|
-
"f21":
|
126
|
-
"f22":
|
127
|
-
"f23":
|
128
|
-
"f24":
|
129
|
-
"f25":
|
130
|
-
"f26":
|
131
|
-
"f27":
|
132
|
-
"f28":
|
133
|
-
"f29":
|
134
|
-
"f30":
|
135
|
-
"f31":
|
98
|
+
"f0": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
99
|
+
"f1": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
100
|
+
"f2": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
101
|
+
"f3": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
102
|
+
"f4": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
103
|
+
"f5": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
104
|
+
"f6": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
105
|
+
"f7": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
106
|
+
"f8": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
107
|
+
"f9": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
108
|
+
"f10": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
109
|
+
"f11": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
110
|
+
"f12": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
111
|
+
"f13": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
112
|
+
"f14": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
113
|
+
"f15": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
114
|
+
"f16": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
115
|
+
"f17": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
116
|
+
"f18": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
117
|
+
"f19": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
118
|
+
"f20": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
119
|
+
"f21": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
120
|
+
"f22": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
121
|
+
"f23": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
122
|
+
"f24": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
123
|
+
"f25": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
124
|
+
"f26": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
125
|
+
"f27": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
126
|
+
"f28": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
127
|
+
"f29": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
128
|
+
"f30": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
129
|
+
"f31": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
136
130
|
# *** Floating Point Control Registers ***
|
137
131
|
# NOTE: These are taken from Sleigh, and the MIPS docs.
|
138
132
|
# Unicorn doesn't use these names, and has a different number of registers.
|
139
|
-
"fir":
|
140
|
-
"fcsr":
|
141
|
-
"fexr":
|
142
|
-
"fenr":
|
143
|
-
"fccr":
|
133
|
+
"fir": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
134
|
+
"fcsr": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
135
|
+
"fexr": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
136
|
+
"fenr": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
137
|
+
"fccr": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
144
138
|
}
|
145
139
|
|
146
140
|
|
@@ -155,18 +149,18 @@ class MIPSELMachineDef(MIPSMachineDef):
|
|
155
149
|
{
|
156
150
|
# *** Accumulator Registers ***
|
157
151
|
# TODO: Unicorn broke support for these in 2.0.2
|
158
|
-
"ac0":
|
159
|
-
"lo0":
|
160
|
-
"hi0":
|
161
|
-
"ac1":
|
162
|
-
"lo1":
|
163
|
-
"hi1":
|
164
|
-
"ac2":
|
165
|
-
"lo2":
|
166
|
-
"hi2":
|
167
|
-
"ac3":
|
168
|
-
"lo3":
|
169
|
-
"hi3":
|
152
|
+
"ac0": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
153
|
+
"lo0": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
154
|
+
"hi0": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
155
|
+
"ac1": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
156
|
+
"lo1": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
157
|
+
"hi1": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
158
|
+
"ac2": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
159
|
+
"lo2": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
160
|
+
"hi2": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
161
|
+
"ac3": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
162
|
+
"lo3": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
163
|
+
"hi3": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
170
164
|
}
|
171
165
|
)
|
172
166
|
|
@@ -178,25 +172,23 @@ class MIPSBEMachineDef(MIPSMachineDef):
|
|
178
172
|
|
179
173
|
uc_mode = unicorn.UC_MODE_MIPS32 | unicorn.UC_MODE_BIG_ENDIAN
|
180
174
|
|
181
|
-
cs_mode = capstone.CS_MODE_MIPS32 | capstone.CS_MODE_BIG_ENDIAN
|
182
|
-
|
183
175
|
def __init__(self):
|
184
176
|
super().__init__()
|
185
177
|
self._registers.update(
|
186
178
|
{
|
187
179
|
# *** Accumulator Registers ***
|
188
180
|
# TODO: Unicorn broke support for these in 2.0.2
|
189
|
-
"ac0":
|
190
|
-
"hi0":
|
191
|
-
"lo0":
|
192
|
-
"ac1":
|
193
|
-
"hi1":
|
194
|
-
"lo1":
|
195
|
-
"ac2":
|
196
|
-
"hi2":
|
197
|
-
"lo2":
|
198
|
-
"ac3":
|
199
|
-
"hi3":
|
200
|
-
"lo3":
|
181
|
+
"ac0": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
182
|
+
"hi0": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
183
|
+
"lo0": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
184
|
+
"ac1": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
185
|
+
"hi1": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
186
|
+
"lo1": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
187
|
+
"ac2": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
188
|
+
"hi2": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
189
|
+
"lo2": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
190
|
+
"ac3": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
191
|
+
"hi3": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
192
|
+
"lo3": unicorn.mips_const.UC_MIPS_REG_INVALID,
|
201
193
|
}
|
202
194
|
)
|