decompile_function
Decompile a binary function to pseudo-C code for static analysis, using auto-selected r2ghidra or native backend.
Instructions
Decompile a function to pseudo-C representation using the available decompiler backend.
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": {
"binary_path": "<binary_path>"
},
"name": "decompile_function"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | No | Hex address of the function (e.g. "0x08048000") | |
| backend | No | Decompiler backend: "auto" tries pdg (r2ghidra) first then falls back to pdc, "pdc" uses r2 native, "pdg" uses r2ghidra | auto |
| binary_path | Yes | Absolute path to the binary file | |
| function_name | No | Name of the function to decompile (e.g. "main") |