Code Monkey home page Code Monkey logo

ida_gpt's Introduction

ida_gpt

ChatGPT loves IDA!

Dependencies

This idapython script requires the unofficial chatgpt api implementation found here.

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, 2022

Obviously there is no quality assurance going on here, trust the analysis of the robot at your own risk. And have fun!

ida_gpt's People

Contributors

mayerdaniel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.