Headless IDA
Project description
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
# 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
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
headless-ida-0.3.1.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for headless_ida-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6060efdad475053ed43a947a095fd1cd6fd63c6807195f1ef7d742cb14cb839 |
|
MD5 | b213ef558946d7f519ea14ab5dc0cab3 |
|
BLAKE2b-256 | fe7f39e684fe7878be18e5dbfb0bf86e2b3e31d11f1fd99f40c70087a734a523 |