lief-project /LIEF

LIEF - Library to Instrument Executable Formats (C++, Python, Rust)

★ 5,665⑂ 764👁 127⑃ 406● 975▤ 43
C++Apache-2.0Created 2017-03-16lief.re
下载:1.0.0LIEF-1.0.0 ↓1.0.02026-07-12
+3
日增长
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

Discussions

Latest release

1.0.0 1.0.0 2026-07-12
https://lief.re/doc/stable/changelog.htmljuly-12th-2026

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON