secure-software-engineering / Phasar

Licence: other
A LLVM-based static analysis framework.

Programming Languages

c
50402 projects - #5 most used programming language
cpp
1120 projects

Projects that are alternatives of or similar to Phasar

Crab Llvm
Static Analyzer for LLVM bitcode based on Abstract Interpretation
Stars: ✭ 143 (-71.57%)
Mutual labels:  static-analysis, llvm, program-analysis
Seahorn
SeaHorn Verification Framework
Stars: ✭ 270 (-46.32%)
Mutual labels:  static-analysis, llvm, program-analysis
clam
Static Analyzer for LLVM bitcode based on Abstract Interpretation
Stars: ✭ 180 (-64.21%)
Mutual labels:  llvm, static-analysis, program-analysis
progge.rs
Program analysis playground for a simple, imperative language
Stars: ✭ 29 (-94.23%)
Mutual labels:  llvm, static-analysis, program-analysis
Dg
[LLVM Static Slicer] Various program analyses, construction of dependence graphs and program slicing of LLVM bitcode.
Stars: ✭ 242 (-51.89%)
Mutual labels:  static-analysis, llvm, program-analysis
Codeql Go
The CodeQL extractor and libraries for Go.
Stars: ✭ 224 (-55.47%)
Mutual labels:  static-analysis, program-analysis
SCAF
A Speculation-Aware Collaborative Dependence Analysis Framework
Stars: ✭ 25 (-95.03%)
Mutual labels:  llvm, static-analysis
iec-checker
Static analysis of IEC 61131-3 programs
Stars: ✭ 36 (-92.84%)
Mutual labels:  static-analysis, program-analysis
tiro
TIRO - A hybrid iterative deobfuscation framework for Android applications
Stars: ✭ 20 (-96.02%)
Mutual labels:  static-analysis, program-analysis
flextool
C++ compile-time programming (serialization, reflection, code modification, enum to string, better enum, enum to json, extend or parse language, etc.)
Stars: ✭ 32 (-93.64%)
Mutual labels:  llvm, static-analysis
surveyor
A symbolic debugger for C/C++ (via LLVM), machine code, and JVM programs
Stars: ✭ 14 (-97.22%)
Mutual labels:  llvm, program-analysis
Linter
Static Analysis Compiler Plugin for Scala
Stars: ✭ 273 (-45.73%)
Mutual labels:  static-analysis, program-analysis
Detect It Easy
Program for determining types of files for Windows, Linux and MacOS.
Stars: ✭ 2,982 (+492.84%)
Mutual labels:  static-analysis, program-analysis
Pyt
A Static Analysis Tool for Detecting Security Vulnerabilities in Python Web Applications
Stars: ✭ 2,061 (+309.74%)
Mutual labels:  static-analysis, program-analysis
Sys
Sys: A Static/Symbolic Tool for Finding Good Bugs in Good (Browser) Code
Stars: ✭ 149 (-70.38%)
Mutual labels:  static-analysis, llvm
OCCAM
OCCAM: Object Culling and Concretization for Assurance Maximization
Stars: ✭ 20 (-96.02%)
Mutual labels:  llvm, static-analysis
Bap
Binary Analysis Platform
Stars: ✭ 1,385 (+175.35%)
Mutual labels:  static-analysis, program-analysis
Semgrep Rules
Semgrep rules registry
Stars: ✭ 140 (-72.17%)
Mutual labels:  static-analysis, program-analysis
Clangkit
ClangKit provides an Objective-C frontend to LibClang. Source tokenization, diagnostics and fix-its are actually implemented.
Stars: ✭ 330 (-34.39%)
Mutual labels:  static-analysis, llvm
Clang Power Tools
Bringing clang-tidy magic to Visual Studio C++ developers.
Stars: ✭ 285 (-43.34%)
Mutual labels:  static-analysis, llvm

PhASAR logo

PhASAR a LLVM-based Static Analysis Framework

Codacy Badge GitHub license

Version 1220

Secure Software Engineering Group

branch status
master
development

Currently supported version of LLVM

Phasar is currently set up to support LLVM-10.0.0 and LLVM-9.0.0/1. However, LLVM-8.0.0 should still work fine with Phasar (find_package(LLVM 9 REQUIRED CONFIG) in the top-level CMakeLists.txt may needs adjustment).

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.

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 and then have a look on the material provided on https://phasar.org/ as well. Please also have a look on Phasar's project directory and notice the project directory examples/ as well as the custom tool tools/myphasartool.cpp.

Building Phasar

If you cannot work with one of the pre-built versions of Phasar and would like to compile Phasar yourself, then please check the wiki for installing the prerequisites and compilation. It is recommended to compile Phasar yourself in order to get the full C++ experience and to have full control over the build mode.

Please help us to improve Phasar

You are using Phasar and would like to help us in the future? Then please support us by filling out this web form.

By giving us feedback you help to decide in what direction Phasar should stride in the future and give us clues about our user base. Thank you very much!

Installation

Phasar can be installed using the installer scripts as explained in the following.

Installing Phasar on an Ubuntu system

In the following, we would like to give an complete example of how to install Phasar using an Ubuntu or Unix-like system.

Therefore, we provide an installation script. To install Phasar, just navigate to the top-level directory of PhASAR and use the following command:

$ sudo ./bootstrap.sh

Done!

Installing Phasar a MacOS system

Mac OS 10.13.1 or higher only! To install the framework on a Mac we will rely on Homebrew. (https://brew.sh/)

Please follow the instructions down below.

$ brew install boost
$ brew install python3
# Install llvm version 10
$ brew install llvm 
# Setting the paths
# Use LLVM's Clang rather than Apple's Clang compiler
$ export CC=/usr/local/opt/llvm/bin/clang
$ export CXX=/usr/local/opt/llvm/bin/clang++
# Set PATH env variable to /usr/local/opt/llvm/bin
# Go to Phasar directory run the following commands
$ git submodule init
$ git submodule update
$ mkdir build
$ cd build/
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make -j $(nproc) # or use a different number of cores to compile it
$ sudo make install # if you wish a system-wise installation

Installing Phasar on a Windows system

A solution is under implementation.

Compiling Phasar (if not already done using the installation scripts)

Set the system's variables for the C and C++ compiler to clang:

$ export CC=/usr/local/bin/clang
$ export CXX=/usr/local/bin/clang++

You may need to adjust the paths according to your system. When you cloned PhASAR from Github you need to initialize PhASAR's submodules before building it:

$ git submodule init
$ git submodule update

If you downloaded PhASAR as a compressed release (e.g. .zip or .tar.gz) you can use the init-submodules-release.sh script that manually clones the required submodules:

$ utils/init-submodules-release.sh

Navigate into the Phasar directory. The following commands will do the job and compile the Phasar framework:

$ mkdir build
$ cd build/
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make -j $(nproc) # or use a different number of cores to compile it
$ sudo make install # if you wish to install Phasar system wide

When you have used the bootstrap.sh script to install Phasar, the above steps are already done. Use them as a reference if you wish to modify Phasar and recompile it.

Depending on your system, you may get some compiler errors from the json library. If this is the case please change the C++ standard in the top-level CMakeLists.txt:

set(CMAKE_CXX_STANDARD 14)

After compilation using cmake the following two binaries can be found in the build/ directory:

  • phasar-llvm - the actual Phasar command-line tool
  • myphasartool - an example tool that shows how tools can be build on top of Phasar

Use the command:

$ ./phasar-llvm --help

in order to display the manual and help message.

$ sudo make install

Please be careful and check if errors occur during the compilation.

When using CMake to compile Phasar the following optional parameters can be used:

Parameter : Type Effect
BUILD_SHARED_LIBS : BOOL Build shared libraries (default is OFF)
CMAKE_BUILD_TYPE : STRING Build Phasar in 'Debug' or 'Release' mode
(default is 'Debug')
CMAKE_INSTALL_PREFIX : PATH Path where Phasar will be installed if
“make install” is invoked or the “install”
target is built (default is /usr/local)
PHASAR_BUILD_DOC : BOOL Build Phasar documentation (default is OFF)
PHASAR_BUILD_UNITTESTS : BOOL Build Phasar unittests (default is OFF)
PHASAR_ENABLE_PAMM : STRING Enable the performance measurement mechanism
('Off', 'Core' or 'Full', default is Off)
PHASAR_ENABLE_PIC : BOOL Build Position-Independed Code (default is ON)
PHASAR_ENABLE_WARNINGS : BOOL Enable compiler warnings (default is ON)

You can use these parameters either directly or modify the installer-script bootstrap.sh

A remark on compile time

C++'s long compile times are always a pain. As shown in the above, when using cmake the compilation can easily be run in parallel, resulting in shorter compilation times. Make use of it!

Running a test solver

To test if everything works as expected please run the following command:

$ phasar-llvm --module test/build_systems_tests/installation_tests/module.ll -D ifds-solvertest

If you obtain output other than a segmentation fault or an exception terminating the program abnormally everything works as expected.

How to use Phasar?

Please consult our Phasar wiki pages.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].