pwndbg_distance
Calculate the distance between two memory addresses, or get the page offset from a single address to aid in exploit development.
Instructions
Calculate the distance between two addresses.
pwndbg command: distance Source: pwndbg/commands/distance.py Category: Memory
If only one argument is given, prints the offset from the address's page base. Useful for calculating offsets for exploits.
Args: session_id: The UUID of the session. a: First address or expression. b: Optional second address or expression.
See: https://pwndbg.re/2025.05.30/reference/pwndbg/commands/distance/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| a | Yes | ||
| b | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |