pyvex
A Python interface to libVEX and VEX IR
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 on this page — 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
pyvex on PyPI
pip
pip install pyvexuv
uv add pyvexpoetry
poetry add pyvexInstalling 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 the current Python release (>=3.12) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — bitstring, cffi |
| Maintenance | actively maintained — 9 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 614,793/month — #5,745 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyvex-9.3.2-cp312-abi3-macosx_11_0_arm64.whl; pyvex-9.3.2-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyvex-9.3.2-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyvex-9.3.2-cp312-abi3-musllinux_1_2_aarch64.whl; pyvex-9.3.2-cp312-abi3-musllinux_1_2_x86_64.whl; pyvex-9.3.2-cp312-abi3-win_amd64.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
pypcodepypcode provides machine code disassembly and…
permissive · top 15,000 on PyPI
bfiA pure-Python interpreter for Brainfuck that…
permissive · top 15,000 on PyPI
onnx-ironnx-ir provides an in-memory intermediate…
permissive · top 5,000 on PyPI
pyqirPyQIR generates, parses, and analyzes QIR…
permissive · top 15,000 on PyPI
lib4vexLib4VEX parses and generates VEX (Vulnerability…
permissive · top 15,000 on PyPI
llvmlitellvmlite provides a lightweight Python binding…
permissive · top 1,000 on PyPI
nvidia-cuda-tileirasProvides a portable intermediate representation…
unclear · top 5,000 on PyPI
nvidia-nvvmProvides the NVVM compiler IR library for…
unclear · top 5,000 on PyPI
einxeinx provides a universal notation for…
permissive · top 5,000 on PyPI
ailmentAILment provides the intermediate language (IL)…
permissive · top 15,000 on PyPI