Imported from Zfinix/eleven (
app/skills/decompile/SKILL.md). Install upstream withnpx skills add Zfinix/eleven --skill decompile. Copyright stays with the author.
Decompile a function
A decompiler plugin is optional here. You reconstruct the C yourself from what the engine gives you.
- Call
current_view(eleven) for the function in focus, unless the user named one. - Read
procedure_pseudo_code. If it is missing, or it is really just disassembly (some engines, like Rizin without a decompiler plugin, only disassemble), readprocedure_assemblyand reconstruct the logic from the instructions. - Read
procedure_callersandprocedure_callees, and any strings the function references, to work out the parameters, the return value, and what it is for.
Then write it out:
- Clean C for the function: real parameter and local names, a struct or enum where the code clearly implies one, and the control flow a person would actually write. Stay faithful to the instructions, do not invent behavior.
- Put a
/* ? */comment on anything you are unsure of. rename_function(eleven) it and anyFUN_callees you now understand, andadd_noteone sentence on what it does.
Answer with the C in a code block, then two or three lines on what it does and anything surprising (error paths, magic numbers, side effects). This is reconstruction from the binary, not the original source; say which parts are a guess.
