wget https://download.gimp.org/pub/gegl/0.2/gegl-0.2.0.tar.bz2 tar xvf gegl-0.2.0.tar.bz2 && cd gegl-0.2.0
对源代码做两个小的修改
1 2
sed -i 's/CODEC_CAP_TRUNCATED/AV_CODEC_CAP_TRUNCATED/g' ./operations/external/ff-load.c sed -i 's/CODEC_FLAG_TRUNCATED/AV_CODEC_FLAG_TRUNCATED/g' ./operations/external/ff-load.c
rm -r $HOME/fuzzing_tiff/install cd $HOME/fuzzing_tiff/tiff-4.0.4/ make clean CFLAGS="--coverage" LDFLAGS="--coverage" ./configure --prefix="$HOME/fuzzing_tiff/install/" --disable-shared make make install
rm -r $HOME/fuzzing_tcpdump/install cd $HOME/fuzzing_tcpdump/libpcap-1.8.0/ make clean
cd $HOME/fuzzing_tcpdump/tcpdump-tcpdump-4.9.2/ make clean
调用configure和make之前设置AFL_USE_ASAN=1
1 2 3 4 5 6 7 8 9
cd $HOME/fuzzing_tcpdump/libpcap-1.8.0/ export LLVM_CONFIG="llvm-config-11" CC=afl-clang-lto ./configure --enable-shared=no --prefix="$HOME/fuzzing_tcpdump/install/" AFL_USE_ASAN=1 make
cd $HOME/fuzzing_tcpdump/tcpdump-tcpdump-4.9.2/ AFL_USE_ASAN=1 CC=afl-clang-lto ./configure --prefix="$HOME/fuzzing_tcpdump/install/" AFL_USE_ASAN=1 make AFL_USE_ASAN=1 make install
cd $HOME/fuzzing_libexif wget https://github.com/libexif/exif/archive/refs/tags/exif-0_6_15-release.tar.gz tar -xzvf exif-0_6_15-release.tar.gz
构建并安装exif command-line实用程序
1 2 3 4 5
cd exif-exif-0_6_15-release/ autoreconf -fvi ./configure --enable-shared=no --prefix="$HOME/fuzzing_libexif/install/" PKG_CONFIG_PATH=$HOME/fuzzing_libexif/install/lib/pkgconfig make make install
rm -r $HOME/fuzzing_libexif/install cd $HOME/fuzzing_libexif/libexif-libexif-0_6_14-release/ make clean export LLVM_CONFIG="llvm-config-11" CC=afl-clang-lto ./configure --enable-shared=no --prefix="$HOME/fuzzing_libexif/install/" make make install
1 2 3 4 5 6
cd $HOME/fuzzing_libexif/exif-exif-0_6_15-release make clean export LLVM_CONFIG="llvm-config-11" CC=afl-clang-lto ./configure --enable-shared=no --prefix="$HOME/fuzzing_libexif/install/" PKG_CONFIG_PATH=$HOME/fuzzing_libexif/install/lib/pkgconfig make make install
+--------------------------------+ | clang/clang++ 11+ is available | --> use LTO mode (afl-clang-lto/afl-clang-lto++) +--------------------------------+ see [instrumentation/README.lto.md](instrumentation/README.lto.md) | | if not, or if the target fails with LTO afl-clang-lto/++ | v +---------------------------------+ | clang/clang++ 6.0+ is available | --> use LLVM mode (afl-clang-fast/afl-clang-fast++) +---------------------------------+ see [instrumentation/README.llvm.md](instrumentation/README.llvm.md) | | if not, or if the target fails with LLVM afl-clang-fast/++ | v +--------------------------------+ | gcc 5+ is available | -> use GCC_PLUGIN mode (afl-gcc-fast/afl-g++-fast) +--------------------------------+ see [instrumentation/README.gcc_plugin.md](instrumentation/README.gcc_plugin.md) and [instrumentation/README.instrument_list.md](instrumentation/README.instrument_list.md) | | if not, or if you do not have a gcc with plugin support | v use GCC mode (afl-gcc/afl-g++) (or afl-clang/afl-clang++ for clang)
rm -r $HOME/fuzzing_xpdf/install cd $HOME/fuzzing_xpdf/xpdf-3.02/ make clean
使用afl-clang-fast编译器构建xpdf
1 2 3 4
export LLVM_CONFIG="llvm-config-11" CC=$HOME/AFLplusplus/afl-clang-fast CXX=$HOME/AFLplusplus/afl-clang-fast++ ./configure --prefix="$HOME/fuzzing_xpdf/install/" make make install
rm -r $HOME/fuzzing_xpdf/install cd $HOME/fuzzing_xpdf/xpdf-3.02/ make clean CFLAGS="-g -O0" CXXFLAGS="-g -O0" ./configure --prefix="$HOME/fuzzing_xpdf/install/" make make install