From 3b561cdc818121954275fb5fbf49a756742b4634 Mon Sep 17 00:00:00 2001 From: Unknown Sentinel <63234449+Unknownsentinel193@users.noreply.github.com> Date: Sun, 14 May 2023 23:48:07 +0530 Subject: [PATCH] Updated version.py for bugreport command to display more information (#1709) * Updated version.py for bugreport command to display more information * Update version.py * Update pwndbg/commands/version.py --------- Co-authored-by: Unknown6334 <63234449+Unknown1934-del@users.noreply.github.com> Co-authored-by: Disconnect3d --- pwndbg/commands/version.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/pwndbg/commands/version.py b/pwndbg/commands/version.py index 81997b813..0e598f611 100644 --- a/pwndbg/commands/version.py +++ b/pwndbg/commands/version.py @@ -157,6 +157,40 @@ If it is somehow unavailable, use: os_info = match.group(1) current_setup += "OS: %s\n" % os_info + + # 1. showing osabi + osabi_info = platform.uname().version + current_setup += "OS ABI: %s\n" % osabi_info + + # 2. showing architecture + arch_info = platform.machine() + current_setup += "Architecture: %s\n" % arch_info + + # 3. showing endian + endian_info = sys.byteorder + current_setup += "Endian: %s\n" % endian_info + + # 4. Depending on current arch -- note that those are only available if given arch is supported by current GDB, like gdb-multiarch + if arch_info in ["armv7l", "aarch64"]: + arm_info = gdb.execute("show arm", to_string=True) + current_setup += "ARM: %s\n" % arm_info + + elif arch_info in ["mips", "mips64"]: + mips_info = gdb.execute("show mips", to_string=True) + current_setup += "MIPS: %s\n" % mips_info + + # 7. showing charset + charset_info = sys.getdefaultencoding() + current_setup += "Charset: %s\n" % charset_info + + # 8. showing width + width_info = os.get_terminal_size().columns + current_setup += "Width: %s\n" % width_info + + # 9. showing height + height_info = os.get_terminal_size().lines + current_setup += "Height: %s\n" % height_info + current_setup += "\n".join(all_info) current_setup += "\n" + "\n".join(gdb_config)