+ "description": "Library to instrument executable formats\nAbout\n=====\n\nThe purpose of this project is to provide a cross platform library that can parse, modify and\nabstract ELF, PE and MachO formats.\n\nMain features:\n\n * **Parsing**: LIEF can parse ELF, PE, MachO, OAT, DEX, VDEX, ART and provides an user-friendly API to access to format internals.\n * **Modify**: LIEF enables to modify some parts of these formats\n * **Abstract**: Three formats have common features like sections, symbols, entry point... LIEF factors them.\n * **API**: LIEF can be used in C, C++ and Python\n\n\nDownloads / Install\n===================\n\nFirst, make sure to have an updated version of setuptools:\n\n.. code-block:: console\n\n $ pip install setuptools --upgrade\n\nTo install the latest **version** (release):\n\n.. code-block:: console\n\n $ pip install lief\n\nTo install nightly build:\n\n.. code-block:: console\n\n $ pip install [--user] --index-url https://lief.s3-website.fr-par.scw.cloud/latest lief\n\n\nGetting started\n===============\n\nPython\n------\n\n.. code-block:: python\n\n import lief\n\n # ELF\n binary = lief.parse(\"/usr/bin/ls\")\n print(binary)\n\n # PE\n binary = lief.parse(\"C:\\\\Windows\\\\explorer.exe\")\n print(binary)\n\n # Mach-O\n binary = lief.parse(\"/usr/bin/ls\")\n print(binary)\n\nC++\n---\n\n.. code-block:: cpp\n\n #include <LIEF/LIEF.hpp>\n\n int main(int argc, char** argv) {\n // ELF\n try {\n std::unique_ptr<LIEF::ELF::Binary> elf = LIEF::ELF::Parser::parse(\"/bin/ls\");\n std::cout << *elf << '\\n';\n } catch (const LIEF::exception& err) {\n std::cerr << err.what() << '\\n';\n }\n\n // PE\n try {\n std::unique_ptr<LIEF::PE::Binary> pe = LIEF::PE::Parser::parse(\"C:\\\\Windows\\\\explorer.exe\");\n std::cout << *pe << '\\n';\n } catch (const LIEF::exception& err) {\n std::cerr << err.what() << '\\n';\n }\n\n // Mach-O\n try {\n std::unique_ptr<LIEF::MachO::FatBinary> macho = LIEF::MachO::Parser::parse(\"/bin/ls\");\n std::cout << *macho << '\\n';\n } catch (const LIEF::exception& err) {\n std::cerr << err.what() << '\\n';\n }\n\n return 0;\n }\n\nC (Limited API)\n----------------\n\n.. code-block:: cpp\n\n #include <LIEF/LIEF.h>\n\n int main(int argc, char** argv) {\n Elf_Binary_t* elf = elf_parse(\"/usr/bin/ls\");\n\n Elf_Section_t** sections = elf->sections;\n\n for (size_t i = 0; sections[i] != NULL; ++i) {\n printf(\"%s\\n\", sections[i]->name);\n }\n\n elf_binary_destroy(elf);\n return 0;\n }\n\nDocumentation\n=============\n\n* `Main documentation <https://lief-project.github.io/doc/latest/index.html>`_\n* `Tutorial <https://lief-project.github.io/doc/latest/tutorials/index.html>`_\n* `API <https://lief-project.github.io/doc/latest/api/index.html>`_\n* `Doxygen <https://lief-project.github.io/doc/latest/doxygen/index.html>`_\n\nContact\n=======\n\n* **Mail**: contact at lief.re\n* **Gitter**: `lief-project <https://gitter.im/lief-project>`_\n\n\nAuthors\n=======\n\nRomain Thomas `@rh0main <https://twitter.com/rh0main>`_ - `Quarkslab <https://www.quarkslab.com>`_\n\n----\n\nLIEF is provided under the `Apache 2.0 license <https://github.com/lief-project/LIEF/blob/0.12.3/LICENSE>`_",
0 commit comments