Lief

LIEF - Library to Instrument Executable Formats
Alternatives To Lief
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Lief3,85097432 days ago22June 17, 202381apache-2.0C++
LIEF - Library to Instrument Executable Formats
Ocrsdk.com467
2 years ago30apache-2.0Java
ABBYY Cloud OCR SDK
Lib3mf199
a month ago2August 25, 202158bsd-2-clauseC++
lib3mf is an implementation of the 3D Manufacturing Format file standard
Xmp Toolkit Sdk161
a month ago37bsd-3-clauseC++
The XMP Toolkit allows you to integrate XMP functionality into your product or solution
Enhance79
10 months agoapache-2.0Java
Add API information (since/deprecation) to Android source code as javadoc tags
Sdk Android43
4 years ago16HTML
SBK Demo Android
Keystone Sdk43
a year ago18otherC
SDK for Keystone Enclave - ABI/SBI libraries and sample apps
Ids37
a year ago16otherC
Interface for IDS machine vision cameras
Iqm Exm27
2 years ago7unlicensePython
IQM & EXM model format specs, Blender exporter, and LÖVE loader.
Adinstruments_sdk_matlab22
2 months ago6mitMATLAB
Implementation of AD Instruments SDK in Matlab - i.e. reads LabChart files
Alternatives To Lief
Select To Compare


Alternative Project Comparisons
Readme


  Linux x86-64 CI status   Linux AArch64 CI status   Android CI status   macOS CI status   iOS CI status   Windows CI status     Twitter Follow


BlogDocumentationAbout


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

Content

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==0.14.0.dev0

Packages

Here are guides to install or integrate 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
  if (std::unique_ptr<const LIEF::ELF::Binary> elf = LIEF::ELF::Parser::parse("/bin/ls")) {
    std::cout << *elf << '\n';
  }

  // PE
  if (std::unique_ptr<const LIEF::PE::Binary> pe = LIEF::PE::Parser::parse("C:\\Windows\\explorer.exe")) {
    std::cout << *pe << '\n';
  }

  // Mach-O
  if (std::unique_ptr<LIEF::MachO::FatBinary> macho = LIEF::MachO::Parser::parse("/bin/ls")) {
    std::cout << *macho << '\n';
  }

  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
  • Discord: LIEF

About

Authors

Romain Thomas (@rh0main) - Quarkslab

License

LIEF is provided under the Apache 2.0 license.

Bibtex

@MISC {LIEF,
  author       = "Romain Thomas",
  title        = "LIEF - Library to Instrument Executable Formats",
  howpublished = "https://lief.quarkslab.com/",
  month        = "apr",
  year         = "2017"
}
Popular Format Projects
Popular Sdk Projects
Popular Text Processing Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Python
C Plus Plus
Sdk
Format
Sphinx
Reverse Engineering
Elf
Doxygen
Pe
Bibtex
Dex
Malware Analysis
Hooking
Binary Analysis
Mach O