Pysvf: Python Bindings for SVF
News
- SVF-Python now supports MTA bindings and more pointer analysis strategies(AndersenWaveDiff, AndersenBase, and Steensgaard bindings). (Thank JoelYYoung for his help!).
1. Introduction
Pysvf is a Python binding for the SVF (Static Value-Flow), a static analysis framework built on LLVM.
2. Installation
Pysvf can be installed in two ways:
Method 1: Install via pip (Test PyPI)
Requirements
- Python 3.8 - 3.11
- OS: Linux X86-64, Linux Arm64, MacOS
Install Command
python3 -m pip install -i https://test.pypi.org/simple/ pysvf
Method 2: Build from Source
Clone the repository and run the build script:
This will build the SVF and its depedencies like LLVM and Z3, and set up the Python bindings.
3. Documentation
Documentation is available on the SVF-Python Wiki:
4. Tutorial
Example notebooks are provided in the tutorial folder. Before running them, please install Jupyter Notebook:
python3 -m pip install jupyter
cd demo
jupyter notebookThen you can click one of the following notebooks.
Example Notebooks
- PAG: Generate Program Assignment Graph (PAG / SVFIR) from LLVM BC files and manipulate
PAGNode(SVFVar). - ICFG: Generate Interprocedural Control Flow Graph (ICFG) and manipulate
ICFGNode,ICFGEdge, and subclasses. - SVFG: Generate Static Value Flow Graph (SVFG) and manipulate
SVFGNode,SVFGEdge, and subclasses.