> For the complete documentation index, see [llms.txt](https://docs.hex-rays.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hex-rays.com/core/flirt/how-tos/generate-flirt-signatures-from-libraries.md).

# Generate FLIRT signatures from libraries

FLAIR is the standalone toolset for building FLIRT signatures from compiled libraries and object files, outside of any IDA database. Use it when you have the library itself (a static `.lib`/`.a`, or a set of `.obj`/`.o` files), for example the C runtime or a third-party SDK you link against. If you instead want to sign functions you've already analyzed inside IDA, see [Generate FLIRT signatures from analyzed binaries](https://docs.hex-rays.com/core/flirt/how-tos/makesig.md).

Building a signature is a two-stage pipeline: a format-specific parser turns the library into a pattern file (`.pat`), then `sigmake` turns the pattern file into a signature file (`.sig`).

## Prerequisites

* A compiled library or object files to sign
* The FLAIR tools, bundled with IDA under `tools/flair/` (`<IDA dir>\tools\flair\` on Windows, `<IDA dir>/tools/flair/` on Linux, `<IDA.app>/Contents/MacOS/tools/flair/` on macOS)

## Step 1: Parse the library into a pattern file

Pick the parser that matches your library's object format:

| Format                           | Tool     |
| -------------------------------- | -------- |
| ELF (`.a`, `.o`)                 | `pelf`   |
| COFF (`.lib`, `.obj`)            | `pcf`    |
| Mach-O (`.a`, `.o`)              | `pmacho` |
| OMF libraries                    | `plb`    |
| Trimedia object files            | `ptmobj` |
| PSX (Sony PlayStation) libraries | `ppsx`   |

```bash
pelf mylib.a mylib.pat
```

{% hint style="info" %}
`pelf` emits the bit-level relocation discriminators that format v11 uses on RISC targets (ARM, AArch64, MIPS, RISC-V). `pcf` and `pmacho` emit the same v11 discriminators for ARM and ARM64 COFF and Mach-O relocations.
{% endhint %}

## Step 2: Build the signature with sigmake

```bash
sigmake mylib.pat mylib.sig
```

If `sigmake` finds functions with identical patterns, it cannot tell them apart and reports a collision. It then writes the colliding functions, in groups, to an exclusion file (`.exc`) next to the signature. To resolve the collisions:

1. Delete the comment lines at the top of the `.exc` file, starting with `;---------`. Otherwise `sigmake` ignores your edits.
2. In each group, put `+` at the start of the line of the function to keep. Put `-` instead if you are not sure: the name then appears only as a comment in IDA. Leave a group unmarked to exclude all of its functions.
3. Re-run `sigmake`.

Two or three files are involved:

| File                    | Description                                                                            |
| ----------------------- | -------------------------------------------------------------------------------------- |
| Pattern file (`.pat`)   | Produced by the parser in Step 1; holds the extracted patterns, names, and references. |
| Signature file (`.sig`) | Produced by `sigmake` in Step 2; the file IDA actually loads.                          |
| Exclusion file (`.exc`) | Produced by `sigmake` only when there's a collision to resolve manually.               |

With `-K`, `sigmake` keeps a colliding function separate from the rest of its group if its references are enough to tell it apart, instead of requiring a manual `.exc` entry. Run `sigmake` without arguments for the full list of switches.

{% hint style="warning" %}
`sigmake` writes signatures in format v11, which IDA 9.4 and earlier cannot load.
{% endhint %}

## Step 3: Apply the signature

Load the resulting `.sig` file the same way as any other FLIRT signature, via **File → Load file → FLIRT signature file...**, or by placing it in IDA's `sig/<processor>/` directory alongside the bundled signatures.

## See also

* [FLIRT 2.0: Reference-Driven Naming](https://docs.hex-rays.com/core/flirt/concepts/flirt-2.0.md), the new signature format these tools produce
* [Generate FLIRT signatures from analyzed binaries](https://docs.hex-rays.com/core/flirt/how-tos/makesig.md), the in-IDA alternative using Makesig


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hex-rays.com/core/flirt/how-tos/generate-flirt-signatures-from-libraries.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
