Skip to content

Proc

Provides values which would be available from /proc which are not fulfilled by other modules and some process/gdb flow related information.

P = ParamSpec('P') module-attribute

T = TypeVar('T') module-attribute

alive: bool module-attribute

binary_base_addr: int module-attribute

binary_vmmap: Tuple[pwndbg.lib.memory.Page, ...] module-attribute

exe: str | None module-attribute

pid: int module-attribute

stopped_with_signal: bool module-attribute

tether = sys.modules[__name__] module-attribute

thread_id: int module-attribute

thread_is_stopped: bool module-attribute

tid: int module-attribute

module

Bases: ModuleType

alive: bool property

Informs whether the process has a thread. However, note that it will still return True for a segfaulted thread. To detect that, consider using the stopped_with_signal method.

binary_base_addr: int property

binary_vmmap: Tuple[pwndbg.lib.memory.Page, ...] property

exe: str | None property

Returns the debugged file name.

On remote targets, this may be prefixed with "target:" string. See this by executing those in two terminals: 1. gdbserver 127.0.0.1:1234 /bin/ls 2. gdb -ex "target remote :1234" -ex "pi pwndbg.gdblib.proc.exe"

If you need to process the debugged file use

pwndbg.gdblib.file.get_proc_exe_file() (This will call pwndbg.gdblib.file.get_file(pwndbg.gdblib.proc.exe, try_local_path=True))

pid: int property

stopped_with_signal: bool property

Returns whether the program has stopped with a signal

Can be used to detect segfaults (but will also detect other signals)

thread_id: int property

thread_is_stopped: bool property

This detects whether selected thread is stopped. It is not stopped in situations when gdb is executing commands that are attached to a breakpoint by command command.

For more info see issue #229 ( https://github.com/pwndbg/pwndbg/issues/299 ) :return: Whether gdb executes commands attached to bp with command command.

tid: int property

OnlyWhenQemuKernel(func)

OnlyWhenRunning(func)

OnlyWithArch(arch_names)

Decorates function to work only with the specified archictectures.

dump_elf_data_section()

Dump .data section of current process's ELF file

dump_relocations_by_section_name(section_name)

Dump relocations of a section by section name of current process's ELF file

get_section_address_by_name(section_name)

Find section address of current process by section name

OnlyWhenQemuKernel(func)

OnlyWhenRunning(func)

OnlyWithArch(arch_names)