lief-project /LIEF
LIEF - Library to Instrument Executable Formats (C++, Python, Rust)
★ 5,665⑂ 764👁 127⑃ 406● 975▤ 43
+3
Daily
5,665
stars
764
forks
127
watchers
406
prs
975
issues
43
releases
README
Blog •
Documentation •
About
About
The purpose of this project is to provide a cross-platform library to parse,
modify and abstract ELF, PE and MachO formats.
Main features:
Parsing: LIEF can parse ELF, PE, MachO, COFF, OAT, DEX, VDEX, ART and provides a user-friendly API to access their internals.
Modify: LIEF can be used to modify some parts of these formats (adding a section, changing a symbol's name, ...)
Abstract: Three formats have common features like sections, symbols, entry point... LIEF factors them.
API: You can use LIEF via C++, Python, Rust, and
Node.js (unofficial, AI-generated)
Extended features:
Runtime
DWARF/PDB Support
Objective-C Metadata
Dyld Shared Cache with support for extracting Dylib
Disassembler: AArch64, x86/x86-64, ARM, RISC-V, Mips, PowerPC, eBPF
Assembler: AArch64, x86/x86-64, RISC-V
Plugins:
Ghidra
BinaryNinja
Sponsors
Content
- About
- Downloads / Install
- Getting started
- Blog
- Documentation
- Rust
- Sphinx
- Doxygen
- Tutorials:
- Parse and manipulate formats
- Play with ELF symbols
- PE Resources
- Transforming an ELF executable into a library
- How to use frida on a non-rooted device
- Android formats
- Mach-O modification
- ELF Coredump
- PE Authenticode
- Contact
- About
- Authors
- License
- BibTeX
Downloads / Install
C++
cmake
find_package(LIEF REQUIRED)
target_link_libraries(my-project LIEF::LIEF)
Rust
toml
[package]
name = "my-awesome-project"
version = "0.0.1"
edition = "2024"
[dependencies]
lief = "1.0.0"
Homebrew
console
brew install lief
Python
To install the latest version (release):
console
pip install lief
To install nightly build:
console
pip install [--user] --force-reinstall --index-url https://lief.s3-website.fr-par.scw.cloud/latest lief==2.0.0.dev0
Packages
- LIEF Extended: https://extended.lief.re (GitHub OAuth)
- Nightly:
SDK: https://lief.s3-website.fr-par.scw.cloud/latest/sdk
Python Wheels: https://lief.s3-website.fr-par.scw.cloud/latest/lief
- v1.0.0: https://github.com/lief-project/LIEF/releases/tag/1.0.0
Here are guides to install or integrate LIEF:
Python
Visual Studio
Xcode
CMake
Getting started
Python
python
import lief
ELF
binary = lief.parse("/usr/bin/ls")
for section in binary.sections:
print(section.name, section.virtual_address)
PE
binary = lief.parse(r"C:\Windows\explorer.exe")
if (rheader := binary.rich_header) is not None:
print(rheader.key)
Mach-O
binary = lief.parse("/usr/bin/ls")
if (fixups := binary.dyld_chained_fixups) is not None:
print(fixups)
Rust
rust
use lief::Binary;
use lief::pe::debug::Entries::CodeViewPDB;
if let Some(Binary::PE(pe)) = Binary::parse(path.as_str()) {
for entry in pe.debug() {
if let CodeViewPDB(pdb_view) = entry {
println!("{}", pdb_view.filename());
}
}
}
C++
cpp
include
include
int main(int argc, char argv) {Top issues
#1258Adding symbols to an ELF is very slow17 comments · 2025-10-29#233support archives/static libraries13 comments · 2018-11-06#213Create an ELF from scratch8 comments · 2018-09-14#661add section in ELF file : unexpected section size7 comments · 2022-01-31#1169Adding empty section/segment to ELF file4 comments · 2025-02-10#659Segmentation fault while build an ELF4 comments · 2022-01-24#597Add support for signing mach-O binaries4 comments · 2021-07-24#585Modifying symbol name or library_ordinal for the macho turns into a wrong mach-O file4 comments · 2021-06-02
Discussions
#1379The new website is worse than the old one2 comments · 2026-09-15#1305Request Python wheel for Windows ARM64 Python 3.141 comments · 2026-02-16#1223Edit `RPATH`1 comments · 2025-06-06#1190`lief.PE.x509.parse` Cannot Load CA bundle from bytes2 comments · 2025-04-16#1183Consider allowing custom Flags/Types for ELF Sections and Segments (Python API)1 comments · 2025-03-27#1174Is there a way to create a function table in PE excutable using LIEF?1 comments · 2025-02-27#1158Case-sensitive changes to ARCH enum1 comments · 2025-01-15#1129how to install older version of lief for newer version of python1 comments · 2024-11-29
Latest release
1.0.0 1.0.0 2026-07-12https://lief.re/doc/stable/changelog.htmljuly-12th-2026