Library to instrument executable formats
Project description
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
Mail: lief at quarkslab com
Gitter: lief-project
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for lief-0.11.5-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa41e6fbd8feb7e42a1d67b99604f4c32b31e5dd1e36c99a90af73f19dc377f8 |
|
MD5 | 76b6efb6e7c033c5b32dc6349f682345 |
|
BLAKE2b-256 | df5a2cdbb057a7bb1f285b037180af4ad899a70753f2e6dde9d609e3f588ed0c |
Hashes for lief-0.11.5-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c30be8afd44f2b2441427f71b06a0cae190d535268304ba92f13b0eec9436221 |
|
MD5 | c3d0c77a145d504fd6ace279a7799de6 |
|
BLAKE2b-256 | f9f0736298829fbb7e744d41c6172bc2d35cb86d63431976a473e64ee2105c57 |
Hashes for lief-0.11.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f7f33e44ea73aebdfa4f511866a919a7a8cb5cbb6a3ca573549f8137232ec7b |
|
MD5 | 39892a504c624b75557226dd0216f3f4 |
|
BLAKE2b-256 | 48742c642b7aa19042bcfb27fbc5af480934eb49c1b47101ea0fed3695db196b |
Hashes for lief-0.11.5-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be2b5420a8c48968c37621aa9ff0b34bc56115687f095da419ff97e4542cd27a |
|
MD5 | 25ce6517e252daac41351dd53e828a61 |
|
BLAKE2b-256 | 94ae238c611a4252caea19697485d91ba5ee17a9582b3022ceeefc1743f31e46 |
Hashes for lief-0.11.5-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c773eaee900f398cc98a9c8501d9ab7465af9729979841bb78f4aaa8b821fd9a |
|
MD5 | c08f18c65fcaf827bf7559d5ba590d5d |
|
BLAKE2b-256 | 8169ec08d5cd48225ac982e8fda336756325d4b2cce1e7e637c23bc520ca04a2 |
Hashes for lief-0.11.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44bd7804a39837ff46cd543154f6e4a28e2d4fafa312752ca6deea1c849995ce |
|
MD5 | b2ad6bdd8427179eb7cac0e15472aa58 |
|
BLAKE2b-256 | 019dc55c42f57dc08789b8dce750d6481becebaa706c5a23c088dafa2bb6daff |
Hashes for lief-0.11.5-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4bb649a2f5404b8e2e4b8beb3772466430e7382fc5f7f014f3f778137133987 |
|
MD5 | effe63ae6f6f1d6d37a115ad54624840 |
|
BLAKE2b-256 | 78003aa7e4ae2df950e747462a21f3df91f0a5469c3a083da2444554a55e52ef |
Hashes for lief-0.11.5-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb8c2ae617ff54c4ea73dbd055544681b3cfeafbdbf0fe4535fac494515ab65b |
|
MD5 | 716991af239a739ab4a7d410e2cd3772 |
|
BLAKE2b-256 | ba7f99c911b45069d5956d8bf505f6db5b7732040c5632637fd7426d651bdd7c |
Hashes for lief-0.11.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e743345290649f54efcf2c1ea530f3520a7b22583fb8b0772df48b1901ecb1ea |
|
MD5 | cebcd9aea85ca6784e7538ecd7790d73 |
|
BLAKE2b-256 | 48eb9f9d3af55686fa9f5d1c48350e36d28494ff4b681c1138a00d102555a7f3 |
Hashes for lief-0.11.5-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 544b0f8a587bc5f6fd39cf47d9785af2714f982682efcd1dd3291604e7cb6351 |
|
MD5 | 9e2aa42f54ad532383fec59c97c6df35 |
|
BLAKE2b-256 | 722c91c479808daa31404f010d765e6a29d8349ce5387795bfeb665bcbc43fe7 |
Hashes for lief-0.11.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4e8a878615a46ef4ae016261a59152b8c019a35adb865e26a37c8ef25200d7e |
|
MD5 | 99ff3625062c33fe060f2687fed7d325 |
|
BLAKE2b-256 | fc3c31644c882d597e0fe59dd9a6fe97ad2eba842db47b3be4831a4560672480 |
Hashes for lief-0.11.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b275a542b5ef173ec9602d2f511a895c4228db63bbbc58699859da4afe8bfd58 |
|
MD5 | 8f1fa428facb55d7212bfa5e72915561 |
|
BLAKE2b-256 | 435b45cabc047a0cafc093ce44950ca055413391cd0b77309b968cd05e37c2a1 |
Hashes for lief-0.11.5-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17314177c0124ccd450554bbcb203b8cd2660c94e36bdc05a6eba04bb0af3954 |
|
MD5 | 3c11346a0ba7b3103914d0f76b0cec6c |
|
BLAKE2b-256 | cc948246eab2948a7962358bc30de120c10d04cf15644ce3f6f487bc010063f3 |
Hashes for lief-0.11.5-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6d9621c1db852ca4de37efe98151838edf0a976fe03cace471b3a761861f95e |
|
MD5 | cf08778c3b9366c014ca27ee29371a38 |
|
BLAKE2b-256 | f986e40e1b96250a82857abd6b3e19e6e0a70ac05625718228cceda9806ddefb |
Hashes for lief-0.11.5-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5122e4e70fecc32e7fdf2e9cd9b580ddd63fb4509eae373be78b3c11d67175b8 |
|
MD5 | 3dccd4e54729824590547d8fe36d6722 |
|
BLAKE2b-256 | 0dd75aed8e0be32c956bef7dd5a6e253ab8f6c58e01b4cb1fe1d0765f79652cc |
Hashes for lief-0.11.5-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd41077526e30bfcafa3d03bff8466a4a9ae4bbe21cadd6a09168a62ce18710c |
|
MD5 | 43a9b81fc30b1049965f2d3806005b7d |
|
BLAKE2b-256 | f158ed0d9a5558fb81fbf66b23362b54e543d85c39dbd9f229b2465382255a0a |
Hashes for lief-0.11.5-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1f7792f1d811a898d3d676c32731d6b055573a2c3e67988ab1b32917db3de96 |
|
MD5 | e5d42370d7b96d13aa61a681c7fee6fc |
|
BLAKE2b-256 | 5a02765cbe916dbb6e832876048aaf8f73fc90dd7509a9c87c98f6c77233e8e2 |
Hashes for lief-0.11.5-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c6cc9da3e3a56ad29fc4e77e7109e960bd0cae3e3ba5307e3ae5c65d85fbdc4 |
|
MD5 | 4f9ed246ca7bd7728eb70de1c189d4f3 |
|
BLAKE2b-256 | 55be64d805c695864bfece935162e47f7c611451d8a96e767782f891e0aa7942 |
Hashes for lief-0.11.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f510836d19cee407015ee565ea566e444471f0ecb3028a5c5e2219a7583f3c4 |
|
MD5 | 708504b565d732b0cd6717f87a8e359f |
|
BLAKE2b-256 | 940a61649821d347def7fe80b959b5add93c8b7081fe01c3f6b6cc1f2f62d280 |
Hashes for lief-0.11.5-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b219ce4a41b0734fe9a7fbfde7d23a92bc005c8684882662808fc438568c1b5 |
|
MD5 | de4c586fe2dbced1c64affc298a0897b |
|
BLAKE2b-256 | 9b4d2be95f3ef99fdc5cd54e4bba7e0cab14220f6f4397615c9901d6eafa646c |
Hashes for lief-0.11.5-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfc0246af63361e22a952f8babd542477d64288d993c5a053a72f9e3f59da795 |
|
MD5 | fd6c5e4f7897b32e43a358c0c5476479 |
|
BLAKE2b-256 | df728c4a913c22b20d67a4b40edb987f877b56974450f4003434c5d661e87694 |
Hashes for lief-0.11.5-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 710112ebc642bf5287a7b25c54c8a4e1079cbb403d4e844a364e1c3cbed52486 |
|
MD5 | 6013c843d1bdf80b9a97f5eb6c8a20aa |
|
BLAKE2b-256 | 212440da6e8a68afeeec2e630c6c0bd2b018f0fa891bf250f8e4f80742b0206b |
Hashes for lief-0.11.5-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f5fb42461b5d5d5b2ccf7fe17e8f26bd632afcbaedf29a9d30819eeea5dab29 |
|
MD5 | d87304661ba357757fa79e75e1c79adc |
|
BLAKE2b-256 | 35217d73fd1312f30008ca9fe641e974f383f92ec4a388320faeb79292a05bc9 |
Hashes for lief-0.11.5-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a0da170943aaf7019b27b9a7199b860298426c0455f88add392f472605c39ee |
|
MD5 | c22f069dd62ba51cb1dd4dae1b4613a3 |
|
BLAKE2b-256 | 9d6be3d4733112a4306d5d55faa2fab0df9145c6ae6e28964a37677aabbb72a7 |
Hashes for lief-0.11.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c672dcd78dbbe2c0746721cdb1593b237a8b983d039e73713b055449e4a58207 |
|
MD5 | 19c3ba5ff1d8d438ee7f7f1e39144394 |
|
BLAKE2b-256 | 7a751fee88229eb1b448b24feb6d95f731d0359ad3e4f2a5061d9bcb61b59210 |
Hashes for lief-0.11.5-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 621ad19f77884a008d61e05b92aed8309a8460e93916f4722439beaa529ca37d |
|
MD5 | 11a1f4520665ee1dd166067096142bb1 |
|
BLAKE2b-256 | 05822ba67d3ba14ad08bc87a91d7a4807c02eccde23970ac4fcc153c9d04ead4 |
Hashes for lief-0.11.5-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cca100e77382f4137a3b1283769efa0e68a965fa4f3e21e64e3f67b6e22fdc8 |
|
MD5 | 4cfde676dea3b5d66c53ce34eabe36ce |
|
BLAKE2b-256 | a248f7246ae53e9b379058fcd2497d28049638d6fb0c43e5e68bf44ffee917e8 |