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
smallworld/state/cpus/mips64.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import typing
|
2
|
-
|
3
1
|
from ... import platforms
|
4
2
|
from .. import state
|
5
3
|
from . import cpu
|
@@ -8,44 +6,6 @@ from . import cpu
|
|
8
6
|
class MIPS64(cpu.CPU):
|
9
7
|
"""Abstract CPU state object for all MIPS64 targets"""
|
10
8
|
|
11
|
-
# Excluded registers:
|
12
|
-
# - zero: Hard-wired to zero
|
13
|
-
# - at: Reserved for assembler
|
14
|
-
# - kX: Reserved for kernel; used as general in some ABIs
|
15
|
-
# - fX: Floating-point registers
|
16
|
-
# - acX: Accumulator registers
|
17
|
-
_GENERAL_PURPOSE_REGS = [
|
18
|
-
"v0",
|
19
|
-
"v1",
|
20
|
-
"a0",
|
21
|
-
"a1",
|
22
|
-
"a2",
|
23
|
-
"a3",
|
24
|
-
"a4",
|
25
|
-
"a5",
|
26
|
-
"a6",
|
27
|
-
"a7",
|
28
|
-
"t0",
|
29
|
-
"t1",
|
30
|
-
"t2",
|
31
|
-
"t3",
|
32
|
-
"t4",
|
33
|
-
"t8",
|
34
|
-
"t9",
|
35
|
-
"s0",
|
36
|
-
"s1",
|
37
|
-
"s2",
|
38
|
-
"s3",
|
39
|
-
"s4",
|
40
|
-
"s5",
|
41
|
-
"s6",
|
42
|
-
"s7",
|
43
|
-
"s8",
|
44
|
-
]
|
45
|
-
|
46
|
-
def get_general_purpose_registers(self) -> typing.List[str]:
|
47
|
-
return self._GENERAL_PURPOSE_REGS
|
48
|
-
|
49
9
|
def __init__(self):
|
50
10
|
super().__init__()
|
51
11
|
# NOTE: MIPS registers have both a name and a number.
|
@@ -304,27 +264,27 @@ class MIPS64EL(MIPS64):
|
|
304
264
|
# from 64-bit multiplication, amongst others.
|
305
265
|
self.ac0 = state.Register("ac0", size=16)
|
306
266
|
self.add(self.ac0)
|
307
|
-
self.
|
308
|
-
self.add(self.
|
309
|
-
self.
|
310
|
-
self.add(self.
|
267
|
+
self.lo0 = state.RegisterAlias("lo0", self.ac0, size=8, offset=0)
|
268
|
+
self.add(self.lo0)
|
269
|
+
self.hi0 = state.RegisterAlias("hi0", self.ac0, size=8, offset=8)
|
270
|
+
self.add(self.hi0)
|
311
271
|
self.ac1 = state.Register("ac1", size=16)
|
312
272
|
self.add(self.ac1)
|
313
273
|
self.lo1 = state.RegisterAlias("lo1", self.ac1, size=8, offset=0)
|
314
274
|
self.add(self.lo1)
|
315
|
-
self.hi1 = state.RegisterAlias("hi1", self.ac1, size=8, offset=
|
275
|
+
self.hi1 = state.RegisterAlias("hi1", self.ac1, size=8, offset=8)
|
316
276
|
self.add(self.hi1)
|
317
277
|
self.ac2 = state.Register("ac2", size=16)
|
318
278
|
self.add(self.ac2)
|
319
279
|
self.lo2 = state.RegisterAlias("lo2", self.ac2, size=8, offset=0)
|
320
280
|
self.add(self.lo2)
|
321
|
-
self.hi2 = state.RegisterAlias("hi2", self.ac2, size=8, offset=
|
281
|
+
self.hi2 = state.RegisterAlias("hi2", self.ac2, size=8, offset=8)
|
322
282
|
self.add(self.hi2)
|
323
283
|
self.ac3 = state.Register("ac3", size=16)
|
324
284
|
self.add(self.ac3)
|
325
285
|
self.lo3 = state.RegisterAlias("lo3", self.ac3, size=8, offset=0)
|
326
286
|
self.add(self.lo3)
|
327
|
-
self.hi3 = state.RegisterAlias("hi3", self.ac3, size=8, offset=
|
287
|
+
self.hi3 = state.RegisterAlias("hi3", self.ac3, size=8, offset=8)
|
328
288
|
self.add(self.hi3)
|
329
289
|
# TODO: MIPS has a boatload of extensions with their own registers.
|
330
290
|
# There isn't a clean join between Sleigh, Unicorn, and MIPS docs.
|
@@ -346,27 +306,27 @@ class MIPS64BE(MIPS64):
|
|
346
306
|
# *** Accumulator Registers ***
|
347
307
|
# MIPS uses these to implement 64-bit results
|
348
308
|
# from 32-bit multiplication, amongst others.
|
349
|
-
self.ac0 = state.Register("ac0", size=
|
309
|
+
self.ac0 = state.Register("ac0", size=16)
|
350
310
|
self.add(self.ac0)
|
351
|
-
self.
|
352
|
-
self.add(self.
|
353
|
-
self.
|
354
|
-
self.add(self.
|
355
|
-
self.ac1 = state.Register("ac1", size=
|
311
|
+
self.hi0 = state.RegisterAlias("hi0", self.ac0, size=8, offset=0)
|
312
|
+
self.add(self.hi0)
|
313
|
+
self.lo0 = state.RegisterAlias("lo0", self.ac0, size=8, offset=8)
|
314
|
+
self.add(self.lo0)
|
315
|
+
self.ac1 = state.Register("ac1", size=16)
|
356
316
|
self.add(self.ac1)
|
357
317
|
self.hi1 = state.RegisterAlias("hi1", self.ac1, size=8, offset=0)
|
358
318
|
self.add(self.hi1)
|
359
|
-
self.lo1 = state.RegisterAlias("lo1", self.ac1, size=8, offset=
|
319
|
+
self.lo1 = state.RegisterAlias("lo1", self.ac1, size=8, offset=8)
|
360
320
|
self.add(self.lo1)
|
361
|
-
self.ac2 = state.Register("ac2", size=
|
321
|
+
self.ac2 = state.Register("ac2", size=16)
|
362
322
|
self.add(self.ac2)
|
363
323
|
self.hi2 = state.RegisterAlias("hi2", self.ac2, size=8, offset=0)
|
364
324
|
self.add(self.hi2)
|
365
|
-
self.lo2 = state.RegisterAlias("lo2", self.ac2, size=8, offset=
|
325
|
+
self.lo2 = state.RegisterAlias("lo2", self.ac2, size=8, offset=8)
|
366
326
|
self.add(self.lo2)
|
367
|
-
self.ac3 = state.Register("ac3", size=
|
327
|
+
self.ac3 = state.Register("ac3", size=16)
|
368
328
|
self.add(self.ac3)
|
369
329
|
self.hi3 = state.RegisterAlias("hi3", self.ac3, size=8, offset=0)
|
370
330
|
self.add(self.hi3)
|
371
|
-
self.lo3 = state.RegisterAlias("lo3", self.ac3, size=8, offset=
|
331
|
+
self.lo3 = state.RegisterAlias("lo3", self.ac3, size=8, offset=8)
|
372
332
|
self.add(self.lo3)
|
smallworld/state/cpus/powerpc.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import typing
|
2
|
-
|
3
1
|
from ... import platforms
|
4
2
|
from .. import state
|
5
3
|
from . import cpu
|
@@ -8,11 +6,6 @@ from . import cpu
|
|
8
6
|
class PowerPC(cpu.CPU):
|
9
7
|
"""CPU state for 32-bit PowerPC."""
|
10
8
|
|
11
|
-
_GENERAL_PURPOSE_REGS = [f"r{i}" for i in range(0, 32)]
|
12
|
-
|
13
|
-
def get_general_purpose_registers(self) -> typing.List[str]:
|
14
|
-
return self._GENERAL_PURPOSE_REGS
|
15
|
-
|
16
9
|
def __init__(self, wordsize):
|
17
10
|
super().__init__()
|
18
11
|
# *** General Purpose Registers ***
|
@@ -199,8 +192,8 @@ class PowerPC(cpu.CPU):
|
|
199
192
|
self.add(self.xer)
|
200
193
|
|
201
194
|
# Floating Point Status and Control Register
|
202
|
-
self.
|
203
|
-
self.add(self.
|
195
|
+
self.fpscr = state.Register("fpscr", size=4)
|
196
|
+
self.add(self.fpscr)
|
204
197
|
|
205
198
|
# TODO: This only focuses on the user-facing registrers.
|
206
199
|
# ppc has a huge number of privileged registers.
|
smallworld/state/cpus/riscv.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import typing
|
2
|
-
|
3
1
|
from ... import platforms, state
|
4
2
|
from . import cpu
|
5
3
|
|
@@ -11,14 +9,6 @@ class RISCV64(cpu.CPU):
|
|
11
9
|
platforms.Architecture.RISCV64, platforms.Byteorder.LITTLE
|
12
10
|
)
|
13
11
|
|
14
|
-
def get_general_purpose_registers(self) -> typing.List[str]:
|
15
|
-
# - x0 is wired to zero
|
16
|
-
# - x1 is the link register
|
17
|
-
# - x2 is the stack pointer
|
18
|
-
# - x3 is the global pointer
|
19
|
-
# - x4 is the thread pointer
|
20
|
-
return [f"x{i}" for i in range(5, 32)]
|
21
|
-
|
22
12
|
def __init__(self):
|
23
13
|
super().__init__()
|
24
14
|
# *** General-Purpose Registers ***
|
@@ -67,7 +57,7 @@ class RISCV64(cpu.CPU):
|
|
67
57
|
self.x8 = state.Register("x8", 8)
|
68
58
|
self.add(self.x8)
|
69
59
|
self.s0 = state.RegisterAlias("s0", self.x8, 8, 0)
|
70
|
-
self.add(self.
|
60
|
+
self.add(self.s0)
|
71
61
|
# x9 is a callee-saved register
|
72
62
|
self.x9 = state.Register("x9", 8)
|
73
63
|
self.add(self.x9)
|
smallworld/state/cpus/xtensa.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import typing
|
2
|
-
|
3
1
|
from ... import platforms, state
|
4
2
|
from . import cpu
|
5
3
|
|
@@ -15,9 +13,6 @@ class XTensa(cpu.CPU):
|
|
15
13
|
I'm not putting up with that shit for now.
|
16
14
|
"""
|
17
15
|
|
18
|
-
def get_general_purpose_registers(self) -> typing.List[str]:
|
19
|
-
return [f"a{i}" for i in range(0, 16)]
|
20
|
-
|
21
16
|
def __init__(self):
|
22
17
|
super().__init__()
|
23
18
|
# *** General Purpose Registers ***
|
smallworld/state/memory/code.py
CHANGED
@@ -60,7 +60,39 @@ class Executable(memory.RawMemory):
|
|
60
60
|
)
|
61
61
|
|
62
62
|
@classmethod
|
63
|
-
def
|
63
|
+
def from_elf_core(
|
64
|
+
cls,
|
65
|
+
file: typing.BinaryIO,
|
66
|
+
address: typing.Optional[int] = None,
|
67
|
+
platform: typing.Optional[Platform] = None,
|
68
|
+
ignore_platform: bool = False,
|
69
|
+
):
|
70
|
+
"""
|
71
|
+
Load an ELF core dump (ET_CORE) from an open file-like object.
|
72
|
+
|
73
|
+
Arguments:
|
74
|
+
file: The open file-like object from which to read.
|
75
|
+
address: The address where this core dump should be loaded.
|
76
|
+
platform: Optional platform for header verification
|
77
|
+
ignore_platform: Skip platform ID and verification
|
78
|
+
|
79
|
+
Returns:
|
80
|
+
An Executable (specifically ElfCoreFile) parsed from the given core dump.
|
81
|
+
"""
|
82
|
+
from .elf import ElfCoreFile
|
83
|
+
|
84
|
+
return ElfCoreFile(
|
85
|
+
file, user_base=address, platform=platform, ignore_platform=ignore_platform
|
86
|
+
)
|
87
|
+
|
88
|
+
@classmethod
|
89
|
+
def from_pe(
|
90
|
+
cls,
|
91
|
+
file: typing.BinaryIO,
|
92
|
+
address: typing.Optional[int] = None,
|
93
|
+
platform: typing.Optional[Platform] = None,
|
94
|
+
ignore_platform: bool = False,
|
95
|
+
):
|
64
96
|
"""Load an PE executable from an open file-like object.
|
65
97
|
|
66
98
|
Arguments:
|
@@ -70,7 +102,11 @@ class Executable(memory.RawMemory):
|
|
70
102
|
Returns:
|
71
103
|
An Executable parsed from the given PE file-like object.
|
72
104
|
"""
|
73
|
-
|
105
|
+
from .pe import PEExecutable
|
106
|
+
|
107
|
+
return PEExecutable(
|
108
|
+
file, user_base=address, platform=platform, ignore_platform=ignore_platform
|
109
|
+
)
|
74
110
|
|
75
111
|
|
76
112
|
__all__ = ["Executable"]
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import logging
|
2
|
+
import typing
|
3
|
+
|
4
|
+
import lief
|
5
|
+
|
6
|
+
from .....exceptions import ConfigurationError
|
7
|
+
from .....platforms import Platform
|
8
|
+
from ....cpus import CPU
|
9
|
+
from ..elf import ElfExecutable
|
10
|
+
from .prstatus import PrStatus
|
11
|
+
|
12
|
+
log = logging.getLogger(__name__)
|
13
|
+
|
14
|
+
|
15
|
+
class ElfCoreFile(ElfExecutable):
|
16
|
+
"""
|
17
|
+
Extended loader to handle core-dump (ET_CORE) ELF files.
|
18
|
+
"""
|
19
|
+
|
20
|
+
def __init__(
|
21
|
+
self,
|
22
|
+
file: typing.BinaryIO,
|
23
|
+
platform: typing.Optional[Platform] = None,
|
24
|
+
ignore_platform: bool = False,
|
25
|
+
user_base: typing.Optional[int] = None,
|
26
|
+
page_size: int = 0x1000,
|
27
|
+
):
|
28
|
+
super().__init__(
|
29
|
+
file=file,
|
30
|
+
platform=platform,
|
31
|
+
ignore_platform=ignore_platform,
|
32
|
+
user_base=user_base,
|
33
|
+
page_size=page_size,
|
34
|
+
)
|
35
|
+
|
36
|
+
assert self._elf is not None
|
37
|
+
parsed_elf = self._elf
|
38
|
+
|
39
|
+
if parsed_elf is None or parsed_elf.header.file_type != lief.ELF.E_TYPE.CORE:
|
40
|
+
raise ConfigurationError("This file is not an ELF core dump (ET_CORE).")
|
41
|
+
|
42
|
+
assert self.platform is not None
|
43
|
+
self.prstatus = PrStatus.for_platform(self.platform, parsed_elf)
|
44
|
+
|
45
|
+
def populate_cpu(self, cpu: CPU) -> None:
|
46
|
+
self.prstatus.populate_cpu(cpu)
|
@@ -0,0 +1,27 @@
|
|
1
|
+
from .aarch64 import AArch64
|
2
|
+
from .amd64 import AMD64
|
3
|
+
from .arm import ARMv5T, ARMv6M, ARMv6MThumb, ARMv7A, ARMv7M, ARMv7R
|
4
|
+
from .i386 import I386
|
5
|
+
from .mips import MIPS32BE, MIPS32EL
|
6
|
+
from .mips64 import MIPS64BE, MIPS64EL
|
7
|
+
from .ppc import PowerPC32, PowerPC64
|
8
|
+
from .prstatus import PrStatus
|
9
|
+
|
10
|
+
__all__ = [
|
11
|
+
"AArch64",
|
12
|
+
"AMD64",
|
13
|
+
"ARMv5T",
|
14
|
+
"ARMv6M",
|
15
|
+
"ARMv6MThumb",
|
16
|
+
"ARMv7M",
|
17
|
+
"ARMv7R",
|
18
|
+
"ARMv7A",
|
19
|
+
"I386",
|
20
|
+
"MIPS32BE",
|
21
|
+
"MIPS32EL",
|
22
|
+
"MIPS64BE",
|
23
|
+
"MIPS64EL",
|
24
|
+
"PowerPC32",
|
25
|
+
"PowerPC64",
|
26
|
+
"PrStatus",
|
27
|
+
]
|
@@ -0,0 +1,46 @@
|
|
1
|
+
from ...... import platforms
|
2
|
+
from .prstatus import PrStatus
|
3
|
+
|
4
|
+
|
5
|
+
class AArch64(PrStatus):
|
6
|
+
architecture = platforms.Architecture.AARCH64
|
7
|
+
byteorder = platforms.Byteorder.LITTLE
|
8
|
+
|
9
|
+
pr_regs_off = 112
|
10
|
+
pr_regs_size = 272
|
11
|
+
|
12
|
+
register_coords = [
|
13
|
+
("x0", 0x0, 8),
|
14
|
+
("x1", 0x8, 8),
|
15
|
+
("x2", 0x10, 8),
|
16
|
+
("x3", 0x18, 8),
|
17
|
+
("x4", 0x20, 8),
|
18
|
+
("x5", 0x28, 8),
|
19
|
+
("x6", 0x30, 8),
|
20
|
+
("x7", 0x38, 8),
|
21
|
+
("x8", 0x40, 8),
|
22
|
+
("x9", 0x48, 8),
|
23
|
+
("x10", 0x50, 8),
|
24
|
+
("x11", 0x58, 8),
|
25
|
+
("x12", 0x60, 8),
|
26
|
+
("x13", 0x68, 8),
|
27
|
+
("x14", 0x70, 8),
|
28
|
+
("x15", 0x78, 8),
|
29
|
+
("x16", 0x80, 8),
|
30
|
+
("x17", 0x88, 8),
|
31
|
+
("x18", 0x90, 8),
|
32
|
+
("x19", 0x98, 8),
|
33
|
+
("x20", 0xA0, 8),
|
34
|
+
("x21", 0xA8, 8),
|
35
|
+
("x22", 0xB0, 8),
|
36
|
+
("x23", 0xB8, 8),
|
37
|
+
("x24", 0xC0, 8),
|
38
|
+
("x25", 0xC8, 8),
|
39
|
+
("x26", 0xD0, 8),
|
40
|
+
("x27", 0xD8, 8),
|
41
|
+
("x28", 0xE0, 8),
|
42
|
+
("x29", 0xE8, 8),
|
43
|
+
("x30", 0xF0, 8),
|
44
|
+
("sp", 0xF8, 8),
|
45
|
+
("pc", 0x100, 8),
|
46
|
+
]
|
@@ -0,0 +1,40 @@
|
|
1
|
+
from ...... import platforms
|
2
|
+
from .prstatus import PrStatus
|
3
|
+
|
4
|
+
|
5
|
+
class AMD64(PrStatus):
|
6
|
+
architecture = platforms.Architecture.X86_64
|
7
|
+
byteorder = platforms.Byteorder.LITTLE
|
8
|
+
|
9
|
+
pr_regs_off = 112
|
10
|
+
pr_regs_size = 216
|
11
|
+
|
12
|
+
register_coords = [
|
13
|
+
("r15", 0x0, 8),
|
14
|
+
("r14", 0x8, 8),
|
15
|
+
("r13", 0x10, 8),
|
16
|
+
("r12", 0x18, 8),
|
17
|
+
("rbp", 0x20, 8),
|
18
|
+
("rbx", 0x28, 8),
|
19
|
+
("r11", 0x30, 8),
|
20
|
+
("r10", 0x38, 8),
|
21
|
+
("r9", 0x40, 8),
|
22
|
+
("r8", 0x48, 8),
|
23
|
+
("rax", 0x50, 8),
|
24
|
+
("rcx", 0x58, 8),
|
25
|
+
("rdx", 0x60, 8),
|
26
|
+
("rsi", 0x68, 8),
|
27
|
+
("rdi", 0x70, 8),
|
28
|
+
(None, 0x78, 8), # orig_rax
|
29
|
+
("rip", 0x80, 8),
|
30
|
+
("cs", 0x88, 8),
|
31
|
+
("eflags", 0x90, 8),
|
32
|
+
("rsp", 0x98, 8),
|
33
|
+
("ss", 0xA0, 8),
|
34
|
+
(None, 0xA8, 8), # fs_base
|
35
|
+
(None, 0xB0, 8), # gs_base
|
36
|
+
("ds", 0xB8, 8),
|
37
|
+
("es", 0xC0, 8),
|
38
|
+
("fs", 0xC8, 8),
|
39
|
+
("gs", 0xD0, 8),
|
40
|
+
]
|
@@ -0,0 +1,53 @@
|
|
1
|
+
from ...... import platforms
|
2
|
+
from .prstatus import PrStatus
|
3
|
+
|
4
|
+
|
5
|
+
class ARM(PrStatus):
|
6
|
+
byteorder = platforms.Byteorder.LITTLE
|
7
|
+
|
8
|
+
pr_regs_off = 72
|
9
|
+
pr_regs_size = 72
|
10
|
+
|
11
|
+
register_coords = [
|
12
|
+
("r0", 0x0, 4),
|
13
|
+
("r1", 0x4, 4),
|
14
|
+
("r2", 0x8, 4),
|
15
|
+
("r3", 0xC, 4),
|
16
|
+
("r4", 0x10, 4),
|
17
|
+
("r5", 0x14, 4),
|
18
|
+
("r6", 0x18, 4),
|
19
|
+
("r7", 0x1C, 4),
|
20
|
+
("r8", 0x20, 4),
|
21
|
+
("r9", 0x24, 4),
|
22
|
+
("r10", 0x28, 4),
|
23
|
+
("r11", 0x2C, 4),
|
24
|
+
("r12", 0x30, 4),
|
25
|
+
("sp", 0x34, 4),
|
26
|
+
("lr", 0x38, 4),
|
27
|
+
("pc", 0x3C, 4),
|
28
|
+
# TODO: This is missing two registers. One is the CPSR, but I have no idea which.
|
29
|
+
]
|
30
|
+
|
31
|
+
|
32
|
+
class ARMv5T(ARM):
|
33
|
+
architecture = platforms.Architecture.ARM_V5T
|
34
|
+
|
35
|
+
|
36
|
+
class ARMv6M(ARM):
|
37
|
+
architecture = platforms.Architecture.ARM_V6M
|
38
|
+
|
39
|
+
|
40
|
+
class ARMv6MThumb(ARM):
|
41
|
+
architecture = platforms.Architecture.ARM_V6M_THUMB
|
42
|
+
|
43
|
+
|
44
|
+
class ARMv7M(ARM):
|
45
|
+
architecture = platforms.Architecture.ARM_V7M
|
46
|
+
|
47
|
+
|
48
|
+
class ARMv7R(ARM):
|
49
|
+
architecture = platforms.Architecture.ARM_V7R
|
50
|
+
|
51
|
+
|
52
|
+
class ARMv7A(ARM):
|
53
|
+
architecture = platforms.Architecture.ARM_V7A
|
@@ -0,0 +1,30 @@
|
|
1
|
+
from ...... import platforms
|
2
|
+
from .prstatus import PrStatus
|
3
|
+
|
4
|
+
|
5
|
+
class I386(PrStatus):
|
6
|
+
architecture = platforms.Architecture.X86_32
|
7
|
+
byteorder = platforms.Byteorder.LITTLE
|
8
|
+
|
9
|
+
pr_regs_off = 72
|
10
|
+
pr_regs_size = 68
|
11
|
+
|
12
|
+
register_coords = [
|
13
|
+
("ebx", 0x0, 4),
|
14
|
+
("ecx", 0x4, 4),
|
15
|
+
("edx", 0x8, 4),
|
16
|
+
("esi", 0xC, 4),
|
17
|
+
("edi", 0x10, 4),
|
18
|
+
("ebp", 0x14, 4),
|
19
|
+
("eax", 0x18, 4),
|
20
|
+
("ds", 0x1C, 4),
|
21
|
+
("es", 0x20, 4),
|
22
|
+
("fs", 0x24, 4),
|
23
|
+
("gs", 0x28, 4),
|
24
|
+
(None, 0x2C, 4), # orig_eax
|
25
|
+
("eip", 0x30, 4),
|
26
|
+
("cs", 0x34, 4),
|
27
|
+
("eflags", 0x38, 4),
|
28
|
+
("esp", 0x3C, 4),
|
29
|
+
("ss", 0x40, 4),
|
30
|
+
]
|
@@ -0,0 +1,55 @@
|
|
1
|
+
from ...... import platforms
|
2
|
+
from .prstatus import PrStatus
|
3
|
+
|
4
|
+
|
5
|
+
class MIPS32BE(PrStatus):
|
6
|
+
architecture = platforms.Architecture.MIPS32
|
7
|
+
byteorder = platforms.Byteorder.BIG
|
8
|
+
|
9
|
+
# This doesn't match what the struct def says;
|
10
|
+
# there's something extra in here.
|
11
|
+
pr_regs_off = 96
|
12
|
+
pr_regs_size = 180
|
13
|
+
|
14
|
+
register_coords = [
|
15
|
+
("zero", 0x0, 4),
|
16
|
+
("at", 0x4, 4),
|
17
|
+
("v0", 0x8, 4),
|
18
|
+
("v1", 0xC, 4),
|
19
|
+
("a0", 0x10, 4),
|
20
|
+
("a1", 0x14, 4),
|
21
|
+
("a2", 0x18, 4),
|
22
|
+
("a3", 0x1C, 4),
|
23
|
+
("t0", 0x20, 4),
|
24
|
+
("t1", 0x24, 4),
|
25
|
+
("t2", 0x28, 4),
|
26
|
+
("t3", 0x2C, 4),
|
27
|
+
("t4", 0x30, 4),
|
28
|
+
("t5", 0x34, 4),
|
29
|
+
("t6", 0x38, 4),
|
30
|
+
("t7", 0x3C, 4),
|
31
|
+
("s0", 0x40, 4),
|
32
|
+
("s1", 0x44, 4),
|
33
|
+
("s2", 0x48, 4),
|
34
|
+
("s3", 0x4C, 4),
|
35
|
+
("s4", 0x50, 4),
|
36
|
+
("s5", 0x54, 4),
|
37
|
+
("s6", 0x58, 4),
|
38
|
+
("s7", 0x5C, 4),
|
39
|
+
("t8", 0x60, 4),
|
40
|
+
("t9", 0x64, 4),
|
41
|
+
("k0", 0x68, 4),
|
42
|
+
("k1", 0x6C, 4),
|
43
|
+
("gp", 0x70, 4),
|
44
|
+
("sp", 0x74, 4),
|
45
|
+
("s8", 0x78, 4),
|
46
|
+
("ra", 0x7C, 4),
|
47
|
+
# No idea what goes here.
|
48
|
+
# There are exception pseudo-registers,
|
49
|
+
# but they don't fit nicely in this gap.
|
50
|
+
("pc", 0x88, 4),
|
51
|
+
]
|
52
|
+
|
53
|
+
|
54
|
+
class MIPS32EL(MIPS32BE):
|
55
|
+
byteorder = platforms.Byteorder.LITTLE
|
@@ -0,0 +1,57 @@
|
|
1
|
+
from ...... import platforms
|
2
|
+
from .prstatus import PrStatus
|
3
|
+
|
4
|
+
|
5
|
+
class MIPS64BE(PrStatus):
|
6
|
+
architecture = platforms.Architecture.MIPS64
|
7
|
+
byteorder = platforms.Byteorder.BIG
|
8
|
+
|
9
|
+
# This doesn't match what the struct def says;
|
10
|
+
# there's something extra in here.
|
11
|
+
pr_regs_off = 112
|
12
|
+
pr_regs_size = 360
|
13
|
+
|
14
|
+
register_coords = [
|
15
|
+
("zero", 0x0, 8),
|
16
|
+
("at", 0x8, 8),
|
17
|
+
("v0", 0x10, 8),
|
18
|
+
("v1", 0x18, 8),
|
19
|
+
("a0", 0x20, 8),
|
20
|
+
("a1", 0x28, 8),
|
21
|
+
("a2", 0x30, 8),
|
22
|
+
("a3", 0x38, 8),
|
23
|
+
("a4", 0x40, 8),
|
24
|
+
("a5", 0x48, 8),
|
25
|
+
("a6", 0x50, 8),
|
26
|
+
("a7", 0x58, 8),
|
27
|
+
("t0", 0x60, 8),
|
28
|
+
("t1", 0x68, 8),
|
29
|
+
("t2", 0x70, 8),
|
30
|
+
("t3", 0x78, 8),
|
31
|
+
("s0", 0x80, 8),
|
32
|
+
("s1", 0x88, 8),
|
33
|
+
("s2", 0x90, 8),
|
34
|
+
("s3", 0x98, 8),
|
35
|
+
("s4", 0xA0, 8),
|
36
|
+
("s5", 0xA8, 8),
|
37
|
+
("s6", 0xB0, 8),
|
38
|
+
("s7", 0xB8, 8),
|
39
|
+
("t8", 0xC0, 8),
|
40
|
+
("t9", 0xC8, 8),
|
41
|
+
("k0", 0xD0, 8),
|
42
|
+
("k1", 0xD8, 8),
|
43
|
+
("gp", 0xE0, 8),
|
44
|
+
("sp", 0xE8, 8),
|
45
|
+
("s8", 0xF0, 8),
|
46
|
+
("ra", 0xF8, 8),
|
47
|
+
# No idea what goes here.
|
48
|
+
# There are exception pseudo-registers,
|
49
|
+
# but they don't fit nicely in this gap.
|
50
|
+
(None, 0x100, 8),
|
51
|
+
(None, 0x108, 8),
|
52
|
+
("pc", 0x110, 8),
|
53
|
+
]
|
54
|
+
|
55
|
+
|
56
|
+
class MIPS64EL(MIPS64BE):
|
57
|
+
byteorder = platforms.Byteorder.LITTLE
|