--- id: lief version: "1.0.0" license: Apache License 2.0 license_treatment: permissive maintenance: active --- # lief — Library to instrument executable formats License: permissive · Maintenance: active · Downloads: 1.9M/mo ## What it is and what it does LIEF is a cross-platform binary parsing and manipulation library that abstracts the complexity of ELF, PE, MachO, OAT, DEX, VDEX, and ART executable formats into a unified, user-friendly API. It lets you read binary structure internals—sections, symbols, imports, entry points—and modify certain parts of these formats programmatically. The library is written in C++ with bindings for Python, C, C++, and Rust, and is actively maintained. You would use LIEF when you need to inspect or instrument compiled binaries without writing format-specific parsers, or when you're building reverse-engineering, security analysis, or binary instrumentation tools. It handles the low-level format details so you can focus on your analysis or transformation logic. Use it for: - Inspect sections, symbols, and imports from ELF, PE, or MachO binaries for security audits or malware analysis. - Modify binary metadata or sections to instrument executables for debugging or dynamic analysis. - Parse mobile and Android formats (DEX, VDEX, OAT, ART) to analyze app structure and bytecode. - Build reverse-engineering tools that need to work across multiple binary formats on different platforms. - Extract and analyze debug information from compiled binaries for forensic or compatibility checks. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. LIEF parses, modifies, and abstracts binary executable formats (ELF, PE, MachO, OAT, DEX, VDEX, ART) across platforms, exposing a unified API to inspect and manipulate binary structure internals. Yes, if you need to parse or modify binary executables across multiple formats and platforms. LIEF is actively maintained, permissively licensed, has no known vulnerabilities, and offers a mature API. Medium install friction is the main caveat; verify your Python version meets the >=3.9 requirement before installing. ## Install pip install lief uv add lief poetry add lief ## Installing lief Before you install: Medium install friction: precompiled wheels available across macOS, Linux (manylinux, musllinux, multiple architectures), and Windows. Maintenance is active with a release 33 days old. License in practice: Apache License 2.0 (permissive): you may use, modify, and distribute LIEF freely in commercial and private projects, provided you include a copy of the license and state material changes. Quickstart: pip install lief import lief elf = lief.ELF.parse("/bin/ls") for section in elf.sections: print(section.name, len(section.content)) Requires Python >=3.9; verify your Python version before installing. Verify before relying: - Whether DWARF/PDB support and Objective-C metadata are included in the base package or require a separate Extended edition. - Performance characteristics and memory overhead when parsing large binaries. - Stability and completeness of modification features across all supported formats. - Which Python versions beyond 3.9 are supported by available precompiled wheels. ## Package facts - License: Apache License 2.0 (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 1.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags binary format parser, elf pe macho parsing, executable format analysis, binary instrumentation library, reverse engineering tools, binary modification, cross-platform binary parsing, binary-analysis, reverse-engineering, security [View on SkillFed](https://skillfed.io/packages/lief) · [View on PyPI](https://pypi.org/project/lief/)