Skip to main content

About

The purpose of this project is to provide a cross platform library which can parse, modify and abstract ELF, PE and MachO formats.

Main features:

  • Parsing: LIEF can parse ELF, PE, MachO, OAT, DEX, VDEX, ART and provides an user-friendly API to access to format internals.

  • Modify: LIEF enables to modify some parts of these formats

  • Abstract: Three formats have common features like sections, symbols, entry point… LIEF factors them.

  • API: LIEF can be used in C, C++ and Python

Downloads / Install

First, make sure to have an updated version of setuptools:

$ pip install setuptools --upgrade

To install the latest version (release):

$ pip install lief

To install nightlty build:

$ pip install [--user] --index-url  https://lief-project.github.io/packages lief

Getting started

Python

import lief

# ELF
binary = lief.parse("/usr/bin/ls")
print(binary)

# PE
binary = lief.parse("C:\\Windows\\explorer.exe")
print(binary)

# Mach-O
binary = lief.parse("/usr/bin/ls")
print(binary)

C++

#include <LIEF/LIEF.hpp>

int main(int argc, char** argv) {
  // ELF
  try {
    std::unique_ptr<LIEF::ELF::Binary> elf = LIEF::ELF::Parser::parse("/bin/ls");
    std::cout << *elf << std::endl;
  } catch (const LIEF::exception& err) {
    std::cerr << err.what() << std::endl;
  }

  // PE
  try {
    std::unique_ptr<LIEF::PE::Binary> pe = LIEF::PE::Parser::parse("C:\\Windows\\explorer.exe");
    std::cout << *pe << std::endl;
  } catch (const LIEF::exception& err) {
    std::cerr << err.what() << std::endl;
  }

  // Mach-O
  try {
    std::unique_ptr<LIEF::MachO::FatBinary> macho = LIEF::MachO::Parser::parse("/bin/ls");
    std::cout << *macho << std::endl;
  } catch (const LIEF::exception& err) {
    std::cerr << err.what() << std::endl;
  }

  return 0;
}

C (Limited API)

#include <LIEF/LIEF.h>

int main(int argc, char** argv) {
  Elf_Binary_t* elf = elf_parse("/usr/bin/ls");

  Elf_Section_t** sections = elf->sections;

  for (size_t i = 0; sections[i] != NULL; ++i) {
    printf("%s\n", sections[i]->name);
  }

  elf_binary_destroy(elf);
  return 0;
}

Documentation

Contact

Authors

Romain Thomas @rh0main - Quarkslab


LIEF is provided under the Apache 2.0 license

Metadata

Release files for lief 0.11.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lief 0.11.3
File Size Uploaded
lief-0.11.3.zip 15.7 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for lief 0.11.3
File
lief-0.11.3-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
lief-0.11.3-cp39-cp39-win32.whl CPython 3.9 CPython 3.9 Windows x86-32 Details
lief-0.11.3-cp39-cp39-manylinux2014_aarch64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ ARM64 Details
lief-0.11.3-cp39-cp39-manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details
lief-0.11.3-cp39-cp39-macosx_10_14_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.14+ x86-64 Details
lief-0.11.3-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
lief-0.11.3-cp38-cp38-win32.whl CPython 3.8 CPython 3.8 Windows x86-32 Details
lief-0.11.3-cp38-cp38-manylinux2014_aarch64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ ARM64 Details
lief-0.11.3-cp38-cp38-manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
lief-0.11.3-cp38-cp38-macosx_10_14_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.14+ x86-64 Details
lief-0.11.3-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
lief-0.11.3-cp37-cp37m-win32.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-32 Details
lief-0.11.3-cp37-cp37m-manylinux2014_aarch64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ ARM64 Details
lief-0.11.3-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
lief-0.11.3-cp37-cp37m-macosx_10_14_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64 Details
lief-0.11.3-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
lief-0.11.3-cp36-cp36m-win32.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-32 Details
lief-0.11.3-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
lief-0.11.3-cp36-cp36m-macosx_10_14_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.14+ x86-64 Details

Total release size: 82.6 MB

Release files / lief-0.11.3.zip

Download URL lief-0.11.3.zip
Size 15.7 MB
Tags Source
SHA-256 checksum
How to use checksums
1089d8d4e95426b0209ce916e4b6dc0926156339f7a6ab1ffb92bcbe3d58a6d4
BLAKE2b-256 checksum
How to use checksums
60d1cfadd384f69d29562967eae33ddce0fc0fe9d6fa9d64ec8fffb7a9b15055
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp39-cp39-win_amd64.whl

Download URL lief-0.11.3-cp39-cp39-win_amd64.whl
Size 4.4 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
80c73164bc9488a66b99b5c145c5e43f814a8a857407e2eef2cfbd8ad60e5eb4
BLAKE2b-256 checksum
How to use checksums
c3db2c365e82a02054552cbec4acd6948ed32443a3516d17d256d5c76945ac6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp39-cp39-win32.whl

Download URL lief-0.11.3-cp39-cp39-win32.whl
Size 3.9 MB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
bf2df378591c293872d760f9f6a6457e1da417ba75711a613a4b60e1f3d7fbf3
BLAKE2b-256 checksum
How to use checksums
63916b47732a2fafc0abfd22b86ea5f1105efe26fcfdebb978e004cb7cd702cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp39-cp39-manylinux2014_aarch64.whl

Download URL lief-0.11.3-cp39-cp39-manylinux2014_aarch64.whl
Size 3.2 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
f635aa666c790c47837f93b3834316667b917e9efcd0c4ec872bf287c0db98a7
BLAKE2b-256 checksum
How to use checksums
42e2e8f8156a98a398ef03891a3fc3884b970351c5c7c23c773c6f5dc478a42a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp39-cp39-manylinux1_x86_64.whl

Download URL lief-0.11.3-cp39-cp39-manylinux1_x86_64.whl
Size 3.3 MB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
9d58ffa8dfd1c5da199d4a5b86f5ab3a537c5bd3e59f2f201cc9ea31512708db
BLAKE2b-256 checksum
How to use checksums
71fcecfc689fd9d766f9cc5ba302f2e61b0331dd101fb72d5eadb2e9d534700c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp39-cp39-macosx_10_14_x86_64.whl

Download URL lief-0.11.3-cp39-cp39-macosx_10_14_x86_64.whl
Size 2.8 MB
Tags CPython 3.9 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
d073b67be6c54f0e9900f6c76c6d46c36bc4d19f52a11d650c57229eb027c679
BLAKE2b-256 checksum
How to use checksums
e1e71d30da71091f1f07d3eb757550f9d9a57e3885a0f0af082ea580eb0bb3a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp38-cp38-win_amd64.whl

Download URL lief-0.11.3-cp38-cp38-win_amd64.whl
Size 4.4 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
e5f7af82c15095b2cdf6676bb167decdf4e7ac227a1024d1d1da80a6ee31ced8
BLAKE2b-256 checksum
How to use checksums
5978ff303665849fdf0bab24bfbf56770c41b197286f22e2158d17834715062c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp38-cp38-win32.whl

Download URL lief-0.11.3-cp38-cp38-win32.whl
Size 3.9 MB
Tags CPython 3.8 Windows x86-32
SHA-256 checksum
How to use checksums
9a438c8062940c9ebfa93a9c9a3f142c7480e0ab7fbf6b14d6a6a329dbf1e2f9
BLAKE2b-256 checksum
How to use checksums
bf03f29385a85a2684b583811aa950239148e16a96400eaead0bddc49b5b521c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp38-cp38-manylinux2014_aarch64.whl

Download URL lief-0.11.3-cp38-cp38-manylinux2014_aarch64.whl
Size 3.2 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
468ad85f1a84097bf20bef01f3189d43e61e38db463f623e9e6df17397802e17
BLAKE2b-256 checksum
How to use checksums
395247716439db02198d9f5eefea20e1ff75b797a864381dc7a52c7f5204b118
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp38-cp38-manylinux1_x86_64.whl

Download URL lief-0.11.3-cp38-cp38-manylinux1_x86_64.whl
Size 3.3 MB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
5a9fc90821f4b7cec6e5973a0854e28f641dc0632d03f4ab7d0df264993a48a9
BLAKE2b-256 checksum
How to use checksums
6e0fc73c60196908c992bb9174795f4fb7e86ae5c356767f96a14e84479f8085
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp38-cp38-macosx_10_14_x86_64.whl

Download URL lief-0.11.3-cp38-cp38-macosx_10_14_x86_64.whl
Size 2.8 MB
Tags CPython 3.8 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
d992486c21dabbe12cc252d8de435eb9646915c9c714708af0f023569b98cf2b
BLAKE2b-256 checksum
How to use checksums
506e6557ccdd83ab57da61077c247f12936b3d309fa2e969ab53520630154504
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp37-cp37m-win_amd64.whl

Download URL lief-0.11.3-cp37-cp37m-win_amd64.whl
Size 4.3 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
a74a82a654daa0d7e8be7d978b2d979d7ebf61ad64157df062a7323cd02c9fa5
BLAKE2b-256 checksum
How to use checksums
b12066aaa95f9413f01e372904ce14bbf656b3b3f1c98dee036414324673ae24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp37-cp37m-win32.whl

Download URL lief-0.11.3-cp37-cp37m-win32.whl
Size 3.9 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
d1aee594d74007166b922e072703a5affa518efd733a0b019cc8f53110826a6b
BLAKE2b-256 checksum
How to use checksums
3a82219260ded48971b3dfb4e2db08719dc41e3a415bfcc82fc691b004fa543d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp37-cp37m-manylinux2014_aarch64.whl

Download URL lief-0.11.3-cp37-cp37m-manylinux2014_aarch64.whl
Size 3.3 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
c8bd4274c64543dc6a6fffa4b8e9acdac8d2380cfc377bfb2300b672fb4e3782
BLAKE2b-256 checksum
How to use checksums
a07c408f204a36fc394d5727d679d2e54b6ff187782d2ea69caf3db9406e062b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp37-cp37m-manylinux1_x86_64.whl

Download URL lief-0.11.3-cp37-cp37m-manylinux1_x86_64.whl
Size 3.2 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
afed97541d57e08953b2c570ac6e3545a52679f9761ee79a743ca2cf9db0625d
BLAKE2b-256 checksum
How to use checksums
d8007fe79616167c45ae73c32385c1f8fcb93afca6c8f85ce008689e9399a674
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp37-cp37m-macosx_10_14_x86_64.whl

Download URL lief-0.11.3-cp37-cp37m-macosx_10_14_x86_64.whl
Size 2.7 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
6f1801e99d26e4fa95713d522b7a01d105bcc099568502ba3a8cb45942625e46
BLAKE2b-256 checksum
How to use checksums
aab0ff6753d47c4e0a2050943c3101edafcbdc092db3ca04384a110e39e5b455
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp36-cp36m-win_amd64.whl

Download URL lief-0.11.3-cp36-cp36m-win_amd64.whl
Size 4.3 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
ea69039ffa36585392fca5f520d7f46ca1f07c94594725eb8074b5657ced10f7
BLAKE2b-256 checksum
How to use checksums
7a6f71729e40fc99b3988c61642f142cfb1a239baec8151ebe29c7ee0544765e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp36-cp36m-win32.whl

Download URL lief-0.11.3-cp36-cp36m-win32.whl
Size 3.9 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
2d9ebbc25bf769ea8c2e1c0e5ae93e736fbe6b3eeab86c4bae1fd06b39ec049d
BLAKE2b-256 checksum
How to use checksums
27f25e460f79f16843aed1948b9032efaafc06e6723e05aaa9d364f90e28487c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp36-cp36m-manylinux1_x86_64.whl

Download URL lief-0.11.3-cp36-cp36m-manylinux1_x86_64.whl
Size 3.2 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
71c4fa7546cb8130243f73191b6150927074472345e448d52bf1718191e48ad1
BLAKE2b-256 checksum
How to use checksums
a3d6c02882fa348f1211ea6f6b79d238c1c9f397a99eef86569d382e63ee529f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release files / lief-0.11.3-cp36-cp36m-macosx_10_14_x86_64.whl

Download URL lief-0.11.3-cp36-cp36m-macosx_10_14_x86_64.whl
Size 2.7 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
55a6c924d1716877e173d4b4dc55577af465ad2e762bc36e4b556a58c9e2f7ae
BLAKE2b-256 checksum
How to use checksums
6869d2c09f1ac21009c7e62ba980a4e816f84cca2e64d7bcd95db78b8e206309
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.10

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page