patch_apply
Overwrite bytes in a loaded image, cache the original bytes for rollback, and invalidate cached function indexes so analysis views show changes immediately.
Instructions
Overwrite bytes in a loaded image, remembering the original for rollback.
The static twin of write: patch the image (which is where the code you
disassembled actually lives), then save_image to demap it into a working
file. The cached function index is invalidated, so disassemble and
decompile show the patched bytes immediately rather than the old ones.
bytes takes hex: "EB", "EB 1C" or "EB1C". A conditional
branch is usually the target — 74/75 (jz/jnz) to EB (jmp) skips the
failure path without changing instruction length.
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": {
"key": "<key>",
"va": "<va>",
"bytes": "<bytes>"
},
"name": "patch_apply"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| va | Yes | ||
| key | Yes | ||
| note | No | ||
| bytes | Yes | ||
| session | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |