restore-function-signatures

Restore decompiled C/C++ function signatures from IDA Pro or Ghidra pseudocode.

3|Updated May 19, 2026
One-click install
npx skills add https://github.com/xyt66665000/CodeRepairAgent --skill restore-function-signatures
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: restore-function-signatures
Source: https://github.com/xyt66665000/CodeRepairAgent/tree/main/skills/restore-function-signatures
Command: npx skills add https://github.com/xyt66665000/CodeRepairAgent --skill restore-function-signatures

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Decompiler output often replaces real function signatures with generic types and placeholder names, making recovered C/C++ code hard to compile and understand.

Core Features & Use Cases

  • Function signature restoration: Recover return types, parameter types, parameter names, and calling conventions from degraded decompiler output.
  • UB downgrade recovery: Detect and restore parameters dropped by signature-degrading casts (CWE-457 style) to reintroduce the missing arguments.
  • Memory-semantics-first validation: Prioritize preserving dereference depth and data-flow paths while improving only the signature surface to reach strict compilation.

Quick Start

Use the restore-function-signatures skill on your decompiled .c file where function signatures look like __int64 sub_401230(__int64 a1, int a2) and ask it to restore return type, parameter types, parameter names, calling convention, and any dropped parameters.

Frequently Asked Questions about restore-function-signatures

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I restore missing parameter types in decompiled C/C++ pseudocode?

Restore missing parameter types by inferring correct return types, parameter names, and calling conventions from call-site and body evidence. This process repairs degraded decompiled C/C++ pseudocode, replacing generic placeholders with meaningful, compilable function signatures.

How can I fix CWE-457 use of uninitialized variable issues caused by signature degrading casts?

Fix CWE-457 style issues by detecting parameters dropped by signature-degrading casts and reintroducing the missing arguments. This restores the original memory semantics and data-flow edges compromised during decompilation.

Can I use this to recover function signatures from IDA Pro or Ghidra decompiled code?

Yes, you can recover function signatures from IDA Pro or Ghidra decompiled code. The process targets degraded C/C++ pseudocode where signatures are generic, restoring them while preserving dereference depth and data-flow paths.

What is the best way to ensure restored decompiled function signatures compile correctly?

Ensure restored decompiled function signatures compile correctly by performing strict GCC compilation verification after applying signature edits. Changes are gated by cross-validation confidence to guarantee memory semantics are preserved.

Why does my decompiled code show generic __int64 types instead of actual parameters?

Decompiled code shows generic __int64 types because decompilers replace real function signatures with generic types and placeholder names to match undefined behavior. This makes recovered C/C++ code hard to compile and understand without signature restoration.