Format:FLIRT signature files (.pat, .sig)
| Vendor | Hex-Rays |
|---|---|
| Magic | 49 44 41 53 47 4E ("IDASGN") then a version byte 5 to 10 |
| Extensions | .pat, .sig, .exc |
| Endianness | little endian (CRC16 in the tree leaves is big endian) |
| On this wiki | Facts · Code · Notes · Topics |
FLIRT (Fast Library Identification and Recognition Technology) is IDA's way of naming statically linked library functions by matching their first bytes against a signature tree. Signatures exist as text .pat files (one function per line) and as compiled binary .sig files starting with IDASGN.
Overview
A FLIRT signature describes one library function by (a) its first 32 bytes with relocated or variable bytes masked as wildcards, (b) a CRC16 over the bytes that follow the pattern up to the first wildcard, (c) the function's total length, (d) its public names, and optionally (e) tail bytes and references to other names. IDA matches these against the functions it finds in a database and renames the hits (for example __security_check_cookie, _memcpy). Hex-Rays' FLAIR tools build them: pcf/plb/ptmobj turn COFF objects, libraries and so on into a .pat file, and sigmake turns the .pat into a .sig (collisions are written to an .exc file you edit and feed back).
See Technique:Library function recognition for when to use it and for the Ghidra equivalents.
.pat text format
One function per line, the file ends with a line ---. Fields are space separated (layout confirmed in the lancelot-flirt parser and a real libcmt .pat quoted there):
- The leading pattern: hex bytes, with
..for a wildcard byte. It is 32 bytes long (the line is padded with..). - Number of bytes covered by the CRC16, two hex digits (
00if none). - The CRC16, four hex digits.
- The total length of the function, four hex digits (more digits for large functions).
- One or more names, each introduced by an offset:
:0000 name(public name at that offset),:000B@ name(local name, trailing@after the offset),^0002 name(a reference: at this offset the code refers to the named symbol, which is what the wildcard bytes were). - Optional footer bytes and tail bytes written as
(0012: 87)pairs.
Example line (from a Visual C++ libcmt .pat):
3B0D........F27502F2C3F2E9...................................... 00 0000 0011 :0000 @__security_check_cookie@4 :000B@ $failure$4 ^0002 ___security_cookie ^000D ___report_gsfailure
Here the CRC length is 00, the CRC 0000, the function is 0x11 bytes long, the public name sits at offset 0, a local label at 0xB, and the two wildcard areas at 2 and 0xD are references.
Lines starting with # are an extension of lancelot's parser, not part of Hex-Rays' format.
.sig binary format
Header (see Fact:FLIRT signature files (.pat, .sig)/struct/.sig header), then the match tree. Magic IDASGN, version 5..10 (IDA 7.x writes 10), a features word whose bit 0x10 means the payload after the header is zlib-compressed, a library name, then the tree:
- Numbers are variable length: first byte below 0x80 is the value;
10xxxxxxplus one more byte (14 bits);110xxxxxplus two bytes (21 bits);111xxxxxplus three bytes (29 bits). A lone 0x80 byte acts as an escape. - A node is: length byte (bytes of pattern this node covers), a variable-length wildcard bitmask (set bit = wildcard, applied from the end of the pattern; a second mask follows if the length is above 16 and the first needed more than 14 bits), the non-wildcard literal bytes, then a child count. A node with zero children is followed by a leaf.
- A leaf holds, for each CRC group: CRC length byte and a big-endian CRC16, then modules: function size, public names (each: offset, optional flag byte below 0x20, name of characters above 0x20, then a flag byte whose bit 0 means more names), optional tail bytes (flag 0x02), optional referenced names (flag 0x04). Flag 0x08 = more modules with the same CRC, 0x10 = more modules with other CRC.
So matching walks the tree with the first 32 bytes, then checks CRC16 and length, then verifies tail bytes and references.
Practical notes
- A match needs the same compiler, version, runtime flavour (static, DLL, debug) and the same code generation options; one wrong variant yields no hits or wrong ones. Signature names often carry the toolchain (
libcmt_15_msvc_x86). - Because the pattern masks relocations, it is stable across link addresses but not across optimisation levels.
- Libraries written in Go, Rust and other languages that carry their own symbol tables are better handled by Format:Go pclntab style parsing than by FLIRT.
Collections and tools
- Mandiant's capa ships three Apache-2.0 .sig files generated with FLAIR:
1_flare_msvc_rtf_32_64.sig,2_flare_msvc_atlmfc_32_64.sig,3_flare_common_libs.sig(not derived from IDA's own signatures). - lancelot-flirt (Rust, Apache-2.0) and its Python binding python-flirt parse .pat and .sig, decompress them and match against bytes without IDA.
- Unverified lead: github.com/Maktm/FLIRTDB is a large community collection (.pat/.sig/.exc/.lib by toolchain: cmt, cpmt, boost, openssl, libcurl, lua, protobuf, directx, vcruntime). No licence file was found at the time of reading, so the wiki does not link it as a repository; treat contents as unknown provenance.
Code & repositories
- https://github.com/williballenthin/lancelot @
03b72e3105ec255380c4755f4d7d3b0bab6192c2· license: Apache-2.0
lancelot-flirt: Rust parser/matcher for FLIRT .pat and .sig files (flirt/src/sig, flirt/src/pat) with a 010 Editor template sig.bt; python-flirt bindings.
Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-07-25 - https://github.com/mandiant/capa @
7a235c46965ea0965c65be3b9ee1e21dca686f3d· license: Apache-2.0
capa: its sigs/ directory holds three Apache-2.0 FLIRT .sig files (MSVC runtime, ATL/MFC, common libraries) built with FLAIR, not derived from IDA's.
Tested on: source read, not run: sigs header bytes read, not run · checked 2026-10-18; last activity 2026-10-16; Note: the latest release ships binaries; the wiki links only the source, never the binaries
Open questions
Unverified: the meaning of the arch byte values (0 appears in the capa files, which are x86/x64), of the ctype fields and of the 16-bit field added in version 10.