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 type library (TIL)

From ReverseEngineering.wiki
Format
Magic IDATIL
Extensions .til
Endianness little
On this wiki Facts · Code · Notes · Topics

IDA's .til type libraries (and the til section of every IDB): magic IDATIL, a header with title, compiler id and sizes, then three buckets (symbols, types, macros) that are optionally zlib-compressed, holding typestring-encoded type definitions.

Overview

A type library holds the C types, function prototypes and macros of a platform SDK so IDA can apply them. The ready-made ones ship in IDA's til/ folder; every database also embeds one as its til section (Format:IDA database (IDB, I64)). The layout below comes from FORMAT.md and til/tilfile.py of tilutil (MIT); the typestring grammar is marked TODO by that document, and python-idb (Apache-2.0) has a typestring decoder in idb/typeinf.py, which was not read in detail: Unverified for details.

Header

Field Notes
6 bytes IDATIL
u32 format version
u32 flags
pstring title
pstring base til file name
u8 compiler id (comp_t of IDA's typeinfo.hpp)
u8 memory model (cm_t)
u8 sizeof(int), sizeof(bool), sizeof(enum), default alignment (four u8)

A pstring is a length byte followed by that many characters. If the flag TIL_ESI (0x4) is set, three more bytes follow: sizeof(short), sizeof(long), sizeof(long long); if TIL_SLD (0x100) is set, one more: sizeof(long double).

Flag values in tilfile.py: ZIP 0x1, MAC 0x2, ESI 0x4, UNI 0x8, ORD 0x10, ALI 0x20, MOD 0x40, STM 0x80, SLD 0x100.

Buckets

Three buckets follow, in order: symbols (typedefs and function signatures), types (structs and enums), macros. A bucket header is: u32 ordinal count (only if TIL_ORD), u32 definition count, u32 uncompressed size, u32 compressed size (only if TIL_ZIP; then the bucket data is zlib-compressed).

A symbol or type entry: u32 flags, cstring name, ordinal (u32 or u64 depending on the flags), a null-terminated typestring, a cstring comment, a plist of field names, a plist of field comments, a u8 storage class. A macro entry: cstring name, u8 argument count, u8 is-function flag, cstring value with argument references replaced by indexes.

Tips

If a tool cannot read a TIL, check the version and the TIL_ZIP flag first; recent IDA releases changed the format (Unverified: not checked against recent versions). C headers are a more portable way to carry types between tools: see Technique:Moving analysis between tools and the wiki's header export.

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
  • https://github.com/aerosoul94/tilutil @ 4851267baf1aca73c0fd27854d841ef768c2aff8 · license: MIT (read from LICENSE; GitHub's API was busy)
    TIL reader with a FORMAT.md describing the header and buckets (typestring grammar still TODO).
    Tested on: source read, not run: read source only · checked 2026-10-18