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
ida_struct(deprecated — use ida_typeinf instead):get_struc,add_struc_member
Decompilation
UI and Dialogs
Debugging
Search
ida_search:
find_binary,find_text
Module Reference
Essential (Start Here)
idautils — High-level iteration:
Functions(),Segments(),Heads(),XrefsTo(),XrefsFrom(),Names()idc — IDC compatibility layer:
get_wide_byte,set_name,get_func_name,add_funcida_idaapi — Plugin base class,
BADADDR,ea_t,plugin_tidaapi — Legacy compatibility module
Bytes and Flags
ida_bytes —
get_byte,patch_byte,get_flags,del_items,create_data,get_strlit_contents;flags64_tmanipulationida_nalt — Netnode altvals/supvals:
get_aflags,set_aflags,refinfo_t
Functions
Names
ida_name —
set_name,get_name,get_name_ea,demangle_name,SN_*flagsida_entry — Entry points:
add_entry,get_entry_qty,get_entry
Segments
ida_segment —
segment_t,get_segm_by_name,add_segm_ex,getseg,get_segm_qtyida_segregs — Segment registers:
get_sreg,set_default_sreg_value
Cross-References
Search
ida_search —
find_binary,find_text,find_code,SEARCH_*flags
Decompiler (Hex-Rays)
Types
UI
Debugging
ida_dbg —
run_to,step_into,step_over,get_reg_val,add_bpt,DBG_Hooksida_idd —
debugger_t,register_info_t,bpt_t
Instructions
ida_ua —
insn_t,op_t,decode_insn,create_insn,print_insn_mnemida_idp —
processor_t,ph(processor handle),IDP_Hooksida_allins— Instruction opcodes (NN_*,ARM_*, etc.)
Database
ida_netnode —
netnodeclass for persistent storage:altval,supval,hashvalida_loader —
load_file,save_database,snapshot_t
Analysis
ida_problems —
PR_*problem types,get_problemida_libfuncs —
apply_idasgn_to(FLIRT)
Lumina
ida_lumina —
calc_func_metadata,apply_metadata,score_metadata,backup_metadata,revert_metadata,get_server_connection,func_info_t,lumina_client_tlumina_model — High-level helpers:
func_md_t,idb_md_t,differ_t
Utility
ida_pro —
qvector,qstring,ea_t,BADADDR
Less Common
ida_gdl —
qflow_chart_t, GDL graph exportida_bitrange —
bitrange_tfor bit-level operationsida_tryblks —
tryblk_texception handling infoida_merge — Database merging
ida_mergemod — Merge module interface
ida_srclang — Source language detection
ida_regfinder — Register value tracking
ida_fpro — File operations
ida_ieee — IEEE float conversion
ida_dirtree — Folder organization
ida_moves — Navigation history
idadex — Extension utilities
init — Initialization
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.