Gepetto

JusticeRageGPL-3.0活跃维护

IDA Pro 插件,把大语言模型接入反汇编界面,直接解释函数、重命名变量、生成脚本,省去手动逆向的重复劳动。

IDA plugin which queries language models to speed up reverse-engineering

v1.5.1发布于 2025-11-19 11:35 UTC3,485star333fork同步于 2026-11-10 23:41 UTC

怎么上手

由 README 提炼,执行前请确认
pip install ida-hcli
hcli plugin install gepetto
硬件要求按 README 说明

README 未说明显存或 GPU 要求;可通过 Ollama 或 LM Studio 使用本地模型,其余为云端 API 调用。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

IDA 插件,用大模型解释反编译函数并自动重命名变量,加速逆向分析

IDA Pro 插件,把大语言模型接入反汇编界面,直接解释函数、重命名变量、生成脚本,省去手动逆向的重复劳动。

核心能力

  • 调用大模型解释 IDA 反编译出的函数语义
  • 自动为函数变量生成更可读的名称
  • 支持 Anthropic、OpenAI、Gemini、Ollama 等多家模型
  • 提供 Ctrl+Alt+G/K/R 快捷键触发解释、注释与重命名
  • 可在 IDA 输入栏用 CLI 直接向模型提问

容易踩的坑

需要 IDA Pro ≥ 7.6 且必须能使用 HexRays 反编译器;手动安装时要把依赖装进 IDA 自带的 Python 解释器而非系统 Python;首次运行后需编辑用户目录下的 config.ini 填入 API Key,且多数 API 调用需付费;新增 provider 或配置后需重启 IDA 才生效。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.5.1
  1. v1.5.1最新正式版2025-11-19 · 2025-11-19 11:35 UTC

    This release makes Gepetto discoverable by hcli, IDA's plugin manager.

    What's Changed

  2. v1.5.02025-10-03 · 2025-10-03 12:19 UTC
    查看更新说明

    New features

    • This release starts the shift towards agentic reverse-engineering by exposing many tools to the LLM, available via the cli.
    • A new window dedicated to Gepetto was added (by @quippy-dev, who also vastly improved Gemini support)
    • Many minor improvements and bugfixes

    What's Changed

  3. v1.4.12024-09-20 · 2024-09-20 18:58 UTC
    查看更新说明

    Bugfix release (#45)

  4. v1.42024-09-18 · 2024-09-18 22:43 UTC
    查看更新说明
    • Local models exposed via Ollama are now supported!
      • Ollama will only appear in the menu if the program is running.
    • Added a CLI interface in IDA Pro so that users can converse with the selected model directly.
    • Important refactoring under the hood so that menus can be generated dynamically based on all available models.
      • An added benefit is that third parties trying to add support for more models should have an easier time.

    ⚠ A new dependency was added (ollama), make sure you run pip install requirements.txt again after updating! ⚠

  5. v1.32024-06-12 · 2024-06-12 08:21 UTC
    查看更新说明

    Added support for a variety of non-OpenAI models

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Gepetto

    Gepetto is a Python plugin which uses various large language models to provide meaning to functions decompiled by IDA Pro (≥ 7.6). It can leverage them to explain what a function does, and to automatically rename its variables. Here is a simple example of what results it can provide in mere seconds:

    Setup

    Using hcli (Recommended)

    The easiest way to install Gepetto is using the Hex-Rays CLI tool (hcli):

    pip install ida-hcli
    hcli plugin install gepetto
    

    This will automatically install the plugin to your IDA user directory.

    Manual Installation

    Alternatively, you can manually install the plugin:

    1. Drop this script (gepetto.py, as well as the gepetto/ folder) into your IDA plugins folder ($IDAUSR/plugins).
    2. The plugins directory location depends on your system:
      • Windows: %APPDATA%\Hex-Rays\IDA Pro\plugins\
      • macOS: ~/.idapro/plugins/
      • Linux: ~/.idapro/plugins/
    3. Install the required packages to IDA's Python installation. Find which interpreter IDA is using by checking the following registry key: Computer\HKEY_CURRENT_USER\Software\Hex-Rays\IDA (default on Windows: %LOCALAPPDATA%\Programs\Python\Python39).
    4. With the corresponding interpreter, simply run:
      [/path/to/python] -m pip install -r requirements.txt
      

    Configuration

    Gepetto keeps its configuration in your IDA user directory, so it survives plugin upgrades:

    • Windows: %APPDATA%\Hex-Rays\IDA Pro\cfg\gepetto\config.ini
    • macOS / Linux: ~/.idapro/cfg/gepetto/config.ini

    The first time the plugin runs it copies gepetto/config.ini there and tells you the path on the console. After that, the copy shipped with the plugin is only a template — edit the one in your user directory. Set GEPETTO_CONFIG_DIR to override the location entirely.

    Add your API keys to that file, or supply them through the environment variables named in it. For OpenAI, a key can be created on this page. Please note that API queries are usually not free (although not very expensive) and you will need to set up a payment method with the corresponding provider.

    Supported models

    • Anthropic
      • claude-opus-4-7
      • claude-sonnet-4-6
      • claude-haiku-4-5
    • OpenAI
      • gpt-5
      • gpt-5-mini
      • gpt-5-nano
      • gpt-4-turbo
      • gpt-4o
      • o4-mini
      • gpt-4.1
      • o3
      • o3-pro
    • Google Gemini
      • gemini-2.0-flash
      • gemini-2.5-pro
      • gemini-2.5-flash
      • gemini-2.5-flash-lite-preview-06-17
    • Azure OpenAI
      • gpt-35-turbo
      • gpt-35-turbo-1106
      • gpt-35-turbo-16k
      • gpt-4-turbo
      • gpt-4-turbo-2024-0409-gs
    • Ollama
      • Any local model exposed through Ollama (will not appear if Ollama is not running)
    • Groq
      • llama-3.1-70b-versatile
      • llama-3.2-90b-text-preview
      • mixtral-8x7b-32768
    • Together
      • mistralai/Mixtral-8x22B-Instruct-v0.1 (does not support renaming variables)
    • Novita AI
      • deepseek/deepseek-r1
      • deepseek/deepseek-v3
      • meta-llama/llama-3.3-70b-instruct
      • meta-llama/llama-3.1-70b-instruct
      • meta-llama/llama-3.1-405b-instruct
    • Kluster.ai
      • deepseek-ai/DeepSeek-R1
      • deepseek-ai/DeepSeek-V3-0324
      • google/gemma-3-27b-it
      • klusterai/Meta-Llama-3.1-8B-Instruct-Turbo
      • klusterai/Meta-Llama-3.1-405B-Instruct-Turbo
      • klusterai/Meta-Llama-3.3-70B-Instruct-Turbo
      • meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8
      • meta-llama/Llama-4-Scout-17B-16E-Instruct
      • Qwen/Qwen2.5-VL-7B-Instruct
    • LM Studio
      • Any local model exposed through LM Studio (will not appear if LM Studio Developer server is not running)

    Adding your own provider

    Gepetto loads providers from three places, each overriding the last on a menu name collision: the modules shipped in gepetto/models/, then any .py file in $IDAUSR/cfg/gepetto/providers/, then any installed distribution advertising a gepetto.providers entry point. Overrides are announced on the console, so you can replace a built-in provider without forking the plugin.

    A drop-in provider uses exactly the same contract as a built-in one. For an OpenAI-compatible endpoint, the whole file is:

    import openai
    import gepetto.config
    import gepetto.models.model_manager
    from gepetto.models.openai import GPT
    
    
    class MyProvider(GPT):
        @staticmethod
        def get_menu_name() -> str:
            return "MyProvider"
    
        @staticmethod
        def supported_models():
            return ["my-model-v1"]
    
        @staticmethod
        def is_configured_properly() -> bool:
            return bool(gepetto.config.get_config("MyProvider", "API_KEY", "MYPROVIDER_API_KEY"))
    
        def __init__(self, model):
            try:
                super().__init__(model)
            except ValueError:
                pass  # No OpenAI key needed for this provider.
            self.model = model
            self.client = openai.OpenAI(
                api_key=gepetto.config.get_config("MyProvider", "API_KEY", "MYPROVIDER_API_KEY"),
                base_url="https://api.example.com/v1",
            )
    
    
    gepetto.models.model_manager.register_model(MyProvider)
    

    Add a matching [MyProvider] section to your config.ini and restart IDA: providers are registered at load time, so a new key or a new file needs a restart before it appears in the menu.

    To ship one as a package instead, expose the class or a register(register_model) callable:

    [project.entry-points."gepetto.providers"]
    myprovider = "myprovider:MyProvider"
    

    Files in providers/ execute arbitrary Python when IDA starts. That is the same trust level as any IDA plugin, but only install providers you trust.

    Usage

    Once the plugin is installed properly, you should be able to invoke it from the context menu of IDA's pseudocode window, as shown in the screenshot below:

    Switch between models supported by Gepetto from the Edit > Gepetto menu:

    Gepetto also provides a CLI interface you can use to ask questions to the LLM directly from IDA. Make sure to select Gepetto in the input bar:

    Hotkeys

    The following hotkeys are available:

    • Ask the model to explain the function: Ctrl + Alt + G
    • Ask the model to add comments to the code: Ctrl + Alt + K
    • Request better names for the function's variables: Ctrl + Alt + R

    Initial testing shows that asking for better names works better if you ask for an explanation of the function first – I assume because the model then uses its own comment to make more accurate suggestions. There is an element of randomness to the AI's replies. If for some reason the initial response you get doesn't suit you, you can always run the command again.

    Limitations

    • The plugin requires access to the HexRays decompiler to function.
    • All supported LLMs are general-purpose and may very well get things wrong! Always be critical of results returned!

    Translations

    You can change Gepetto's language by editing the locale in the configuration. For instance, to use the plugin in French, you would simply add:

    [Gepetto]
    LANGUAGE = "fr_FR"
    

    The chosen locale must match the folder names in gepetto/locales. If the desired language isn't available, you can contribute to the project by adding it yourself! Create a new folder for the desired locale (ex: gepetto/locales/de_DE/LC_MESSAGES/), and open a new pull request with the updated .po file, which you can create by copying and editing gepetto/locales/gepetto.pot (replace all the lines starting with msgstr with the localized version).

    Acknowledgements

    • OpenAI, for making these incredible models, obviously
    • Hex Rays, the makers of IDA for their lightning fast support
    • Kaspersky, for initially funding this project
    • HarfangLab, the current backer making this work possible
    • @vanhauser-thc for contributing ideas of additional models and providers to support via his fork
    • Everyone who contributed translations: @seifreed, @kot-igor, @ruzgarkanar, @orangetw