
Use IDA PRO HexRays decompiler with OpenAI(ChatGPT) to find possible vulnerabilities in binaries
An IDA PRO plugin to help in finding vulnerabilites in binaries.
Use IDA PRO HexRays decompiler with OpenAI(ChatGPT) to find possible vulnerabilities in binaries
Disclaimer, possible replies while trying to find binary vulnerabilites using an AI may lead to false positives, however it has worked in many CTFs I have worked on (simple/medium ... some hard)
Drop python script on IDA Pro Plugin location.
Right click on decompiled code , select "Find possible vulnerability in function"




BinAIVulHunter is an advanced IDA Pro plugin that leverages multiple AI providers (OpenAI GPT, Google Gemini, and Ollama) to perform intelligent vulnerability analysis, code explanation, and security assessment of decompiled functions.
Download the plugin:
# Save BinAIVulHunter.py to your IDA Pro plugins directory
# Typically: C:\Program Files\IDA Pro X.X\plugins\
Install base dependencies:
pip install psutil
Install AI provider libraries (choose one or more):
# For OpenAI
pip install openai
# For Google Gemini
pip install google-generativeai
# For Ollama (local AI)
pip install requests
Restart IDA Pro to load the plugin
Get API Key:
Set Environment Variable:
# Windows Command Prompt
set OPENAI_API_KEY=sk-your-openai-key-here
# PowerShell
$env:OPENAI_API_KEY="sk-your-openai-key-here"
# Linux/Mac
export OPENAI_API_KEY="sk-your-openai-key-here"
Restart IDA Pro
Get API Key:
Set Environment Variable:
# Windows Command Prompt
set GEMINI_API_KEY=your-gemini-key-here
# PowerShell
$env:GEMINI_API_KEY="your-gemini-key-here"
# Linux/Mac
export GEMINI_API_KEY="your-gemini-key-here"
Restart IDA Pro
Install Ollama:
# Linux
curl -fsSL https://ollama.ai/install.sh | sh
# macOS
brew install ollama
Start Ollama Service:
ollama serve
Pull AI Models:
# For general code analysis
ollama pull llama2
# For coding tasks (recommended)
ollama pull codellama
# Other specialized models
ollama pull mistral
ollama pull deepseek-coder
Optional Environment Variables:
# Custom Ollama server (if not localhost:11434)
set OLLAMA_BASE_URL=http://your-server:11434
# Set default model
set OLLAMA_MODEL=codellama
| Variable | Description | Default | Required |
|---|---|---|---|
OPENAI_API_KEY | OpenAI API key | None | For OpenAI |
GEMINI_API_KEY | Google Gemini API key | None | For Gemini |
OLLAMA_BASE_URL | Ollama server URL | http://localhost:11434 | No |
OLLAMA_MODEL | Default Ollama model | llama2 | No |
VULCHAT_PROVIDER | AI provider to use | openai | No |
VULCHAT_MODEL | Specific model name | Provider default | No |
OPENAI_BASE_URL | Custom OpenAI endpoint | Official API | No |
Set your preferred AI provider:
# Use OpenAI (default)
set VULCHAT_PROVIDER=openai
# Use Google Gemini
set VULCHAT_PROVIDER=gemini
# Use Ollama (local)
set VULCHAT_PROVIDER=ollama
Edit → VulChatRight-click in the decompiler view to access:
Access via Edit → VulChat → Control Panel or Ctrl+Alt+P:
| Hotkey | Action |
|---|---|
Ctrl+Alt+V | Find Vulnerabilities |
Ctrl+Alt+G | Explain Function |
Ctrl+Alt+R | Rename Variables |
Ctrl+Alt+X | Generate Test Inputs |
Ctrl+Alt+S | Scan All Functions |
Ctrl+Alt+W | CWE Reference Lookup |
Ctrl+Alt+P | Control Panel |
Ctrl+F5 | Decompile All Functions |
For automated analysis and CI/CD integration:
# Scan all functions for vulnerabilities
ida64.exe -A -S"BinAIVulHunter.py --scan-all --output results.json" binary.exe
# Decompile all functions with caching
ida64.exe -A -S"BinAIVulHunter.py --decompile-all --cache-dir ./cache" binary.exe