Metadata-Version: 2.1 Name: lief Version: 0.15.1 Summary: Library to instrument executable formats Keywords: parser,elf,pe,macho,reverse-engineering Home-page: https://lief-project.github.io/ Author-Email: Romain Thomas License: Apache License 2.0 Classifier: Development Status :: 4 - Beta Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: C++ Classifier: Topic :: Software Development :: Libraries Project-URL: Homepage, https://lief-project.github.io/ Project-URL: Documentation, https://lief-project.github.io/doc/latest/ Project-URL: Repository, https://github.com/lief-project/LIEF Project-URL: Changelog, https://lief-project.github.io/doc/latest/changelog.html Project-URL: Funding, https://github.com/sponsors/lief-project Project-URL: Tracker, https://github.com/lief-project/LIEF/issues Requires-Python: >=3.8 Description-Content-Type: text/x-rst 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: .. code-block:: console $ pip install setuptools --upgrade To install the latest **version** (release): .. code-block:: console $ pip install lief To install nightly build: .. code-block:: console $ pip install [--user] --index-url https://lief.s3-website.fr-par.scw.cloud/latest lief Getting started =============== Python ------ .. code-block:: 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++ --- .. code-block:: cpp #include int main(int argc, char** argv) { // ELF try { std::unique_ptr elf = LIEF::ELF::Parser::parse("/bin/ls"); std::cout << *elf << '\n'; } catch (const LIEF::exception& err) { std::cerr << err.what() << '\n'; } // PE try { std::unique_ptr pe = LIEF::PE::Parser::parse("C:\\Windows\\explorer.exe"); std::cout << *pe << '\n'; } catch (const LIEF::exception& err) { std::cerr << err.what() << '\n'; } // Mach-O try { std::unique_ptr macho = LIEF::MachO::Parser::parse("/bin/ls"); std::cout << *macho << '\n'; } catch (const LIEF::exception& err) { std::cerr << err.what() << '\n'; } return 0; } C (Limited API) ---------------- .. code-block:: cpp #include 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 ============= * `Main documentation `_ * `Tutorial `_ * `API `_ * `Doxygen `_ Contact ======= * **Mail**: contact at lief.re * **Gitter**: `lief-project `_ Authors ======= Romain Thomas `@rh0main `_ - `Quarkslab `_ ---- LIEF is provided under the `Apache 2.0 license `_