commands ¤
Pwndbg command implementations.
As well as various command-handling logic.
Modules:
-
ai–This command sends information on the current debugging context to OpenAI's
-
argv– -
aslr– -
asm– -
attachp– -
auxv– -
binder– -
binja– -
binja_functions– -
branch– -
buddydump– -
canary– -
checksec– -
comments– -
commpage– -
config–Dumps all pwndbg-specific configuration points.
-
context– -
cpsr– -
cyclic– -
cymbol–Add, load, show, edit, or delete symbols for custom structures.
-
dev– -
distance– -
dt– -
dumpargs– -
elf– -
flags– -
gdt– -
ghidra– -
godbg– -
got– -
got_tracking– -
hex2ptr– -
hexdump– -
hijack_fd– -
ida– -
ignore–Ignoring a breakpoint
-
integration– -
ipython_interactive–Command to start an interactive IPython prompt.
-
jemalloc– -
kbase– -
kbpf– -
kchecksec– -
kcmdline– -
kconfig– -
kdmabuf– -
kdmesg–Display the kernel ring buffer (dmesg) contents.
-
killthreads– -
klookup– -
kmod–Displays information about loaded kernel modules. This command retrieves the list of kernel modules from the
modulessymbol -
knft– -
ksyscalls–Displays the syscall table for kernel debugging.
-
ktask–Displays information about kernel tasks. This command iterates through the kernel's task list
-
kversion– -
leakfind–Find a chain of leaks given some starting address.
-
libcinfo– -
linkmap– -
mallocng–Commands that help with debugging musl's allocator, mallocng.
-
memoize– -
misc– -
mmap– -
mprotect– -
msr– -
nearpc– -
next–Stepping until an event occurs
-
onegadget– -
p2p– -
paging– -
parse_seccomp– -
patch– -
peda– -
pie– -
plist– -
probeleak– -
procinfo– -
profiler–Utilities for profiling pwndbg.
-
ptmalloc2– -
ptmalloc2_tracking– -
radare2– -
reload– -
retaddr– -
rizin– -
rop– -
ropper– -
saved_register_frames– -
search– -
segments– -
sigreturn– -
slab–Commands for dealing with Linux kernel slab allocator. Currently, only SLUB is supported.
-
spray– -
start–Launches the target process after setting a breakpoint at a convenient
-
strings– -
telescope–Prints out pointer chains starting at some address in memory.
-
tips– -
tls–Command to print the information of the current Thread Local Storage (TLS).
-
valist– -
version–Implements version and bugreport commands.
-
vmmap–Command to print the virtual memory map a la /proc/self/maps.
-
windbg–Compatibility functionality for WinDbg users.
-
xinfo– -
xor–
Classes:
-
CommandCategory– -
InvalidDebuggerError–Raised when a command is called in a debugger for which
-
CommandFormatter–The formatter_class that is passed to argparse for all
-
CommandObj–Represents a command that can be invoked from the
-
Command–Parametrized decorator for functions that serve as pwndbg commands.
Functions:
-
fix–Fix a single command-line argument coming from the CLI.
-
fix_reraise– -
fix_reraise_arg–fix_reraise wrapper for evaluating command arguments
-
fix_int– -
fix_int_reraise– -
fix_int_reraise_arg–fix_int_reraise wrapper for evaluating command arguments
-
func_name– -
OnlyWhenLocal– -
OnlyWithFile– -
OnlyWhenQemuKernel– -
OnlyWhenUserspace– -
OnlyWithKernelDebugInfo– -
OnlyWithKernelDebugSymbols– -
OnlyWhenPagingEnabled– -
OnlyWhenRunning– -
OnlyWithTcache– -
OnlyWhenHeapIsInitialized– -
OnlyWithResolvedHeapSyms– -
sloppy_gdb_parse–This function should be used as
argparse.ArgumentParser.add_argument method'stypehelper. -
AddressExpr–Parses an address expression. Returns an int.
-
HexOrAddressExpr–Parses string as hexadecimal int or an address expression. Returns an int.
-
load_commands–
Attributes:
-
log– -
T– -
P– -
commands(list[CommandObj]) – -
command_names(set[str]) – -
GDB_BUILTIN_COMMANDS– -
pwndbg_is_reloading–
CommandCategory ¤
InvalidDebuggerError ¤
Bases: Exception
Raised when a command is called in a debugger for which it is disallowed.
CommandFormatter ¤
Bases: RawDescriptionHelpFormatter
The formatter_class that is passed to argparse for all commands.
Subclassing this isn't officially supported, but there isn't a good alternative.
CommandObj ¤
CommandObj(
function: Callable[..., str | None],
parser: ArgumentParser,
command_name: str | None,
category: CommandCategory,
aliases: list[str],
examples: str,
notes: str,
)
Represents a command that can be invoked from the debugger.
Methods:
-
register_command–Register this object command with the underlying debugger
-
has_notes_string– -
has_examples_string– -
initialize_parser– -
invoke–Invoke the command with an argument string
-
check_repeated–Keep a record of all commands which come from the TTY.
-
__call__–
Attributes:
-
builtin_override_whitelist(set[str]) – -
history(dict[int, str]) – -
function– -
command_name– -
category– -
aliases– -
examples– -
notes– -
parser– -
repeat–
builtin_override_whitelist class-attribute instance-attribute ¤
builtin_override_whitelist: set[str] = {
"up",
"down",
"search",
"pwd",
"start",
"starti",
"ignore",
}
register_command ¤
Register this object command with the underlying debugger and update pwndbg global state to know about this command.
check_repeated ¤
Keep a record of all commands which come from the TTY.
Returns:
-
bool–True if this command was executed by the user just hitting "enter".
Command ¤
Command(
parser_or_desc: str | ArgumentParser,
*,
category: CommandCategory,
command_name: str | None = None,
aliases: list[str] = [],
examples: str = "",
notes: str = "",
only_debuggers: set[DebuggerType] = None,
exclude_debuggers: set[DebuggerType] = None,
)
Parametrized decorator for functions that serve as pwndbg commands.
Always use this to decorate your commands.
Methods:
-
__call__–
Attributes:
-
parser– -
category– -
command_name– -
aliases– -
examples– -
notes– -
only_debuggers– -
exclude_debuggers–
fix ¤
fix(
arg: str | Value,
sloppy: bool = False,
quiet: bool = True,
reraise: bool = False,
) -> str | Value | None
Fix a single command-line argument coming from the CLI.
Parameters:
-
arg(str | Value) –Original string representation (e.g. '0', '$rax', '$rax+44')
-
sloppy(bool, default:False) –If
argcannot be evaluated, returnarg. (default: False) -
quiet(bool, default:True) –If an error occurs, suppress it. (default: True)
-
reraise(bool, default:False) –If an error occurs, raise the exception. (default: False)
Returns:
fix_reraise_arg ¤
fix_reraise_arg(arg) -> Value
fix_reraise wrapper for evaluating command arguments
fix_int_reraise_arg ¤
fix_int_reraise wrapper for evaluating command arguments
OnlyWithKernelDebugInfo ¤
OnlyWithKernelDebugSymbols ¤
OnlyWhenHeapIsInitialized ¤
OnlyWithResolvedHeapSyms ¤
sloppy_gdb_parse ¤
This function should be used as argparse.ArgumentParser .add_argument method's type helper.
This makes the type being parsed as gdb value and if that parsing fails, a string is returned.
:param s: String. :return: Whatever gdb.parse_and_eval returns or string.
HexOrAddressExpr ¤
Parses string as hexadecimal int or an address expression. Returns an int. (e.g. '1234' will return 0x1234)