Skip to main content

Headless IDA

Project description

Headless IDA

Headless IDA

Latest Release PyPI Statistics License

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)}")

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.1.tar.gz (174.3 kB view details)

Uploaded Source

Built Distribution

headless_ida-0.6.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file headless_ida-0.6.1.tar.gz.

File metadata

  • Download URL: headless_ida-0.6.1.tar.gz
  • Upload date:
  • Size: 174.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for headless_ida-0.6.1.tar.gz
Algorithm Hash digest
SHA256 f3a2889cfb163afd5db30ae319ed21a4af970712834f9e0b4668e2dc64ed4ba2
MD5 58154269534606b2d13cc226150836df
BLAKE2b-256 4852f320fbd89c3c29930ec247179f83768ee59709891c34d44f9562674c707e

See more details on using hashes here.

File details

Details for the file headless_ida-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: headless_ida-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for headless_ida-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e004b905a9e168e6169288076b736c093eb8600c27e0e466a0c4a956b8c4aa6b
MD5 560cc668ab9f19e2fe61c968686b500f
BLAKE2b-256 b5fbf3f42f64500c4b2330ea5010d974e419310b092faa089673551632e839bc

See more details on using hashes here.

Supported by

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