|
|
|
@ -9,7 +9,20 @@ from pwndbg.lib.arch import Arch
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: x86-64 needs to come before i386 in the current implementation, make
|
|
|
|
# TODO: x86-64 needs to come before i386 in the current implementation, make
|
|
|
|
# this order-independent
|
|
|
|
# this order-independent
|
|
|
|
ARCHS = ("x86-64", "i386", "aarch64", "mips", "powerpc", "sparc", "arm", "armcm", "rv32", "rv64")
|
|
|
|
ARCHS = (
|
|
|
|
|
|
|
|
"x86-64",
|
|
|
|
|
|
|
|
"i386",
|
|
|
|
|
|
|
|
"aarch64",
|
|
|
|
|
|
|
|
"mips",
|
|
|
|
|
|
|
|
"powerpc",
|
|
|
|
|
|
|
|
"sparc",
|
|
|
|
|
|
|
|
"arm",
|
|
|
|
|
|
|
|
"armcm",
|
|
|
|
|
|
|
|
"riscv:rv32",
|
|
|
|
|
|
|
|
"riscv:rv64",
|
|
|
|
|
|
|
|
"riscv",
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# mapping between gdb and pwntools arch names
|
|
|
|
# mapping between gdb and pwntools arch names
|
|
|
|
pwnlib_archs_mapping = {
|
|
|
|
pwnlib_archs_mapping = {
|
|
|
|
@ -49,6 +62,10 @@ def _get_arch(ptrsize: int):
|
|
|
|
# Distinguish between Cortex-M and other ARM
|
|
|
|
# Distinguish between Cortex-M and other ARM
|
|
|
|
if match == "arm" and "-m" in arch:
|
|
|
|
if match == "arm" and "-m" in arch:
|
|
|
|
match = "armcm"
|
|
|
|
match = "armcm"
|
|
|
|
|
|
|
|
elif match.startswith("riscv:"):
|
|
|
|
|
|
|
|
match = match[6:]
|
|
|
|
|
|
|
|
elif match == "riscv":
|
|
|
|
|
|
|
|
match = "rv64"
|
|
|
|
return match, ptrsize, endian
|
|
|
|
return match, ptrsize, endian
|
|
|
|
|
|
|
|
|
|
|
|
if not_exactly_arch:
|
|
|
|
if not_exactly_arch:
|
|
|
|
|