1#!/bin/bash 2# Copyright 2021 Google LLC 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16################################################################################ 17 18# Source this file for afl++ debug sessions. 19apt-get update 20apt-get install -y strace gdb vim joe psmisc 21 22pushd $SRC/aflplusplus > /dev/null 23git checkout dev 24git pull 25test -n "$1" && { git checkout "$1" ; git pull ; } 26CFLAGS_SAVE="$CFLAGS" 27CXXFLAGS_SAVE="$CXXFLAGS" 28unset CFLAGS 29unset CXXFLAGS 30make 31export CFLAGS="$CFLAGS_SAVE" 32export CXXFLAGS="$CXXFLAGS_SAVE" 33popd > /dev/null 34 35export ASAN_OPTIONS="detect_leaks=0:symbolize=0:detect_odr_violation=0:abort_on_error=1" 36export AFL_LLVM_LAF_ALL=1 37export AFL_LLVM_CMPLOG=1 38touch "$OUT/afl_cmplog.txt" 39export AFL_LLVM_DICT2FILE=$OUT/afl++.dict 40ulimit -c unlimited 41