fix: dont start GdbFunction help text on a new line (#2596)

pull/2598/head
k4lizen 1 year ago committed by GitHub
parent f63a47bade
commit 654a9c1b37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -76,9 +76,7 @@ def envp(name=None):
class argv_function(gdb.Function): class argv_function(gdb.Function):
""" """Evaluate argv on the supplied value."""
Evaluate argv on the supplied value.
"""
def __init__(self) -> None: def __init__(self) -> None:
super().__init__("argv") super().__init__("argv")
@ -98,9 +96,7 @@ argv_function()
class envp_function(gdb.Function): class envp_function(gdb.Function):
""" """Evaluate envp on the supplied value."""
Evaluate envp on the supplied value.
"""
def __init__(self) -> None: def __init__(self) -> None:
super().__init__("envp") super().__init__("envp")
@ -120,9 +116,7 @@ envp_function()
class argc_function(gdb.Function): class argc_function(gdb.Function):
""" """Evaluates to argc."""
Evaluates to argc.
"""
def __init__(self) -> None: def __init__(self) -> None:
super().__init__("argc") super().__init__("argc")
@ -135,9 +129,7 @@ argc_function()
class environ_function(gdb.Function): class environ_function(gdb.Function):
""" """Evaluate getenv() on the supplied value."""
Evaluate getenv() on the supplied value.
"""
def __init__(self) -> None: def __init__(self) -> None:
super().__init__("environ") super().__init__("environ")

@ -62,8 +62,7 @@ def bn_eval(expr: gdb.Value) -> int | None:
Docs: https://api.binary.ninja/binaryninja.binaryview-module.html#binaryninja.binaryview.BinaryView.parse_expression Docs: https://api.binary.ninja/binaryninja.binaryview-module.html#binaryninja.binaryview.BinaryView.parse_expression
Adds all registers in the current register set as magic variables (e.g. $rip). Adds all registers in the current register set as magic variables (e.g. $rip).
Also adds a $piebase magic variable with the computed executable base. Also adds a $piebase magic variable with the computed executable base."""
"""
magic_vars = {} magic_vars = {}
for r in pwndbg.aglib.regs.current: for r in pwndbg.aglib.regs.current:
v = pwndbg.aglib.regs[r] v = pwndbg.aglib.regs[r]

@ -73,10 +73,8 @@ def base(name_pattern: gdb.Value | str) -> int:
@GdbFunction(only_when_running=True) @GdbFunction(only_when_running=True)
def hex2ptr(hex_string: gdb.Value | str) -> int: def hex2ptr(hex_string: gdb.Value | str) -> int:
""" """Converts a hex string to a little-endian address and returns the address.
Converts a hex string to a little-endian address and returns the address. Example usage: $hex2ptr("00 70 75 c1 cd ef 59 00")"""
Example usage: $hex2ptr("00 70 75 c1 cd ef 59 00")
"""
if isinstance(hex_string, gdb.Value): if isinstance(hex_string, gdb.Value):
hex_string = hex_string.string() hex_string = hex_string.string()

Loading…
Cancel
Save