Skip to main content
Glama

export_module

Dump a live module to a PE file that IDA, Ghidra, and pefile can open by demapping RVA-indexed memory to correct raw section offsets; use raw mode for byte-exact mapped captures.

Instructions

Dump a live module to a PE file that IDA, Ghidra and pefile will open.

The last mile of unpacking: capture the module, then write it somewhere useful. A memory buffer is RVA-indexed, so writing it out verbatim gives a file whose section headers no longer match where the bytes are — every tool rejects it. This demaps it: headers stay, each section moves from its virtual address to its declared raw offset.

raw=True keeps the mapped layout instead, for byte-exact captures.

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": {
      "module": "<module>",
      "path": "<path>"
    },
    "name": "export_module"
  }
}

Input Schema

NameRequiredDescriptionDefault
pidNo
rawNo
pathYes
moduleYes
sessionNodefault

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does disclose the crucial non-obvious behavior: this demaps a RVA-indexed buffer so section headers match, and raw=True preserves the mapped layout. It omits filesystem side-effect details — whether an existing file at path is overwritten, whether parent directories are created, and failure modes when the module or pid is invalid.

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

Conciseness4/5

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

Front-loaded with the action, then mechanism, then the raw variant — a logical build. The prose is slightly atmospheric ("the last mile of unpacking", "somewhere useful") but each sentence still carries information, so waste is minimal.

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

Completeness4/5

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

An output schema exists, so return values need no prose, and the description adequately covers the transformation that makes this tool nontrivial. The remaining gaps are the roles of pid and session and the overwrite behavior of a destructive write to disk, which matter for correct invocation of a 5-parameter export 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?

Schema coverage is 0%, so the description must supply meaning, and it does so well for raw (mapped vs. demapped layout) — a distinction the boolean type alone cannot convey. However, pid and session receive no explanation at all, and path/module semantics (does path include filename? what identifies a module when a pid is absent?) are left to inference across 5 parameters.

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?

States a specific verb and resource — dump a live module to a PE file openable by IDA, Ghidra and pefile — and frames it within the unpacking workflow (capture the module, then write it somewhere useful), which separates it conceptually from capture_module and dump_region.

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

Usage Guidelines4/5

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

"The last mile of unpacking: capture the module, then write it somewhere useful" gives a clear ordering cue toward capture_module as the prior step, and the raw=True sentence sketches a second use case (byte-exact captures). No explicit when-not guidance or named alternative for the non-raw path, so it stops short of 5.

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