From 066352a37bbe9cc74526a9835bfc42179edd1943 Mon Sep 17 00:00:00 2001 From: Dejan <21058883+0xhebi@users.noreply.github.com> Date: Sat, 16 Nov 2024 02:46:16 +0100 Subject: [PATCH] hex2ptr - naming and hex replace (#2530) --- pwndbg/commands/hex2ptr.py | 6 +++--- pwndbg/gdblib/functions.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pwndbg/commands/hex2ptr.py b/pwndbg/commands/hex2ptr.py index 93df634e4..8cc679323 100644 --- a/pwndbg/commands/hex2ptr.py +++ b/pwndbg/commands/hex2ptr.py @@ -18,9 +18,9 @@ parser.add_argument( @pwndbg.commands.ArgparsedCommand(parser, category=CommandCategory.MISC) def hex2ptr(hex_string) -> None: - combined_args = hex_string.replace(" ", "") + hex_string = hex_string.replace(" ", "") try: - result = hex2ptr_common(combined_args) - print(M.success(f"{hex(result)}")) + pointer = hex2ptr_common(hex_string) + print(M.success(f"{hex(pointer)}")) except Exception as e: print(M.error(str(e))) diff --git a/pwndbg/gdblib/functions.py b/pwndbg/gdblib/functions.py index 5ae0fd31b..1ece09439 100644 --- a/pwndbg/gdblib/functions.py +++ b/pwndbg/gdblib/functions.py @@ -79,5 +79,6 @@ def hex2ptr(hex_string: gdb.Value | str) -> int: if isinstance(hex_string, gdb.Value): hex_string = hex_string.string() - address = hex2ptr_common(hex_string) - return address + hex_string = hex_string.replace(" ", "") + pointer = hex2ptr_common(hex_string) + return pointer