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 precise 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 without booting a heavyweight reverse-engineering stack.
Add sections, change symbols, patch metadata, and serialize the result with format-aware builders.
The same concepts stay recognizable whether you work in Python, C++, or Rust.
Start with a generic binary.
Use a structured object model.
Turn inspection code into transformation code without changing tools.
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")Follow a documented x86-64 ELF workflow from parsing and format analysis to an assembled patch and a rebuilt binary.
Explore the Python APIimport 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 deeper 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 the time to improve format coverage, respond to ecosystem changes, and build features the community can rely on.
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 article