skillfed

pyvex

A Python interface to libVEX and VEX IR

pyvex v9.3.2 614.8K downloads/30d#5,745 on PyPI376
Copyleft license BSD-2-Clause AND GPL-2.0-only Active released

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 pyvex

uv

uv add pyvex

poetry

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 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

Programming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

binary code lifting IRmachine code to intermediate representationVEX IR Python bindingsarchitecture-agnostic binary analysiscross-architecture code translationbinary instrumentation frameworkprogram analysis IR
binary-analysisintermediate-representationreverse-engineering

More Software Development packages