IDAPython API Reference

IDAPython allows you to create custom scripts and plugins that enhance IDA’s core functionality. This reference documentation covers 50+ modules for disassembly manipulation, decompilation, debugging, and UI customization. You can explore the IDAPython API by navigating the modules below, or use the quick reference to jump straight to what you need.

Tip

Looking for a simpler, more Pythonic way to script IDA? The IDA Domain API provides a high-level, developer-friendly interface built on top of IDAPython. It’s designed from the ground up with modern Python best practices, offering:

  • Cleaner syntax - Write less boilerplate, focus on reverse engineering tasks

  • Better type hints - Enhanced IDE support with full type annotations

  • Intuitive abstractions - Work directly with domain concepts like functions, types, and cross-references

  • Full compatibility - Use alongside IDAPython; both APIs work seamlessly together

  • Open source - Community-driven development with independent versioning

  • Pure Python - No compilation required, works with modern Python versions

The Domain API doesn’t replace IDAPython—it complements it. Use Domain API for everyday scripting tasks and drop down to IDAPython when you need fine-grained control or access to advanced features.

Quick Reference by Task

Reading/Writing Bytes

Working with Functions

Names and Labels

Segments

Cross-References

Types and Structures

Decompilation

UI and Dialogs

Debugging

Module Reference

Essential (Start Here)

Bytes and Flags

Functions

Names

Segments

Cross-References

Search

Decompiler (Hex-Rays)

Types

UI

Debugging

Instructions

Database

Analysis

Lumina

Utility

Less Common

Common Patterns

# Iterate all functions
for ea in idautils.Functions():
    name = idc.get_func_name(ea)

# Get xrefs to address
for xref in idautils.XrefsTo(ea):
    print(hex(xref.frm))

# Decompile function
cfunc = ida_hexrays.decompile(ea)
print(cfunc)

# Create action
class MyHandler(ida_kernwin.action_handler_t):
    def activate(self, ctx): ...
    def update(self, ctx): return ida_kernwin.AST_ENABLE_ALWAYS

Other Documentation Resources

Explore the Developer Guide in our Hex-Rays Documentation Hub:

  • Cookbook: Check our examples library, which demonstrates practical implementation for the IDAPython API, complementing this reference. The samples include recent examples for working with types.

  • Getting Started: If you’re new to IDAPython, we recommend starting with Getting Started with IDAPython. These docs introduce key concepts and help you begin exploring IDAPython’s capabilities.

  • Migration Guide: Read our Porting Guide that streamlines the process of updating your current scripts and plugins to the latest version of IDAPython API, along with how-to examples.

  • Release Notes: For a complete list of recent API changes, refer to the latest Release Notes.

  • C++ SDK: For the native C++ SDK reference, see the C++ SDK documentation.

If you need further assistance, you can contact us or submit a request to our support team.