Kappa

VS Code extension designed to help you when decompiling a codebase.
⚠️ Work in Progress: This extension is currently under active development. Features and APIs may change.
- ✅ AI Prompt Builder: Craft high-quality prompts to guide AI in decompiling a function.
- ✅ Automated Code Fixes: Use plugins to automatically update the code’s AST, eliminating repetitive tasks and correcting common errors.
- 🚧 Agent Mode: Automatically decompile a given function, until it reache 100% match (coming soon).
- 🚧 Integration with decomp.me: Create a new scratch from VS Code (coming soon).
✨ AI Prompt Builder
https://github.com/user-attachments/assets/75d801e0-3b28-45b6-adcb-04a4b92c2063
The AI Prompt Builder creates context-aware prompts for decompiling a assembly function. It automatically analyzes your codebase to provide the AI with an accurate context for this task.
How to use it
- Select an assembly function
- Run the code action "Build a prompt to decompile it"
- Get a comprehensive prompt that includes:
- Real examples from your codebase: Functions that have already been decompiled (found via Git history)
- Function signatures of dependencies used in the target assembly
- Clear instructions and formatting rules for the AI
🔌 Kappa Plugins
https://github.com/user-attachments/assets/ca5beb10-fc7a-423e-a5b4-ba009eac7dad
Kappa plugins are scripts that transform the Abstract Syntax Tree (AST) of C/C++ code blocks. They can be used to:
- Fix common decompilation errors
- Avoid repetitive tasks
Example Kappa Plugin Case
For instance: When decompiling Sonic Advance 3 using AI, it kept messing up by using raw numbers instead of the proper Q notation. So, we can ApplyQNotationPlugin
that catches assignments to Vec32
using a raw number and replaces it with the Q format.
// Before: Raw decompiled code
player.x = 256;
// After: ApplyQNotationPlugin transformation
player.x = Q(1);
Check more examples on ./example-kappa-plugins
.
How to use it
- Add the plugins in a folder called
.kappa-plugins
from the workspace root.
- Select a function
- Run the action
Run Kappa Plugins
Contributing