Skip to main content

Headless IDA

Project description

Headless IDA

Headless IDA

Latest Release PyPI Statistics License

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

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 with from XXX import YYY, ZZZ, or importing the entire module using import 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

headless_ida-0.6.7.tar.gz (175.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

headless_ida-0.6.7-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

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

Hashes for headless_ida-0.6.7.tar.gz
Algorithm Hash digest
SHA256 b9dd3e9feaa7c46108f6cec77845fb2f4908cfb6089d5ab9eea4d5bae97aff19
MD5 cde86f12f99a8d2a3ab52158c2781f5e
BLAKE2b-256 f1c12ddf281723fac87897245f72f75401e2a6cf30cd371e5d62e8d2cb5a6f11

See more details on using hashes here.

Provenance

The following attestation bundles were made for headless_ida-0.6.7.tar.gz:

Publisher: pypi.yml on DennyDai/headless-ida

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for headless_ida-0.6.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d526cea72dcb8d74c8901a3025323c7aca1fa7ad20a5dfa84323b71bd9a0e93f
MD5 d002a8ddd5ac10c504ef9daa00c10da0
BLAKE2b-256 5d0b21cc6bb57cdcb08d84cbadab1bde597dd94528fd75895f88e95d260270f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for headless_ida-0.6.7-py3-none-any.whl:

Publisher: pypi.yml on DennyDai/headless-ida

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page