Headless IDA
Project description
Headless IDA
Install
pip install headless-ida
Usage
[!TIP] Headless IDA supports the latest idalib. Just provide the idalib path instead of idat64 to use it as the backend.
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)}")
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.
Project details
Release history Release notifications | RSS feed
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 headless_ida-0.6.7.tar.gz.
File metadata
- Download URL: headless_ida-0.6.7.tar.gz
- Upload date:
- Size: 175.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9dd3e9feaa7c46108f6cec77845fb2f4908cfb6089d5ab9eea4d5bae97aff19
|
|
| MD5 |
cde86f12f99a8d2a3ab52158c2781f5e
|
|
| BLAKE2b-256 |
f1c12ddf281723fac87897245f72f75401e2a6cf30cd371e5d62e8d2cb5a6f11
|
Provenance
The following attestation bundles were made for headless_ida-0.6.7.tar.gz:
Publisher:
pypi.yml on DennyDai/headless-ida
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
headless_ida-0.6.7.tar.gz -
Subject digest:
b9dd3e9feaa7c46108f6cec77845fb2f4908cfb6089d5ab9eea4d5bae97aff19 - Sigstore transparency entry: 484484706
- Sigstore integration time:
-
Permalink:
DennyDai/headless-ida@404cbd947cfa123ff8ba9363c93a7dab4935d11a -
Branch / Tag:
refs/tags/0.6.7 - Owner: https://github.com/DennyDai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@404cbd947cfa123ff8ba9363c93a7dab4935d11a -
Trigger Event:
release
-
Statement type:
File details
Details for the file headless_ida-0.6.7-py3-none-any.whl.
File metadata
- Download URL: headless_ida-0.6.7-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d526cea72dcb8d74c8901a3025323c7aca1fa7ad20a5dfa84323b71bd9a0e93f
|
|
| MD5 |
d002a8ddd5ac10c504ef9daa00c10da0
|
|
| BLAKE2b-256 |
5d0b21cc6bb57cdcb08d84cbadab1bde597dd94528fd75895f88e95d260270f8
|
Provenance
The following attestation bundles were made for headless_ida-0.6.7-py3-none-any.whl:
Publisher:
pypi.yml on DennyDai/headless-ida
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
headless_ida-0.6.7-py3-none-any.whl -
Subject digest:
d526cea72dcb8d74c8901a3025323c7aca1fa7ad20a5dfa84323b71bd9a0e93f - Sigstore transparency entry: 484484718
- Sigstore integration time:
-
Permalink:
DennyDai/headless-ida@404cbd947cfa123ff8ba9363c93a7dab4935d11a -
Branch / Tag:
refs/tags/0.6.7 - Owner: https://github.com/DennyDai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@404cbd947cfa123ff8ba9363c93a7dab4935d11a -
Trigger Event:
release
-
Statement type: