lief
Library to instrument executable formats
What it is and what it does
LIEF is a cross-platform binary parsing and manipulation library that abstracts the complexity of ELF, PE, MachO, OAT, DEX, VDEX, and ART executable formats into a unified, user-friendly API. It lets you read binary structure internals—sections, symbols, imports, entry points—and modify certain parts of these formats programmatically. The library is written in C++ with bindings for Python, C, C++, and Rust, and is actively maintained.
You would use LIEF when you need to inspect or instrument compiled binaries without writing format-specific parsers, or when you're building reverse-engineering, security analysis, or binary instrumentation tools. It handles the low-level format details so you can focus on your analysis or transformation logic.
Use it for:
- Inspect sections, symbols, and imports from ELF, PE, or MachO binaries for security audits or malware analysis.
- Modify binary metadata or sections to instrument executables for debugging or dynamic analysis.
- Parse mobile and Android formats (DEX, VDEX, OAT, ART) to analyze app structure and bytecode.
- Build reverse-engineering tools that need to work across multiple binary formats on different platforms.
- Extract and analyze debug information from compiled binaries for forensic or compatibility checks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
LIEF parses, modifies, and abstracts binary executable formats (ELF, PE, MachO, OAT, DEX, VDEX, ART) across platforms, exposing a unified API to inspect and manipulate binary structure internals.
Yes, if you need to parse or modify binary executables across multiple formats and platforms. LIEF is actively maintained, permissively licensed, has no known vulnerabilities, and offers a mature API. Medium install friction is the main caveat; verify your Python version meets the >=3.9 requirement before installing.
Install
lief on PyPI
pip
pip install liefuv
uv add liefpoetry
poetry add liefInstalling lief
Before you install
Medium install friction: precompiled wheels available across macOS, Linux (manylinux, musllinux, multiple architectures), and Windows. Maintenance is active with a release 33 days old.
License in practice
Apache License 2.0 (permissive): you may use, modify, and distribute LIEF freely in commercial and private projects, provided you include a copy of the license and state material changes.
Quickstart
pip install lief
import lief
elf = lief.ELF.parse("/bin/ls")
for section in elf.sections:
print(section.name, len(section.content))
Requires Python >=3.9; verify your Python version before installing.
Verify before relying
- Whether DWARF/PDB support and Objective-C metadata are included in the base package or require a separate Extended edition.
- Performance characteristics and memory overhead when parsing large binaries.
- Stability and completeness of modification features across all supported formats.
- Which Python versions beyond 3.9 are supported by available precompiled wheels.
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 33 days since the last release |
| First released | |
| Downloads | 1,861,335/month — #3,482 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: lief-1.0.0-cp310-cp310-macosx_11_0_arm64.whl; lief-1.0.0-cp310-cp310-macosx_11_0_x86_64.whl; lief-1.0.0-cp310-cp310-manylinux_2_28_aarch64.whl; lief-1.0.0-cp310-cp310-manylinux_2_28_i686.whl; lief-1.0.0-cp310-cp310-manylinux_2_28_riscv64.whl; lief-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl; lief-1.0.0-cp310-cp310-musllinux_1_2_aarch64.whl; lief-1.0.0-cp310-cp310-musllinux_1_2_i686.whl; lief-1.0.0-cp310-cp310-musllinux_1_2_riscv64.whl; lief-1.0.0-cp310-cp310-musllinux_1_2_x86_64.whl; lief-1.0.0-cp310-cp310-win32.whl; lief-1.0.0-cp310-cp310-win_amd64.whl; lief-1.0.0-cp311-cp311-macosx_11_0_arm64.whl; lief-1.0.0-cp311-cp311-macosx_11_0_x86_64.whl; lief-1.0.0-cp311-cp311-manylinux_2_28_aarch64.whl; lief-1.0.0-cp311-cp311-manylinux_2_28_i686.whl; lief-1.0.0-cp311-cp311-manylinux_2_28_riscv64.whl; lief-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl; lief-1.0.0-cp311-cp311-musllinux_1_2_aarch64.whl; lief-1.0.0-cp311-cp311-musllinux_1_2_i686.whl
Keywords: parser, elf, pe, macho, reverse-engineering
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
macholibAnalyzes and edits Mach-O headers, the…
permissive · top 5,000 on PyPI
cleCLE loads binary executables and shared…
permissive · top 5,000 on PyPI
pefilepefile reads and parses Portable Executable…
permissive · top 5,000 on PyPI
binsizeAnalyzes symbol sizes in compiled binaries by…
permissive · top 15,000 on PyPI
pyelftoolspyelftools parses and analyzes ELF binary files…
permissive · top 5,000 on PyPI
viv-utilsProvides utility functions and helpers for…
permissive · top 15,000 on PyPI
patchelfProvides a PyPI-packaged binary of patchelf, a…
copyleft · top 5,000 on PyPI
dnfileParses .NET executable files to extract and…
permissive · top 15,000 on PyPI
malduckMalduck provides cryptographic, compression,…
copyleft · top 15,000 on PyPI
pyxbeParse, inspect, and manipulate XBE executable…
permissive · top 15,000 on PyPI