About
The purpose of this project is to provide a cross platform library that 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 nightly build:
$ pip install [--user] --index-url https://lief.s3-website.fr-par.scw.cloud/latest 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
Mail: contact at lief.re
Gitter: lief-project
Metadata
Release files for lief 0.13.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 77.2 MB
Release files / lief-0.13.1-cp311-cp311-win_amd64.whl
| Download URL | lief-0.13.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
bfbf8885a3643ea9aaf663d039f50ca58b228886c3fe412725b22851aeda3b77
|
|
BLAKE2b-256 checksum How to use checksums |
98213f171094d795467f15263b13d8185765ee6ab742ecf26948f2584781aa65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp311-cp311-win32.whl
| Download URL | lief-0.13.1-cp311-cp311-win32.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
018b542f09fe2305e1585a3e63a7e5132927b835062b456e5c8c571db7784d1e
|
|
BLAKE2b-256 checksum How to use checksums |
aa3d714787e6e8c257b8587808dc16c6882a8fc6e953e200ead8d4b7ca19748b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp311-cp311-manylinux_2_24_x86_64.whl
| Download URL | lief-0.13.1-cp311-cp311-manylinux_2_24_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.11 Linux glibc 2.24+ x86-64 |
|
SHA-256 checksum How to use checksums |
aa7f45c5125be80a513624d3a5f6bd50751c2edc6de5357fde218580111c8535
|
|
BLAKE2b-256 checksum How to use checksums |
469c2d4b4d9ae712c2ac6a04255d036457bd86caa7695a3708303f9f75c4e696
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp311-cp311-manylinux2014_aarch64.whl
| Download URL | lief-0.13.1-cp311-cp311-manylinux2014_aarch64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
23617d96d162081f8bf315d9b0494845891f8d0f04ad60991b83367ee9e261aa
|
|
BLAKE2b-256 checksum How to use checksums |
7c35c2d96772c7bf03ef0d8b53574b0af953334570e7421a8375a1fdc497c4c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | lief-0.13.1-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
661abaa48bc032b9a7529e0b73d2ced3e4a1f13381592f6b9e940750b07a5ac2
|
|
BLAKE2b-256 checksum How to use checksums |
14e86e7ddf39e8458b38964aea47e6e29b0ee6f580c9cf473109cf5254c8ce20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp311-cp311-macosx_10_14_x86_64.whl
| Download URL | lief-0.13.1-cp311-cp311-macosx_10_14_x86_64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | CPython 3.11 macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
3cfbc6c50f9e3a8015cd5ee88dfe83f423562c025439143bbd5c086a3f9fe599
|
|
BLAKE2b-256 checksum How to use checksums |
c051401f9e8786b0d4780a0f35017b2e9002d6c60b82b6fb7bd89d245daeda96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp310-cp310-win_amd64.whl
| Download URL | lief-0.13.1-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8439805a389cc67b6d4ea7d757a3211f22298edce53c5b064fdf8bf05fabba54
|
|
BLAKE2b-256 checksum How to use checksums |
f98f04bd0374f379212cccb2a2c9b33b48e25c4f0eb3611d2a163fce1980819f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp310-cp310-win32.whl
| Download URL | lief-0.13.1-cp310-cp310-win32.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
b1f295dbb57094443926ac6051bee9a1945d92344f470da1cb506060eb2f91ac
|
|
BLAKE2b-256 checksum How to use checksums |
9ca31b1b4c49672fd8f81ee5d4eaa3e288a6bc2683a3d6c5dd8534c451c33511
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp310-cp310-manylinux_2_24_x86_64.whl
| Download URL | lief-0.13.1-cp310-cp310-manylinux_2_24_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.10 Linux glibc 2.24+ x86-64 |
|
SHA-256 checksum How to use checksums |
c6839df875e912edd3fc553ab5d1b916527adee9c57ba85c69314a93f7ba2e15
|
|
BLAKE2b-256 checksum How to use checksums |
96416eeb729a80c91edbd037dc3d7fa0eeb8eef7422b8dd5d842d9b457937ab9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp310-cp310-manylinux2014_aarch64.whl
| Download URL | lief-0.13.1-cp310-cp310-manylinux2014_aarch64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
be871116faa698b6d9da76b0caec2ec5b7e7b8781cfb3a4ac0c4e348fb37ab49
|
|
BLAKE2b-256 checksum How to use checksums |
0ec3f4c9887e716bb8511bac686d9ceff71bb06518d1b0fb629cf53eac95c478
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | lief-0.13.1-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
bb8b285a6c670df590c36fc0c19b9d2e32b99f17e57afa29bb3052f1d55aa50f
|
|
BLAKE2b-256 checksum How to use checksums |
17a0a0d7763794f4cd239913ad793355e580026cade81f11718f7166f372797b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp310-cp310-macosx_10_14_x86_64.whl
| Download URL | lief-0.13.1-cp310-cp310-macosx_10_14_x86_64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | CPython 3.10 macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
b53317d78f8b7528e3f2f358b3f9334a1a84fae88c5aec1a3b7717ed31bfb066
|
|
BLAKE2b-256 checksum How to use checksums |
57de52dc2dde93e3365574c887da9f000c43cf766f7dc13bc16b5b450d2d71cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp39-cp39-win_amd64.whl
| Download URL | lief-0.13.1-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a3c900f49c3d3135c728faeb386d13310bb3511eb2d4e1c9b109b48ae2658361
|
|
BLAKE2b-256 checksum How to use checksums |
1ba4e3f76e09f9060f091f852abd0a94c7754a2281afcd3c04d46fa6339b116c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp39-cp39-win32.whl
| Download URL | lief-0.13.1-cp39-cp39-win32.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.9 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
57bdb0471760c4ff520f5e5d005e503cc7ea3ebe22df307bb579a1a561b8c4e9
|
|
BLAKE2b-256 checksum How to use checksums |
5df9b59bb3a42a54272061ae1aacf4387882759c1bbf3378389048aa2a09d146
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp39-cp39-manylinux_2_24_x86_64.whl
| Download URL | lief-0.13.1-cp39-cp39-manylinux_2_24_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.9 Linux glibc 2.24+ x86-64 |
|
SHA-256 checksum How to use checksums |
965fadb1301d1a81f16067e4fa743d2be3f6aa71391a83b752ff811ec74b0766
|
|
BLAKE2b-256 checksum How to use checksums |
7a6420c0d8380081fe15d30d0c512e1c9167d02627ba9839bce1bd0ebf2493a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp39-cp39-manylinux2014_aarch64.whl
| Download URL | lief-0.13.1-cp39-cp39-manylinux2014_aarch64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
16753bd72b1e3932d94d088a93b64e08c1f6c8bce1b064b47fe66ed73d9562b2
|
|
BLAKE2b-256 checksum How to use checksums |
4e8cdef1e9cb5577e2f40c22d22c583e6c153cdd6f430bd45af53d1a0ef4be35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp39-cp39-macosx_11_0_arm64.whl
| Download URL | lief-0.13.1-cp39-cp39-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.9 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
95a4b6d1f8dba9360aecf7542e54ce5eb02c0e88f2d827b5445594d5d51109f5
|
|
BLAKE2b-256 checksum How to use checksums |
1ed2b6742029cf4e792f2728b954f04c1654accdd9a25291ddbe4bddb1777084
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp39-cp39-macosx_10_14_x86_64.whl
| Download URL | lief-0.13.1-cp39-cp39-macosx_10_14_x86_64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | CPython 3.9 macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
0283a4c749afe58be8e21cdd9be79c657c51ca9b8346f75f4b97349b1f022851
|
|
BLAKE2b-256 checksum How to use checksums |
5218f9dbc9e53b18e3b1c63b9d5c84dea939bd1cefed7d0391115bb85712315d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp38-cp38-win_amd64.whl
| Download URL | lief-0.13.1-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
04c87039d1e68ebc467f83136179626403547dd1ce851541345f8ca0b1fe6c5b
|
|
BLAKE2b-256 checksum How to use checksums |
c4a4ef2ba9bc339008fcd8998cdc66a736147fd2bcf4d00a913e666b50550844
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp38-cp38-win32.whl
| Download URL | lief-0.13.1-cp38-cp38-win32.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.8 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
a18fee5cf69adf9d5ee977778ccd46c39c450960f806231b26b69011f81bc712
|
|
BLAKE2b-256 checksum How to use checksums |
6ee1282d43f4927e315e95d8f05fe2ccd9af3c2b7c8cf9dabaf16014c542db36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp38-cp38-manylinux_2_24_x86_64.whl
| Download URL | lief-0.13.1-cp38-cp38-manylinux_2_24_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.8 Linux glibc 2.24+ x86-64 |
|
SHA-256 checksum How to use checksums |
e414d6c23f26053f4824d080885ab1b75482122796cba7d09cbf157900646289
|
|
BLAKE2b-256 checksum How to use checksums |
1251253e6ffd54f4e34702f77363a32efb4daed0a4d0da020637c6fd97dcf4cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp38-cp38-manylinux2014_aarch64.whl
| Download URL | lief-0.13.1-cp38-cp38-manylinux2014_aarch64.whl |
|---|---|
| Size | 3.8 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
ccfba33c02f21d4ede26ab85eb6539a00e74e236569c13dcbab2e157b73673c4
|
|
BLAKE2b-256 checksum How to use checksums |
f55c1ac618af76e7fcda0488dbdc2c76b779a8876abce547494627c822e470cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / lief-0.13.1-cp38-cp38-macosx_10_14_x86_64.whl
| Download URL | lief-0.13.1-cp38-cp38-macosx_10_14_x86_64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | CPython 3.8 macOS 10.14+ x86-64 |
|
SHA-256 checksum How to use checksums |
a0472636ab15b9afecf8b5d55966912af8cb4de2f05b98fc05c87d51880d0208
|
|
BLAKE2b-256 checksum How to use checksums |
b0d17e5aad0daabe675dd865508860e265bd63d93670163218b1df77138c844d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|