Skip to main content
Glama

write_memory

DestructiveIdempotent

Writes hex-encoded bytes to a specified game process memory address, blocking writes to hooked function entries unless force is enabled.

Instructions

写游戏进程内存。

⚠️ 危险操作:写错地址会立刻崩溃游戏。 写之前务必先用 read_memory 确认地址内容符合预期。 建议只改浮点数/整数这类简单值,并先备份原值。

不要写已装 Hook 的函数入口:Frida 的 Interceptor 拥有那几字节 (它在那里写了跳转指令),绕过它直接 Memory.protect + 写同一块内存, 哪怕写回刚读到的同样字节,也会在数秒内让游戏崩溃 —— 实测两次:Windows 事件日志里是 GameAssembly.dll 在该方法 RVA 处的 0xc0000005;同样操作写在模块头(base)上则完全无害且能原样读回。 本工具默认拒绝这种写入;确实要写请传 force=True, 或者先 unhook 再写。

Args: address: 地址(十六进制)。 hex_data: 要写入的字节,十六进制串(如 "0000803f" 表示 float 1.0)。 force: 明知目标被 Hook 覆盖仍要写(默认 False = 拒绝)。

Input Schema

NameRequiredDescriptionDefault
forceNo
addressYes
hex_dataYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true, but the description adds the non-obvious behavior an agent could never infer: default rejection of writes over hooked function entries, the crash mechanism behind it, and the fact that even identical bytes cause a crash in that case. It also discloses acceptable targets (module headers) and the force override semantics.

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 danger, then prerequisites, then the hook rule, then args – a sensible order with no wasted framing. The retrospective detailing (Windows event log, 'c0000005', 'tested twice') is more narration than an agent needs, though it does substantiate the rule.

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?

For a dangerous 3-parameter mutation with no output schema and thin annotations, the description covers risk, prerequisites, refusal semantics and per-param encoding. It never states what a successful call returns (e.g. new bytes or a status), which is the one gap an agent might notice.

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

Parameters5/5

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

Schema description coverage is 0%, but the args section documents all three parameters: address is hexadecimal, hex_data is a hex string with a concrete encoding example ('0000803f' = float 1.0), and force is an opt-in override whose default false means refuse. This fully compensates for the absent schema descriptions.

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

Purpose4/5

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

States a specific verb and resource: writing raw bytes into a game process's memory, which is clearly distinct from reading or hooking. It does not explicitly say how it differs from set_field_value, the sibling that presumably writes values at a typed/higher level, so the boundary needs inference.

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

Usage Guidelines5/5

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

Gives explicit when-to-use and prerequisite steps (verify the address with read_memory first, back up the original value, prefer simple float/int payloads) and an explicit refusal case with two documented escapes (force=True or unhook first). The agent knows exactly what to do before and instead of calling this.

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