hex2ptr - naming and hex replace (#2530)

pull/2524/head^2
Dejan 1 year ago committed by GitHub
parent e55ca003f6
commit 066352a37b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -18,9 +18,9 @@ parser.add_argument(
@pwndbg.commands.ArgparsedCommand(parser, category=CommandCategory.MISC) @pwndbg.commands.ArgparsedCommand(parser, category=CommandCategory.MISC)
def hex2ptr(hex_string) -> None: def hex2ptr(hex_string) -> None:
combined_args = hex_string.replace(" ", "") hex_string = hex_string.replace(" ", "")
try: try:
result = hex2ptr_common(combined_args) pointer = hex2ptr_common(hex_string)
print(M.success(f"{hex(result)}")) print(M.success(f"{hex(pointer)}"))
except Exception as e: except Exception as e:
print(M.error(str(e))) print(M.error(str(e)))

@ -79,5 +79,6 @@ def hex2ptr(hex_string: gdb.Value | str) -> int:
if isinstance(hex_string, gdb.Value): if isinstance(hex_string, gdb.Value):
hex_string = hex_string.string() hex_string = hex_string.string()
address = hex2ptr_common(hex_string) hex_string = hex_string.replace(" ", "")
return address pointer = hex2ptr_common(hex_string)
return pointer

Loading…
Cancel
Save