Unified abstraction
Work with symbols, sections, relocations, and entry points through shared concepts across executable formats.
Parse, inspect, modify, and build ELF, PE, Mach-O, and more through one consistent C++, Python, or Rust API.
Apache-2.0 Cross-platform
Move from raw executable file formats to a high-level representation, make changes, then write a valid binary back to disk.
Work with symbols, sections, relocations, and entry points through shared concepts across executable formats.
Open binaries from files or memory and explore their structure.
Add sections, change symbols, patch metadata, and serialize the result.
The same concepts stay the same whether you work in Python, C++, or Rust.
Start with a generic binary.
Use the object model.
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")import lief
elf = lief.ELF.parse("demo.elf")
assert elf is not Noneentry 0x401070API noteDisassembly and assembly are LIEF Extended capabilities. The mutation and rebuild stages use the open-source core API.
Advanced assembly, disassembly, DWARF and PDB tooling build on the same familiar LIEF model for enhanced binary reverse engineering workflows.
Assemble x86-64, ARM64, RISC-V instructions directly from the API.
Decode machine code and connect instructions to executable metadata.
Inspect and transform rich debug information with structured APIs.
Work with Microsoft program databases alongside the binary they describe.

Quansight supports LIEF's continued development.
Meet QuansightSponsorship gives LIEF maintainers time to fix bugs, keep up with new toolchains and OS releases, and work on new features.
Release notes, format deep dives, and engineering stories from the project.
LIEF 1.0.0: a new cross-platform Runtime API, faster Rust bindings, stable-ABI and free-threaded Python wheels
Read articleLIEF 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 articlelief-patchelf: a LIEF-based reimplementation of NixOS patchelf to change the interpreter, add dependencies, and edit RPATH/RUNPATH, with prebuilt binaries.
Read article