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/
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>",
"a": "<a>"
},
"name": "pwndbg_distance"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| a | Yes | ||
| b | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |