https://github.com/mooncat-greenpy/kingaidra
An AI-powered extension for Ghidra that enhances analysis.
https://github.com/mooncat-greenpy/kingaidra
ai chatgpt ghidra ghidra-extension ghidra-plugin llm local-llm openai reverse-engineering
Last synced: about 1 year ago
JSON representation
An AI-powered extension for Ghidra that enhances analysis.
- Host: GitHub
- URL: https://github.com/mooncat-greenpy/kingaidra
- Owner: mooncat-greenpy
- Created: 2024-11-03T21:30:34.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-17T13:52:03.000Z (over 1 year ago)
- Last Synced: 2025-03-25T15:53:59.465Z (about 1 year ago)
- Topics: ai, chatgpt, ghidra, ghidra-extension, ghidra-plugin, llm, local-llm, openai, reverse-engineering
- Language: Java
- Homepage:
- Size: 9.17 MB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# KinGAidra Plugin
KinGAidra is a Ghidra extension designed to enhance reverse engineering workflows by integrating AI capabilities. It helps analysts understand binaries more efficiently.
## Features
- [**AI Chat for Assembly and Decompilation**](#Chat): Interact with AI to discuss and analyze binaries.
- [**AI-Assisted Refactoring**](#Refactoring): Automatically refactor decompiled code using AI-generated suggestions.
- [**AI-Assisted Commenting**](#Commenting): Automatically add comments to decompiled code using AI-generated suggestions.
- [**Key Function Identification**](#KeyFunc): Utilize AI to identify important functions in a binary for analysis.
- [**Chat History**](#History): Save chat logs for future reference or analysis.
- [**Customizable Models**](#Configuration): Employ various AI models to meet your specific needs.
### Chat
The Chat feature in KinGAidra allows users to interact with an AI to discuss and analyze binaries.
- Inputs enclosed in `` or `` tags will be converted into decompiled code.
- Inputs enclosed in `` or `` tags will be converted into assembly code.
- Inputs enclosed in `` tags will be converted into a list of strings.
**Chat Example**

**Explain Decompiled Code**

**Decompile Assembly**

### Refactoring
The Refactoring feature in KinGAidra enables users to automatically refactor decompiled code using AI-generated suggestions.

### Commenting
The Commenting feature in KinGAidra allows users to automatically add comments to decompiled code using AI-generated suggestions. This feature helps in understanding the code better by providing meaningful comments that explain the functionality of the code.

### KeyFunc
The KeyFunc feature in KinGAidra assists users in identifying and prioritizing key functions within a binary for analysis. This feature leverages AI to highlight functions of interest, allowing analysts to focus on critical parts of the code.

### History
The History feature in KinGAidra allows users to save chat logs for future reference or analysis. This can be particularly useful for tracking the progress of reverse engineering tasks, sharing insights with team members, or revisiting previous conversations to extract valuable information.

## Installation
To install KinGAidra, follow these steps:
1. **Download the latest release**: Visit the [KinGAidra releases page](https://github.com/mooncat-greenpy/KinGAidra/releases) and download the latest release zip file.
2. **Launch Ghidra**: Open Ghidra on your system.
3. **Install the extension**:
- Navigate to `File -> Install Extensions`
- Click on `Add extension`
- Select the downloaded zip file
4. **Enable KinGAidra**: Check the checkbox next to `KinGAidra` to enable the extension.
5. **Restart Ghidra**: Restart Ghidra to apply the changes.
## Configuration
Before using KinGAidra, configure the script with your LLM API details:
1. **Open Script Manager**: In Ghidra, navigate to `Window -> Script Manager`.
2. **Edit the script**: Locate the `kingaidra_chat.py` script in the list and open it for editing.
3. **Set LLM API details**: Configure the following variables in the script with the correct values for your LLM API:
- `URL`
- `MODEL`
- `API_KEY`
You can use the OpenAI API or similar APIs as the LLM API. For example, services like Groq or local LLMs are also supported. To change the language of the LLM response, modify the `POST_MSG` variable.

You can add scripts to KinGAidra through the settings screen shown in the image below. Additionally, you can select which features will utilize the added scripts.
