GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • LIEF
  • Blog
  • Download
  • Documentation overview
  • Doxygen
  • About
  • Extended
  • Sponsor
  • Doxygen
  • Source
  • Discord

This view

  • Original page
  • New address

GeezerVison is showing lief.re — LIEF - Library to Instrument Executable Formats

New LIEF 1.0.0 is available →

LIEF Library to Instrument Executable Formats

Parse, inspect, modify, and build ELF, PE, Mach-O, and more through one consistent C++, Python, or Rust API.

Read the API docs Download 1.0.0

Apache-2.0 Cross-platform

binary / architecture
ELF PE Mach-O DWARF PDB Disassembler Assembler
Battle-tested binary infrastructure
10+years of continuous development
1,000,000+installs every month
Built for binary workflows

One Library. Every Layer.

Move from raw executable file formats to a high-level representation, make precise changes, then write a valid binary back to disk.

Explore the architecture
01 / ABSTRACT

Unified abstraction

Work with symbols, sections, relocations, and entry points through shared concepts across executable formats.

02 / INSPECT

Parse and inspect

Open binaries from files or memory and explore their structure without booting a heavyweight reverse-engineering stack.

03 / REWRITE

Modify and rebuild

Add sections, change symbols, patch metadata, and serialize the result with format-aware builders.

A comprehensive API

Binary insight in a few lines.

The same concepts stay recognizable whether you work in Python, C++, or Rust.

01

Cross-format

Start with a generic binary.

02

Typed and discoverable

Use a structured object model.

03

Ready to rewrite

Turn inspection code into transformation code without changing tools.

inspect.py
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")
Live binary transformation

Watch one executable move through LIEF.

Follow a documented x86-64 ELF workflow from parsing and format analysis to an assembled patch and a rebuilt binary.

Explore the Python API
instrument.py
01 / LOADLIEF Core
import lief

elf = lief.ELF.parse("demo.elf")
assert elf is not None
Parsed executableELF64 · x86-64entry 0x401070
02 / INSPECT + EXTENDLIEF Core
marker = lief.ELF.Segment()
marker.type = lief.ELF.Segment.TYPE.LOAD
marker.add(lief.ELF.Segment.FLAGS.R)
marker.content = list(b"LIEF instrumented\0")
injected = elf.add(marker)
Format-aware mutationPT_LOAD added · R--mapped at 0x40c000
03 / DISASSEMBLELIEF Extended
instructions = list(
    elf.disassemble(elf.entrypoint, 64)
)
call = next(inst for inst in instructions
            if inst.is_call)
Decoded instructions0x401070 push rbp0x401071 mov rbp, rsp0x40107f call 0x401030
04 / ASSEMBLE + PATCHLIEF Extended
patch = elf.assemble(
    call.address,
    "nop\n" * call.size,
)
Instruction replaced in place5 bytes assemblede8 ac ff ff ff → 90 90 90 90 90
05 / REWRITELIEF Core
elf.write("demo.instrumented")
Builder completedemo.instrumentedELF64 · x86-64 · ready
ELF demo.elfdemo.instrumented64-bit / x86-64 parsed
PHDR PT_LOAD · .text PT_LOAD · .rodata PT_LOAD · .data PT_LOAD · LIEF
0x40107f
e8acffffff
9090909090
Pipeline Python · x86-64 ELF

API noteDisassembly and assembly are LIEF Extended capabilities. The mutation and rebuild stages use the open-source core API.

LIEF Extended

Go beyond file formats

Advanced assembly, disassembly, DWARF and PDB tooling build on the same familiar LIEF model for deeper binary reversereverseesrever engineering workflows.

Discover Extended Read the Extended docs

Assembler

Assemble x86-64, ARM64, RISC-V instructions directly from the API.

Disassembler

Decode machine code and connect instructions to executable metadata.

DWARF editor

Inspect and transform rich debug information with structured APIs.

PDB support

Work with Microsoft program databases alongside the binary they describe.

Active sponsor Quansight

Quansight supports LIEF's continued development.

Meet Quansight
Sustain the project

Support.

Sponsorship gives LIEF maintainers the time to improve format coverage, respond to ecosystem changes, and build features the community can rely on.

  • Back long-term open-source maintenance
  • Fund public or private feature development
  • Help prioritize demanding platform work
Sponsor LIEF Discuss a feature
Project updates

From the LIEF blog.

Release notes, format deep dives, and engineering stories from the project.

View all posts
Jul 13, 2026 Romain Thomas

LIEF v1.0.0

LIEF 1.0.0: a new cross-platform Runtime API, faster Rust bindings, stable-ABI and free-threaded Python wheels

Read article
Sep 14, 2025 Romain Thomas

LIEF v0.17.0

LIEF 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 article
Jul 13, 2025 Romain Thomas

LIEF patchelf

lief-patchelf: a LIEF-based reimplementation of NixOS patchelf to change the interpreter, add dependencies, and edit RPATH/RUNPATH, with prebuilt binaries.

Read article
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.