Detects banned/insecure functions in binary files using radare2 decompilers.
Project description
BannedFuncDetector
Detect banned/insecure functions in binary files using radare2 decompilers
Overview
BannedFuncDetector is a Python tool that scans binary files to detect banned or insecure functions. It supports traditional radare2 decompilers and AI-assisted decompilation to provide readable output and highlight risky calls.
Key Features
| Feature | Description |
|---|---|
| Binary Analysis | Analyze PE/ELF/Mach-O binaries for banned functions |
| Multiple Decompilers | r2ghidra, r2dec, default, and decai (AI assistant) |
| Directory Scans | Analyze one file or whole directories |
| Parallel Processing | Speed up directory scans |
| JSON Reports | Results saved per target with structured output |
| Library Mode | Use via CLI or import as a Python package |
Supported Decompilers
Default (pdc) r2ghidra (pdg) r2dec (pdd) decai (AI assistant)
Installation
From PyPI (Recommended)
pip install bannedfuncdetector
From Source
git clone https://github.com/seifreed/BannedFuncDetector.git
cd BannedFuncDetector
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -e .
Quick Start
# Analyze a single binary
bannedfunc -f /path/to/binary
# Analyze a directory
bannedfunc -d /path/to/binaries --parallel
# Use r2dec
bannedfunc -f /path/to/binary --decompiler r2dec
Usage
Command Line Interface
# Basic analysis
bannedfunc -f /path/to/binary
# Analyze a directory with parallel workers
bannedfunc -d /path/to/binaries --parallel
# Save output to a custom directory
bannedfunc -f /path/to/binary -o output
# Force a decompiler
bannedfunc -f /path/to/binary --decompiler r2ghidra --force-decompiler
# Skip decompilation analysis (names only)
bannedfunc -f /path/to/binary --skip-analysis
Available Options
| Option | Description |
|---|---|
-f, --file |
Executable file to analyze |
-d, --directory |
Directory with executables to analyze |
-o, --output |
Output directory for results |
--decompiler |
Decompiler to use (default, r2ghidra, r2dec, decai) |
--force-decompiler |
Force the specified decompiler |
--parallel |
Process files in parallel (directory only) |
--skip-banned |
Skip banned function name checks |
--skip-analysis |
Skip decompilation analysis |
--check-requirements |
Check system requirements before running |
-v, --verbose |
Show detailed information |
Python Library
Basic Usage
from bannedfuncdetector.bannedfunc import analyze_file
result = analyze_file(
"/path/to/binary",
decompiler_type="r2ghidra",
output_dir="output",
)
print(result)
Directory Analysis
from bannedfuncdetector.bannedfunc import analyze_directory
results = analyze_directory(
"/path/to/binaries",
output_dir="output",
decompiler_type="r2dec",
)
print(results)
Requirements
- Python 3.14+
- radare2 (required)
- r2ghidra/r2dec (optional decompilers)
- Ollama + decai plugin (optional for AI-assisted decompilation)
- See
pyproject.tomlfor Python dependencies
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Support the Project
If you find BannedFuncDetector useful, consider supporting its development:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Attribution Required:
- Author: Marc Rivero | @seifreed
- Repository: github.com/seifreed/BannedFuncDetector
Made with dedication for the reverse engineering community
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bannedfuncdetector-2.0.0.tar.gz.
File metadata
- Download URL: bannedfuncdetector-2.0.0.tar.gz
- Upload date:
- Size: 89.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
650a162f4561b01692a03bf52ef95f8411a1a4ae5b4dd70db17f8e3f5cb171dd
|
|
| MD5 |
b5a4d4c5839594a3029790a0c4c5c9da
|
|
| BLAKE2b-256 |
f5ab71d9b39cca926998734f3d523625f195bb8ee8abc796d2aec336f240dc18
|
File details
Details for the file bannedfuncdetector-2.0.0-py3-none-any.whl.
File metadata
- Download URL: bannedfuncdetector-2.0.0-py3-none-any.whl
- Upload date:
- Size: 92.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5ace82c21f9d4fc16d0a78a0043496c62f7e786fe4d9326fa5d0ed63bec0466
|
|
| MD5 |
05ace74d4d8f5cb63386b15d3f649f57
|
|
| BLAKE2b-256 |
45e2c113036823a8e1b010500793fb2efcc87c6c7a89214e63449b48b685680c
|