GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - secure-software-engineering/phasar: A LLVM-based static analysis framework.

BranchesTags
Open more actions menu

Latest commit

 

History

3,301 Commits
3,301 Commits

Folders and files

NameName
Last commit message
Last commit date
.docker
.docker
 
 
.github
.github
 
 
cmake
cmake
 
 
config
config
 
 
docs
docs
 
 
examples
examples
 
 
external
external
 
 
githooks
githooks
 
 
img
img
 
 
include
include
 
 
lib
lib
 
 
test
test
 
 
test_package
test_package
 
 
tools
tools
 
 
unittests
unittests
 
 
utils
utils
 
 
.clang-format
.clang-format
 
 
.clang-tidy
.clang-tidy
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
.gitmodules
.gitmodules
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
BUILD.md
BUILD.md
 
 
BreakingChanges.md
BreakingChanges.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CMakeLists.txt
CMakeLists.txt
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CODING_GUIDELINES.txt
CODING_GUIDELINES.txt
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
CREDITS.txt
CREDITS.txt
 
 
Config.cmake.in
Config.cmake.in
 
 
Dockerfile
Dockerfile
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
bootstrap.sh
bootstrap.sh
 
 
conanfile.py
conanfile.py
 
 
config.h.in
config.h.in
 
 
docker-compose.debug.yml
docker-compose.debug.yml
 
 
docker-compose.yml
docker-compose.yml
 
 

Repository files navigation

PhASAR logo

PhASAR: A LLVM-based Static Analysis Framework

C++ Standard GitHub license GitHub Release

What is PhASAR?

PhASAR is a LLVM-based static analysis framework written in C++. It allows users to specify arbitrary data-flow problems which are then solved in a fully-automated manner on the specified LLVM IR target code. Computing points-to information, call-graph(s), etc. is done by the framework, thus you can focus on what matters.

You can find available literature on PhASAR here.

Key Features

  • IFDS/IDE solver: Interprocedural data-flow solvers based on the IFDS/IDE algorithm
  • MonoIFDS solver: High-performance data-flow solver for bottom-up IFDS analyses
  • Sparse analysis: SparseIFDS/SparseIDE for improved performance
  • Call-graph construction: Several algorithms (CHA, RTA, VTA, alias-based)
  • Type-hierarchy construction: Extract high-level C++ type information from LLVM IR
  • Points-to/alias infrastructure: High-performance alias analyses for LLVM IR. Integration with state-of-the-art alias/points-to information from SVF supported
  • Interprocedural CFG (ICFG): Connecting control-flow with call-graph information
  • Path-tracking: Improve results-reporting by reconstruct concrete data-flow paths from IFDS/IDE results
  • Monotone solver: Simple intra-procedural analysis engine, based on Monotone Frameworks
  • Taint analysis: Infrastructure for taint-configuration & IFDS/IDE-based taint analysis
  • Modern C++20 API: Modular, easy-to use interfaces, also for non C++ experts

Experimental Features

  • WPDS solver: Data-flow solver based on weighted pushdown systems. Can solve any IFDS/IDE problem; supports sparsification
  • DFI solver: Data-flow solver based on DFS-interval reachability. Can solve any IFDS problem; supports sparsification

How do I get started with PhASAR?

We have some documentation on PhASAR in our Wiki. You probably would like to read this README first.

Please also have a look at PhASAR's project directory, in particular the examples directory and the custom tool tools/example-tool/myphasartool.cpp.

You can find PhASAR's API reference here.

Requirements

C++ Standard

PhASAR requires at least C++20.

PhASAR supports C++20 modules as an experimental feature.

LLVM Version

PhASAR supports LLVM versions between LLVM-16 and LLVM-22.1, using LLVM-16 by default.

Support for LLVM-23 is experimental.

We actively test PhASAR with LLVM-16 and LLVM-22.1, so if something does not work, try these versions instead. Specify the PHASAR_LLVM_VERSION cmake variable to change the LLVM version to use.

Note

Since v18, LLVM uses minor versions, so use -DPHASAR_LLVM_VERSION=17 for LLVM-17 but -DPHASAR_LLVM_VERSION=18.1 for LLVM-18

Breaking Changes

To keep PhASAR in a state that is well suited for state-of-the-art research in static analysis, as well as for productive use, we have to make breaking changes. Please refer to Breaking Changes for detailed information on what was broken recently and how to migrate.

Building PhASAR

Please refer to BUILD.md for instructions on how to build PhASAR.

How to use PhASAR?

The following example shows how to use PhASAR's core concepts of IFDS/IDE analysis, alias analysis, type-hierarchy, call-graph, and taint analysis:

#include "phasar.h"

// Load the target LLVM IR
auto IRDB = psr::LLVMProjectIRDB::loadOrExit("target.ll");

// Build alias information, a type-hierarchy, and a taint configuration
// (sources/sinks can come from IR annotations, a JSON file, or callbacks)
psr::LLVMAliasSet AS(&IRDB);
psr::DIBasedTypeHierarchy TH(IRDB);
psr::LLVMTaintConfig TC(IRDB);

// Build the interprocedural CFG using VTA call-graph construction
psr::LLVMBasedICFG ICFG(&IRDB, psr::CallGraphAnalysisType::VTA,
                         {"main"}, &TH, &AS);

// Instantiate and solve the taint analysis
psr::IFDSTaintAnalysis Problem(&IRDB, &AS, &TC, {"main"});
psr::solveIFDSProblem(Problem, ICFG);

// Inspect detected leaks
for (const auto &[Inst, Facts] : Problem.Leaks) {
  llvm::outs() << "Leak at: " << psr::llvmIRToString(Inst) << '\n';
}

For more examples, including how to write a custom analysis, see examples/how-to/.

Integrating PhASAR into your build

We recommend using PhASAR as a library with cmake, using FetchContent or as git submodule.

Assuming you have checked out phasar in external/phasar, the phasar-related cmake commands may look like this:

add_subdirectory(external/phasar EXCLUDE_FROM_ALL)            # Build phasar with your tool

...

target_link_libraries(yourphasartool
    ...
    phasar # Make your tool link against phasar
)

Depending on your use of PhASAR you also may need to add LLVM to your build.

For more information please consult our PhASAR wiki pages.

If you have PhASAR installed, Use-PhASAR-as-a-library may be a good start.

Contributing

You are very welcome to contribute to the PhASAR project. Just raise an issue or a pull request on GitHub.

For details see Contributing to PhASAR and Coding Conventions.

Secure Software Engineering Group

PhASAR is primarily developed and maintained by the Secure Software Engineering Group at Heinz Nixdorf Institute (University of Paderborn) and Fraunhofer IEM.

PhASAR was initially developed by Philipp Dominik Schubert (@pdschubert)([email protected]).

Currently, PhASAR is maintained by

  • Fabian Schiebel (@fabianbs96)([email protected])
  • Sriteja Kummita (@sritejakv)
  • Lucas Briese (@jusito)
  • Martin Mory (@MMory)([email protected])
  • others

About

A LLVM-based static analysis framework.

Topics

ccppdata-flow-analysisllvmprogram-analysisstatic-analysis

Resources

Readme
License

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

1.1k stars

Watchers

25 watching

Forks

161 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.