Skip to main content
Glama

pwndbg_mprotect

Change memory permissions on a target process by invoking the mprotect syscall, enabling writable or executable regions during exploit development.

Instructions

Call the mprotect syscall to change memory permissions.

pwndbg command: mprotect Source: pwndbg/commands/mprotect.py Category: Memory

Directly invokes mprotect(2) on the target process. Useful for making regions writable or executable during exploit development.

Args: session_id: The UUID of the session. addr: Address of the memory region. length: Length of the region in bytes. prot: Protection flags (e.g. "7" for rwx, "5" for r-x).

See: https://pwndbg.re/2025.05.30/reference/pwndbg/commands/mprotect/

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
addrYes
lengthYes
protYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description must fully disclose behavior. It states 'Directly invokes mprotect(2)' but omits critical details such as required privileges, potential crash risks, side effects on memory state, and that the syscall may fail silently. The phrase 'during exploit development' hints at risks but does not systematically describe them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Approximately 80 words, front-loaded with the main purpose, followed by source, usage, argument list, and a reference link. Every sentence serves a clear purpose with no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the basic purpose, arguments, and use case, but lacks behavioral transparency (e.g., page alignment requirement) and does not clarify return values despite an existing output schema. It references external docs but is not fully self-contained for a syscall-level tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description lists each parameter with brief explanations (e.g., 'Address of the memory region') and provides an example for `prot` ('7' for rwx). However, it fails to mention that `addr` must be page-aligned for mprotect, a crucial constraint. With 0% schema coverage, the description adds some value but is incomplete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description explicitly states 'Call the mprotect syscall to change memory permissions' and 'Directly invokes mprotect(2) on the target process'. It clearly identifies the verb, resource, and use case (exploit development), distinguishing it from sibling tools like pwndbg_patch or pwndbg_write by focusing on permission changes rather than memory content.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions 'useful for making regions writable or executable during exploit development', providing a clear context. However, it does not specify when to avoid using this tool or suggest alternatives for memory modification (e.g., pwndbg_patch). No explicit when-not-to-use guidance is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Micro-Evaluation-Group/pwndbg-lldb-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server