Skip to main content

IDA Domain API - Python interface for IDA Pro reverse engineering platform

Project description

IDA Domain

PyPI version Python Support License: MIT

The IDA Domain API is a new open-source Python API designed to make scripting in IDA simpler, more consistent, and more natural.

This is a first step in a much longer journey. It’s not the finish line, but a foundation for ongoing collaboration between Hex-Rays and the reverse engineering community. Over time, the Domain API will expand to cover more areas of IDA, gradually becoming the main entry point for scripting and plugin development.

The Domain in Domain API refers to the domain of reverse engineering. Concepts like functions, types, cross-references, and more are first-class citizens in this API, giving you cleaner, domain-focused abstractions for common tasks.

The Domain API sits on top of the IDA Python SDK, complementing it rather than replacing it. You can use both side by side—combining the clarity and simplicity of Domain API calls with the full flexibility of the SDK when needed.

Compatibility: Requires IDA Pro 9.1.0 or later

🚀 Key Features

  • Domain-focused design – Work directly with core reverse engineering concepts like functions, types, and xrefs as first-class citizens.
  • Open source from day one – Read the code, suggest improvements, or contribute new ideas.
  • Pure Python implementation – No compilation required, works with modern Python versions.
  • Compatible by design – Use alongside the IDA Python SDK without conflicts.
  • Developer-centric – Reduce boilerplate and streamline frequent tasks.
  • Independently versioned – Upgrade at your own pace and pin versions for stability.
  • Simple installation – Get started with a single pip install.

📦 Installation

Prerequisites

IDA Pro Version: The IDA Domain library requires IDA Pro 9.1.0 or later.

Set the IDADIR environment variable to point to your IDA installation directory:

export IDADIR="[IDA Installation Directory]"

Example:

export IDADIR="/Applications/IDA Professional 9.1.app/Contents/MacOS/"

Note: If you have already installed and configured the idapro Python package, setting IDADIR is not required.

Install from PyPI

pip install ida-domain

🎯 Usage Example

Here is an example showing how to use IDA Domain to analyze a binary:

#!/usr/bin/env python3
"""
Database exploration example for IDA Domain API.

This example demonstrates how to open an IDA database and explore its basic properties.
"""

import argparse
from dataclasses import asdict

import ida_domain
from ida_domain import Database
from ida_domain.database import IdaCommandOptions


def explore_database(db_path):
    """Explore basic database information."""
    ida_options = IdaCommandOptions(auto_analysis=True, new_database=False)
    with Database.open(db_path, ida_options) as db:
        # Get basic information
        print(f'Address range: {hex(db.minimum_ea)} - {hex(db.maximum_ea)}')

        # Get metadata
        print('Database metadata:')
        metadata_dict = asdict(db.metadata)
        for key, value in metadata_dict.items():
            print(f'  {key}: {value}')

        # Count functions
        function_count = 0
        for _ in db.functions:
            function_count += 1
        print(f'Total functions: {function_count}')


def main():
    """Main entry point with argument parsing."""
    parser = argparse.ArgumentParser(description='Database exploration example')
    parser.add_argument(
        '-f', '--input-file', help='Binary input file to be loaded', type=str, required=True
    )
    args = parser.parse_args()
    explore_database(args.input_file)


if __name__ == '__main__':
    main()

📖 Documentation

Complete documentation is available at: https://ida-domain.docs.hex-rays.com/

  • API Reference: Documentation of available classes and methods
  • Getting Started: Complete setup guide including installation and first steps
  • Examples: Usage examples for common tasks

🛠️ Development

For development, we use a uv based workflow:

git clone https://github.com/HexRaysSA/ida-domain.git
cd ida-domain
uv sync --extra dev
uv run pre-commit install

🧪 Testing

Set the IDADIR environment variable to point to your IDA installation directory:

Run the test suite using pytest:

uv sync --extra dev
uv run pytest

📚 Build Documentation

To build the documentation locally:

uv sync --extra docs
uv run mkdocs serve

Or to just build it,

uv run mkdocs build

The documentation is available in site/

Online Documentation

The latest documentation is available at: https://ida-domain.docs.hex-rays.com/

📝 Examples

Check the examples/ directory for usage examples:

uv run python examples/analyze_database.py

Contributing

We welcome contributions! Please see our Contributing Guidelines for details on how to:

  • Report bugs and suggest features
  • Submit pull requests with proper testing

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

ida_domain-0.4.0.tar.gz (94.5 kB view details)

Uploaded Source

Built Distribution

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

ida_domain-0.4.0-py3-none-any.whl (101.0 kB view details)

Uploaded Python 3

File details

Details for the file ida_domain-0.4.0.tar.gz.

File metadata

  • Download URL: ida_domain-0.4.0.tar.gz
  • Upload date:
  • Size: 94.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ida_domain-0.4.0.tar.gz
Algorithm Hash digest
SHA256 17ba73b9e71366f0e3cfee3993443ea25857462c51bef2b93223adfe3893b0f2
MD5 7b206e4056b0af32628d131653b1e54b
BLAKE2b-256 fe74a3f7db78d8cc23ffd8e813d2a53281791542c724cb379d8c79edfafbfdbd

See more details on using hashes here.

File details

Details for the file ida_domain-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: ida_domain-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 101.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ida_domain-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9355efb8486b52c5ca52a8c7333c84e0a97ca955e94bfd05db754f2b67d83cf0
MD5 2bf1625c8ede9391b39b2d8b4d1ac7f0
BLAKE2b-256 71515d2188cdef158671fc8b5ad8995c836a4ba3640a15b3986101a71c50ce4c

See more details on using hashes here.

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