pwndbg_mmap
Allocates memory in a target process by invoking the mmap syscall, enabling creation of executable regions or scratch space for exploitation.
Instructions
Call the mmap syscall to allocate new memory in the target process.
pwndbg command: mmap Source: pwndbg/commands/mmap.py Category: Memory
Directly invokes mmap(2) on the target. Useful for creating executable shellcode regions or scratch memory during exploitation.
Args: session_id: The UUID of the session. addr: Desired address (0 for OS-chosen). length: Size of mapping (default: 0x1000). prot: Protection flags (default: "7" = rwx). flags: mmap flags (default: "0x22" = MAP_PRIVATE | MAP_ANONYMOUS).
See: https://pwndbg.re/2025.05.30/reference/pwndbg/commands/mmap/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| addr | No | 0 | |
| length | No | ||
| prot | No | 7 | |
| flags | No | 0x22 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |