diff --git a/pwndbg/gdblib/arch.py b/pwndbg/gdblib/arch.py index 7e0bc25fa..e1d5df03d 100644 --- a/pwndbg/gdblib/arch.py +++ b/pwndbg/gdblib/arch.py @@ -9,7 +9,20 @@ from pwndbg.lib.arch import Arch # TODO: x86-64 needs to come before i386 in the current implementation, make # 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 pwnlib_archs_mapping = { @@ -49,6 +62,10 @@ def _get_arch(ptrsize: int): # Distinguish between Cortex-M and other ARM if match == "arm" and "-m" in arch: match = "armcm" + elif match.startswith("riscv:"): + match = match[6:] + elif match == "riscv": + match = "rv64" return match, ptrsize, endian if not_exactly_arch: