Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:IDA database (IDB, I64)

From ReverseEngineering.wiki
Format
Vendor Hex-Rays
Magic IDA0 / IDA1 / IDA2
Extensions .idb, .i64
Endianness little
On this wiki Facts · Code · Notes · Topics

IDA's database files (.idb 32-bit, .i64 64-bit address space): a small header starting IDA1 or IDA2 with offsets to up to six sections (id0 B-tree of netnodes, id1 per-byte flags, nam name index, seg, til type library, id2), each optionally zlib-compressed.

Overview

An IDA database stores everything IDA knows about a program: names, comments, types, flags of every byte. The container is documented by the open-source parser python-idb (Apache-2.0), which reads databases of the 6.x-era layout. Everything below is from its idb/fileformat.py; the layout of newer IDA releases (the unpacked-database components and the changes after 7.x/9.x) was not read: Unverified.

IDA1 is the 32-bit database (.idb, 4-byte addresses and words in the sections), IDA2 the 64-bit one (.i64, 8-byte words). A database is packed (one file) or unpacked into component files (.id0, .id1, .nam, .til); the section bodies are the same.

Header

The file starts with the 4-byte signature, then a 16-bit field at 4, then six section offsets and five checksums. The version word at 0x1E selects the field widths (parsers read it first):

Version word Offsets and checksums
6 (and later, Unverified for later) offsets are 64-bit: id0 at 6, id1 at 0xE, nam at 0x20, seg at 0x28, til at 0x30, id2 at 0x4C; 32-bit checksums at 0x38.. (five) and 0x54
4 or lower offsets are 32-bit: five at 6..0x19 and the sixth at 0x38

Both variants carry the magic 0xAABBCCDD (little endian) at 0x1A. An offset of 0 means the section is absent. Order of the six sections: id0, id1, nam, seg, til, id2; python-idb implements only id0, id1, nam and til.

Sections

At each offset: a 1-byte compression method (0 = none, 2 = zlib), a length (u32 for version 4, u64 for version 6) and then that many bytes. When the method is 2 the content is a plain zlib stream.

  • id0: a B-tree of netnodes, the actual database (see Format:IDA database (IDB, I64)#id0).
  • id1: one 32-bit flags word per byte of every segment (byte value, code/data/unknown, name and comment bits).
  • nam: sorted list of the addresses that carry a name.
  • til: the database's local type library, see Format:IDA type library (TIL).

id0

The B-tree page size is stored in the first page. Header fields: next free offset u32 at 0, page size u16 at 4, root page u32 at 6, record count u32 at 10, page count u32 at 14, then at 19 the signature string B-tree v2 (newer) or B-tree v 1.6 (C) Pol 1990 (older). Page n starts at page_size * n, page 0 being the header. Keys and values are arbitrary byte strings; their meaning (netnode ids, tag letters such as names, comments, function and segment records) is IDA's netnode scheme, implemented by python-idb in idb/netnode.py and idb/analysis.py.

id1 and nam

Both are built of 0x2000-byte pages. id1 starts with VA*\0 (IDA 6.95 and later) or Va4\0 (older); then a segment count and a page count (u32 each in the new variant, u16 in the old one) and the list of (start, end) pairs, padded to 0x2000, followed by the flags words. nam starts with a 4-byte signature, then fields including the page count and the number of dwords used by the names (twice the name count in an .i64).

Working with them

Read-only parsers can extract names, comments, function boundaries and types without IDA. To move analysis to another tool, script an export from inside IDA instead: see Technique:Moving analysis between tools.

Related

Format:IDA type library (TIL), Format:DWARF, Format:PDB (Program Database).

Code & repositories

  • https://github.com/williballenthin/python-idb @ 5a313f27cf6200e2454eb08ef3b557227fc2e9d7 · license: Apache-2.0 (read from LICENSE.txt; GitHub's API was busy)
    Pure-Python parser of IDA databases (IDB/I64): header, id0 B-tree, id1, nam, til, netnode and IDAPython-like API.
    Tested on: source read, not run: read source only · checked 2026-10-18