Headless IDA
Install
pip install headless-ida
Usage
Use it as a normal Python module.
# Initialize HeadlessIda
from headless_ida import HeadlessIda
headlessida = HeadlessIda("/path/to/idat64", "/path/to/binary")
# Import IDA Modules (make sure you have initialized HeadlessIda first)
import idautils
import ida_name
# Or Import All IDA Modules at Once (idaapi is not imported by default)
# from headless_ida.ida_headers import *
# Have Fun
for func in idautils.Functions():
print(f"{hex(func)} {ida_name.get_ea_name(func)}")
Run a function inside IDA
run() executes a synchronous function in IDA and returns its pickleable result. Put imports inside the function.
def analyze(prefix="", *, limit=100):
import idautils
import ida_name
return tuple(
(ea, ida_name.get_ea_name(ea))
for ea in idautils.Functions()
if ida_name.get_ea_name(ea).startswith(prefix)
)[:limit]
result = headlessida.run(analyze, "sub_", limit=50)
Use it as a command line tool.
# Interactive Console
$ headless-ida /path/to/idat64 /path/to/binary
Python 3.8.10 (default, Nov 14 2022, 12:59:47)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import idautils
>>> list(idautils.Functions())[0:10]
[16384, 16416, 16432, 16448, 16464, 16480, 16496, 16512, 16528, 16544]
>>>
# Run IDAPython Script
$ headless-ida /path/to/idat64 /path/to/binary idascript.py
# One-liner
$ headless-ida /path/to/idat64 /path/to/binary -c "import idautils; print(list(idautils.Functions())[0:10])"
# In case you like IPython
$ headless-ida /path/to/idat64 /path/to/binary -c "import IPython; IPython.embed();"
Advanced Usage
Remote Server
Start a Headless IDA server
$ headless-ida-server /path/to/idat64 localhost 1337 &
Connect to the server in Python script
# Initialize HeadlessIda
from headless_ida import HeadlessIdaRemote
headlessida = HeadlessIdaRemote("localhost", 1337, "/path/to/local/binary")
# Import IDA Modules (make sure you have initialized HeadlessIda first)
import idautils
import ida_name
# Have Fun
for func in idautils.Functions():
print(f"{hex(func)} {ida_name.get_ea_name(func)}")
Connect to the server in command line
# Interactive Console
$ headless-ida localhost:1337 /path/to/local/binary
# Run IDAPython Script
$ headless-ida localhost:1337 /path/to/local/binary idascript.py
# One-liner
$ headless-ida localhost:1337 /path/to/local/binary -c "import idautils; print(list(idautils.Functions())[0:10])"
Resources
- Headless IDA Examples
- IDAPython Official Documentation
- IDAPython Official Examples: 1, 2
Known Issues
from XXX import *
- Using
from XXX import *syntax with certain ida modules (like idaapi, ida_ua, etc.) is currently unsupported due to SWIG and RPyC compatibility issues. We recommend importing specific items withfrom XXX import YYY, ZZZ, or importing the entire module usingimport XXX. - The issue arises because SWIG, employed for creating Python bindings for C/C++ code, generates intermediary objects (SwigVarlink) that RPyC, our remote procedure call mechanism, cannot serialize or transmit correctly.
Metadata
Release files for headless-ida 0.6.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| headless_ida-0.6.8.tar.gz | 176.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| headless_ida-0.6.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 189.8 kB
Release files / headless_ida-0.6.8.tar.gz
| Download URL | headless_ida-0.6.8.tar.gz |
|---|---|
| Size | 176.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d16b3766293e097c2f39dcab4cb8627150ba73cb1ca7d848a75f34fc2b3117b6
|
|
BLAKE2b-256 checksum How to use checksums |
0d845a360f9e6bb178b7a64700198946f44092a316e9841bf1631f74d9d91cf4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logRelease files / headless_ida-0.6.8-py3-none-any.whl
| Download URL | headless_ida-0.6.8-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
627fa81c2bdf4cc5b5848f6b2ff7ad3f8f4281affc512510320ecbdbbbba60e6
|
|
BLAKE2b-256 checksum How to use checksums |
84975090c3b74a2ac77c4e3f4b37d55767256dc3a9d7211466a1cd47c4f85a38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency log