Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mayerdaniel/ida_gpt
https://github.com/mayerdaniel/ida_gpt
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mayerdaniel/ida_gpt
- Owner: MayerDaniel
- Created: 2022-12-04T10:45:52.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-04T11:16:46.000Z (almost 2 years ago)
- Last Synced: 2024-06-15T15:33:12.015Z (5 months ago)
- Language: Python
- Size: 6.84 KB
- Stars: 81
- Watchers: 6
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-ChatGPT-repositories - ida_gpt - code to integrate #chatgpt into @hexrayssa to comment gpt's description of functions and rename variables and function names for you. (Others)
README
# ida_gpt
ChatGPT loves IDA!## Dependencies
This idapython script requires the unofficial chatgpt api implementation found [here](https://github.com/taranjeet/chatgpt-api).If you change the server port to something other than 5001, be sure you change it in the idapython script as well!
I also found that dumping a bunch of disassembly into GPT sometimes makes it take a long time. I changed my sleep time in `server.py` to be 15 seconds just to be safe.
## Usage
This is a basic idapython script to get you started with analyzing disassembly with GPT. Load it as a script file or just copy/paste the whole thing into your REPL.The script has two functions designed for being called on the address of a subroutine:
**1. get_description(ea)**
This function will provide GPT with the disassembly of the subroutine and request a plain-text description. It is then added to IDA as a function comment.
**2. refactor(ea)**
This is best called after `get_description` so GPT has a better understanding of the function. It will request variable and location name suggestions from GPT, as well as a function name. These are then written to your idb.
## See it in action!
Here's a video of it renaming some variables, locations, and the function name of an rc4 algorithm in a piece of malware.
You can also see the description comment it created for the function at the top of the IDA window
Boom! Got variable and function renaming going as well. I found that the full function descriptions can get a little tough, but even if the description is a little off, it will suggest accurate names for the variables. pic.twitter.com/QkBcgT4Nxw
— Daniel Mayer (@dan__mayer) December 4, 2022Obviously there is no quality assurance going on here, trust the analysis of the robot at your own risk. And have fun!