Decompilers & Static AnalysisCLI Flag: --format lief

REA vs Quarkslab LIEF• AI Reverse Engineering Guide

Quarkslab's library to parse, modify, and instrument ELF, PE, and Mach-O executable formats.

AI Overview Direct AnswerREA vs Quarkslab LIEF Integration & AI Workflow

In AI-assisted reverse engineering with REA (rea-agents), Quarkslab LIEF is bridged via --format lief to allow Claude Code, Cursor, and Windsurf to extract symbol graphs, trace control flow, and decompile binaries headlessly via Model Context Protocol.

Synergy & ComparisonAutonomous AI Acceleration

How REA Enhances Quarkslab LIEF with Autonomous AI Agents

Manual Quarkslab LIEF Workflow

Traditional reverse engineering in Quarkslab LIEF requires manual CFG graph navigation, manual symbol naming, and isolated local scripts without LLM code intelligence.

REA + Quarkslab LIEF Agentic Pipeline

AI coding agents (Claude Code, Cursor) invoke Quarkslab LIEF headlessly via REA's Model Context Protocol (MCP), generating clean-room specifications and reconstructive code in seconds.

Open SourceOpen Source (Apache 2.0)
100% Free
Official Download & Website ↗

Multi-Platform Installation Recipes

Python PIP
pip install lief
macOS (Homebrew)
brew install lief
Conda
conda install -c conda-forge lief
Connect to AI Agents Once Installed
Verify REA detects this tool and enables Claude / Cursor MCP bridges:
rea doctor --format lief

Supported Platforms & Targets

Host Operating Systems:
LinuxmacOSWindows
Target Architectures:
ELF32 / ELF64PE32 / PE32+Mach-O (Universal)

Tool Overview & Role

LIEF (Library to Instrument Executable Formats) by Quarkslab is the industry-standard low-level binary parser, modifier, and re-builder for ELF, PE, and Mach-O files. LIEF operates directly on file structures without recompilation: adding new executable sections, injecting dynamic dependencies (DT_NEEDED in ELF, LC_LOAD_DYLIB in Mach-O), patching Import Address Tables (IAT), and stripping code signatures. REA couples LIEF with AI agents to verify file integrity, patch binary mitigations, and prepare instrumented binaries for dynamic telemetry.

REA Bridge Mechanism

Exposes Python and C++ bindings in REA's binary rewriting pipeline. Allows AI coding agents to inspect headers, inject dynamic payload hooks directly into binaries, and verify structural ELF/PE compliance.

Key Capabilities

Cross-format parsing and editing for ELF, PE, and Mach-O
Section addition, resizing, and virtual address remapping
Dynamic dependency injection (DT_NEEDED, LC_LOAD_DYLIB)
Code signature removal and import address table (IAT) patching

CLI Usage Examples

Execute direct terminal analysis with --format lief:

rea lief example
lief-inspect ./binary.elf --sections
python3 -c 'import lief; b = lief.parse("./target"); b.add_library("libhook.so"); b.write("./patched");'