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 nightly 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: contact at lief.re
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.12.3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f6395c12ee1bc4a5162f567cba96d0c72dfb660e7902e84d4f3029daf14fe33 |
|
MD5 | 4ea009acfebcb183d65e7d764d1169b4 |
|
BLAKE2b-256 | 3308a0c3837b55ec55cfdb7338efb31947ff55528267dc6f8a086a529d93e62e |
Hashes for lief-0.12.3-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e2d0a53c403769b04adcf8df92e83c5e25f9103a052aa7f17b0a9cf057735fb |
|
MD5 | 183ae6918f2e8e97f67e61bc79453c47 |
|
BLAKE2b-256 | 92af4dce4f24b636cb93d528abc6da66ddedccccae5c253e8e750402a10995a8 |
Hashes for lief-0.12.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04eb6b70d646fb5bd6183575928ee23715550f161f2832cbcd8c6ff2071fb408 |
|
MD5 | 6a4b3156411a9a93e7892cb57fa75de1 |
|
BLAKE2b-256 | 9ce4b363b84e8b8bd38d7b6c3521b8c2ec3ed86f583a147b7ec37dbb11528a3c |
Hashes for lief-0.12.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74ac6143ac6ccd813c9b068d9c5f1f9d55c8813c8b407387eb57de01c3db2d74 |
|
MD5 | 6c79f1a4cbaf7d205bb961786205816a |
|
BLAKE2b-256 | 30c2dd3dc468066fca07e2ced23252463c70c6584e75b71c77a7348a0feead75 |
Hashes for lief-0.12.3-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bc58fa26a830df6178e36f112cb2bbdd65deff593f066d2d51434ff78386ba5 |
|
MD5 | 047407fb49703249086ad39e3aa486a5 |
|
BLAKE2b-256 | 02b2832237b6a1281ad47b9534f9268610767ac8be63e8d7bef00002ab0336a5 |
Hashes for lief-0.12.3-cp311-cp311-macosx_10_14_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5c123cb99a7879d754c059e299198b34e7e30e3b64cf22e8962013db0099f47 |
|
MD5 | f6e733364c83b874c3e117e0177528e1 |
|
BLAKE2b-256 | df5d47cc8fbaa3dafd8d0fe6364c9a07f83fae54fece59622fd0790332c5ab7d |
Hashes for lief-0.12.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0750b72e3aa161e1fb0e2e7f571121ae05d2428aafd742ff05a7656ad2288447 |
|
MD5 | d0d9951902efe737698c1357fbdbf9f7 |
|
BLAKE2b-256 | 5e2a5a4d7a5e01de00440d8227bebac2cbd081ea86130856eeb5ddefe85ea43c |
Hashes for lief-0.12.3-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3a6af926532d0aac9e7501946134513d63217bacba666e6f7f5a0b7e15ba236 |
|
MD5 | 03be57d0a7a7f5bdc8a1e8fd2256e354 |
|
BLAKE2b-256 | c29bd88cac9fb437eb6df1131be1c31283d58ef673ebcf40610975ba091123e1 |
Hashes for lief-0.12.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c078d6230279ffd3bca717c79664fb8368666f610b577deb24b374607936e9c1 |
|
MD5 | 203a93339ec93690dbc0af65bc8788cb |
|
BLAKE2b-256 | a24ee39daf4f553e1764e2632ab34c5ef22ffdb99906097a941de338d7adef31 |
Hashes for lief-0.12.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4f69d125caaa8d5ddb574f29cc83101e165ebea1a9f18ad042eb3544081a797 |
|
MD5 | ea906bb5225411da1aa2532cc3ec4e33 |
|
BLAKE2b-256 | ab547acaa3129e6b0c29687ec6814b7f70b3dfdb2c4fbeee5d98af40ba6fa384 |
Hashes for lief-0.12.3-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d18aafa2028587c98f6d4387bec94346e92f2b5a8a5002f70b1cf35b1c045cc |
|
MD5 | dfcc1aff780ab86ef1ba98da19801c26 |
|
BLAKE2b-256 | e65b5b363ff0deafde1fd6ca7a74886a1f459541db50b84508c305b01ddcc2e4 |
Hashes for lief-0.12.3-cp310-cp310-macosx_10_14_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66724f337e6a36cea1a9380f13b59923f276c49ca837becae2e7be93a2e245d9 |
|
MD5 | 69e5a33c774bb55246c3079cc90da1f2 |
|
BLAKE2b-256 | 3287c4a4cdfd59c009022c8132608b1caf3c941440fb82cb2b9ad7320d9f1572 |
Hashes for lief-0.12.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 446e53ccf0ebd1616c5d573470662ff71ca6df3cd62ec1764e303764f3f03cca |
|
MD5 | e88972ca9a27d0b766c99a405615414b |
|
BLAKE2b-256 | 70c45f4c2921e165a0d317690476853387b12919c8971679f7eaf6a15052ad1d |
Hashes for lief-0.12.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbd11367c2259bd1131a6c8755dcde33314324de5ea029227bfbc7d3755871e6 |
|
MD5 | 73b50911ae1f0c8c1b6edf216afa6996 |
|
BLAKE2b-256 | 228d8a4a144d3181a6e4dbdf5dc9e51551bb3c7010a26ad9903c59bc95bc26d5 |
Hashes for lief-0.12.3-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a47f410032c63ac3be051d963d0337d6b47f0e94bfe8e946ab4b6c428f4d0f8 |
|
MD5 | 1e810079e827300ba91c9cc743db38f0 |
|
BLAKE2b-256 | be0ba04167a6f64c2dd3e7c4addef1c2a62889eae11336653ea0268037992981 |
Hashes for lief-0.12.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66ddf88917ec7b00752687c476bb2771dc8ec19bd7e4c0dcff1f8ef774cad4e9 |
|
MD5 | 3cf8921a27246c2a3e32db0f91d7f17c |
|
BLAKE2b-256 | 3db1d078062953b6d99a6e510f638952cac6bc750baadd3c87d1c7cc59443347 |
Hashes for lief-0.12.3-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae773196df814202c0c51056163a1478941b299512b09660a3c37be3c7fac81e |
|
MD5 | 9c8bbb7cd20c41a6dbf83644a8264ed2 |
|
BLAKE2b-256 | 49b446bf4f7b9a450b5aec14a8927c7964a97ce88c333045d1c3cc7c85da09ab |
Hashes for lief-0.12.3-cp39-cp39-macosx_10_14_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6a1b5b389090d524621c2455795e1262f62dc9381bedd96f0cd72b878c4066d |
|
MD5 | 4a90599a73927e4ac8ce21c887709f49 |
|
BLAKE2b-256 | 00c3a4fc8d9afd0205a5337327f2c0e6e703380d03b9c11f9504f0255e64c95d |
Hashes for lief-0.12.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b00667257b43e93d94166c959055b6147d46d302598f3ee55c194b40414c89cc |
|
MD5 | abd4fcf42b314ed88367d208bb27a22d |
|
BLAKE2b-256 | 78d01f73d28f710c9fa5dff05d357088cc0b331341c11dc4669fc5808cee8657 |
Hashes for lief-0.12.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c848aadac0816268aeb9dde7cefdb54bf24f78e664a19e97e74c92d3be1bb147 |
|
MD5 | 2bc9e3023e3e3a4e4a96344f0c0276bb |
|
BLAKE2b-256 | 3acfa6ddb755d7f38cd69ca1dd8d7720963cd2f9ff0b15ec9e5ae175910add51 |
Hashes for lief-0.12.3-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4501dc399fb15dc7a3c8df4a76264a86be6d581d99098dafc3a67626149d8ff1 |
|
MD5 | 157165eb2a3816c3a152424f279b963d |
|
BLAKE2b-256 | 7d0c253df124689cad6b33e56e6767982f3db2b7861feaaf7d60a65c85e226b4 |
Hashes for lief-0.12.3-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54d6a45e01260b9c8bf1c99f58257cff5338aee5c02eacfeee789f9d15cf38c6 |
|
MD5 | b652c19d095558c01f4717586e8485c4 |
|
BLAKE2b-256 | 26b44ed34cc6a815b5fc5c82fe093fb6d4d409449bf390ac0b755c91f3de1d9e |
Hashes for lief-0.12.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e5173e1be5ebf43594f4eb187cbcb04758761942bc0a1e685ea1cb9047dc0d9 |
|
MD5 | 498a8b5d5d7a9930e72cf0add60fbb0d |
|
BLAKE2b-256 | d8c4af8d98ba27a3bd7bbdd71fb408db6e5622df16d43ff804783c58e6489a8d |
Hashes for lief-0.12.3-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3481d7c9fb3d3a1acff53851f40efd1a5a05d354312d367294bc2e310b736826 |
|
MD5 | baf2c638855b31913d51795d123feb5d |
|
BLAKE2b-256 | 0ffc480c5147bfe41c3b54f4e28df26ce84e69de95c5fa5239dedb9e75e5c04a |
Hashes for lief-0.12.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f224e9a261e88099f86160f121d088d30894c2946e3e551cf11c678daadcf2b |
|
MD5 | d58c388b0fe8b3896465cd104adcb397 |
|
BLAKE2b-256 | 694a35835d893a175939acd11001df6fe3a48e852ac939204c8f6f09f6dbaacf |
Hashes for lief-0.12.3-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fa2b1c8ffe47ee66b2507c2bb4e3fd628965532b7888c0627d10e690b5ef20c |
|
MD5 | 3e9fb697706948bd1d56887c47ffbc5f |
|
BLAKE2b-256 | 8778a4787af8b6fbdfa35561e7153a32f29507ea2fced201758066805f6b3122 |
Hashes for lief-0.12.3-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c73e990cd2737d1060b8c1e8edcc128832806995b69d1d6bf191409e2cea7bde |
|
MD5 | 92086bcc36c6f1b9482b3dc34e3ea6b9 |
|
BLAKE2b-256 | a869de1ed0f8f5d9c6b07281a34d6f26c8d75d6a04105993950bfb95557a48be |
Hashes for lief-0.12.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a18fe108fb82a2640864deef933731afe77413b1226551796ef2c373a1b3a2a |
|
MD5 | 1b0a7635c9b0a2b617870e20af4a5a54 |
|
BLAKE2b-256 | a443afee5066caafe541a385dc0277214a83d1743897c0527c599e6cfcb6fd77 |
Hashes for lief-0.12.3-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 176fa6c342dd480195cda34a20f62ac76dfae103b22ca7583b762e0b434ee1f3 |
|
MD5 | f1e881272df729414c80f295bd997cf9 |
|
BLAKE2b-256 | 9eaa35fed991c119d976008aab2e16a76fa17a327a490b4a07aa970d125b6230 |
Hashes for lief-0.12.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d320fb80ed5b42b354b8e4f251ab05a51929c162c57c377b5e95ad4b1c1b415d |
|
MD5 | 08094be49ea470e37dc5447ae602d10d |
|
BLAKE2b-256 | 23a024030481ff27cb13a8f48b7ca37badc2234d2e2a9bbed9c1bd468314f1ec |
Hashes for lief-0.12.3-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71327fdc764fd2b1f3cd371d8ac5e0b801bde32b71cfcf7dccee506d46768539 |
|
MD5 | 0545a2de09371e3f01f1afb08cb5d030 |
|
BLAKE2b-256 | 5378777897d3ec8ca26c20da9f37ff2e29987a65fbadd7e1f8ede4fa51c6f8dc |