Skip to content

stack ¤

Helpers for finding address mappings which are used as a stack.

Generally not needed, except under qemu-user and for when binaries do things to remap the stack (e.g. pwnies' postit).

Functions:

  • find

    Returns a pwndbg.lib.memory.Page object which corresponds to given address stack

  • find_upper_stack_boundary
  • get

    For each running thread, return the known address range for its stack

  • current

    Returns the bounds for the stack for the current thread.

  • is_executable
  • callstack

    Return the address of the return address for the current frame.

Attributes:

auto_explore module-attribute ¤

auto_explore = add_param(
    "auto-explore-stack",
    "warn",
    "stack exploration; it may be really slow",
    param_class=PARAM_ENUM,
    enum_sequence=["warn", "yes", "no"],
)

find ¤

find(address: int) -> Page | None

Returns a pwndbg.lib.memory.Page object which corresponds to given address stack or None if it does not exist

find_upper_stack_boundary ¤

find_upper_stack_boundary(stack_ptr: int, max_pages: int = 1024) -> int

get ¤

get() -> dict[int, Page]

For each running thread, return the known address range for its stack Returns a dict which should never be modified (since its cached)

current ¤

current() -> Page | None

Returns the bounds for the stack for the current thread.

is_executable ¤

is_executable() -> bool

callstack ¤

callstack() -> list[int]

Return the address of the return address for the current frame.