--- id: pyvex version: "9.3.2" license: BSD-2-Clause AND GPL-2.0-only license_treatment: copyleft maintenance: active --- # pyvex — A Python interface to libVEX and VEX IR License: copyleft · Maintenance: active · Downloads: 614.8K/mo ## What it is and what it does PyVEX is a Python interface to libVEX, the intermediate representation engine used by binary analysis tools. It translates machine code from diverse CPU architectures into VEX IR, an architecture-agnostic representation that abstracts away instruction set differences, register naming, memory access patterns, and instruction side-effects. This allows a single analysis algorithm to work across all supported architectures. VEX IR models code as blocks of statements and expressions: expressions represent calculated or constant values (register reads, memory loads, arithmetic results), statements model machine state changes (register writes, memory stores, conditional exits), and temporary variables act as internal registers. The package lets you lift raw machine bytes into IR blocks, inspect their structure, iterate through statements and expressions, and examine type information—enabling binary analysis, reverse engineering, program verification, and security research without architecture-specific logic. Use it for: - Lift machine code binaries into VEX IR for architecture-agnostic static analysis - Extract control flow and data flow from basic blocks by traversing IR statements and expressions - Build binary instrumentation or symbolic execution tools that need a unified IR across multiple architectures - Analyze instruction side-effects (flag updates, register modifications) made explicit in VEX representation - Reverse-engineer or audit binaries by examining the IR translation of machine code at a semantic level ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyVEX provides Python bindings to libVEX, translating machine code from various architectures into VEX intermediate representation (IR) for program analysis and binary instrumentation. Yes, if you are building binary analysis, reverse engineering, or program verification tools and need cross-architecture support. The active maintenance, lack of known vulnerabilities, and prebuilt wheels for major platforms reduce friction. Be aware of the GPL-2.0-only copyleft component and ensure your project's license is compatible before integrating. ## Install pip install pyvex uv add pyvex poetry add pyvex ## Installing pyvex Before you install: Medium install friction due to compiled dependencies (cffi, bitstring). Actively maintained with recent releases; last commit 2026-08-13. Supports Python 3.12+ with prebuilt wheels for major platforms (x86_64, aarch64, Windows, macOS). License in practice: Dual-licensed under BSD-2-Clause and GPL-2.0-only (copyleft). GPL-2.0-only component means derivative works must be distributed under GPL-2.0-only; verify compatibility with your project's license before use. Quickstart: pip install pyvex import pyvex # Lift machine code bytes into VEX IR irsb = pyvex.lift(b"\x90\x90\x90\x90\x90", 0x400400) # Inspect the IR block irsb.pp() print(irsb.next) print(irsb.jumpkind) Requires Python 3.12 or later; cffi requires a C compiler or prebuilt wheels (provided for major platforms). Verify before relying: - Whether cffi and bitstring dependencies introduce additional system-level build requirements beyond standard Python tooling - Performance characteristics when lifting large binaries or in batch analysis scenarios - External dependencies required to use the package beyond cffi and bitstring (e.g., archinfo for architecture support) ## Package facts - License: BSD-2-Clause AND GPL-2.0-only (copyleft) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 614.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags binary code lifting IR, machine code to intermediate representation, VEX IR Python bindings, architecture-agnostic binary analysis, cross-architecture code translation, binary instrumentation framework, program analysis IR, binary-analysis, intermediate-representation, reverse-engineering [View on SkillFed](https://skillfed.io/packages/pyvex) · [View on PyPI](https://pypi.org/project/pyvex/)