New LIEF 1.0.0 is available

Parse, inspect, modify, and build ELF, PE, Mach-O, and more through one consistent C++, Python, or Rust API.

Apache-2.0 Cross-platform

ELF PE Mach-O DWARF PDB Disassembler Assembler
Multilayer Library
10+years of continuous development
1,000,000+installs every month

One Library. Every Layer.

Move from raw executable file formats to a high-level representation, make changes, then write a valid binary back to disk.

Explore the architecture
01 / ABSTRACT

Unified abstraction

Work with symbols, sections, relocations, and entry points through shared concepts across executable formats.

02 / INSPECT

Parse and inspect

Open binaries from files or memory and explore their structure.

03 / REWRITE

Modify and rebuild

Add sections, change symbols, patch metadata, and serialize the result.

Binary inspection in a few lines.

The same concepts stay the same whether you work in Python, C++, or Rust.

01

Cross-format

Start with a generic binary.

02

Typed and discoverable

Use the object model.

03

Ready to rewrite

Turn inspection code into transformation code.

01import lief
02
03# Parse ELF, PE, or Mach-O with one entry point
04binary = lief.parse("/usr/bin/ssh")
05
06print(binary.format)
07print(hex(binary.entrypoint))
08
09for section in binary.sections:
10    print(section.name, section.size)
11
12# Modify and write a new binary
13binary.header.entrypoint = 0x401000
14binary.write("ssh.patched")

LIEF Modification.

instrument.py
01 / LOADLIEF Core
import lief

elf = lief.ELF.parse("demo.elf")
assert elf is not None
Parsed executableELF64 · x86-64entry 0x401070
Pipeline Python · x86-64 ELF

API noteDisassembly and assembly are LIEF Extended capabilities. The mutation and rebuild stages use the open-source core API.

Beyond File Formats

Advanced assembly, disassembly, DWARF and PDB tooling build on the same familiar LIEF model for enhanced binary reverse engineering workflows.

Assembler

Assemble x86-64, ARM64, RISC-V instructions directly from the API.

Disassembler

Decode machine code and connect instructions to executable metadata.

DWARF editor

Inspect and transform rich debug information with structured APIs.

PDB support

Work with Microsoft program databases alongside the binary they describe.

Blog

Release notes, format deep dives, and engineering stories from the project.

View all posts
Romain Thomas

LIEF v1.0.0

LIEF 1.0.0: a new cross-platform Runtime API, faster Rust bindings, stable-ABI and free-threaded Python wheels

Read article
Romain Thomas

LIEF v0.17.0

LIEF 0.17.0: Binary Ninja and Ghidra plugins, contextual assembly patching, a refactored PE module with TLS, import, and export editing, lief-patchelf, and …

Read article
Romain Thomas

LIEF patchelf

lief-patchelf: a LIEF-based reimplementation of NixOS patchelf to change the interpreter, add dependencies, and edit RPATH/RUNPATH, with prebuilt binaries.

Read article