From 50f09eb94d33abbfe3e18184988a0c3a8f0f5612 Mon Sep 17 00:00:00 2001 From: Augustus Date: Thu, 20 Jul 2023 14:07:49 +0800 Subject: [PATCH] optimize the usage part --- README.md | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 2b083ad..98966a2 100755 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ or you can compile the image yourself using the Dockerfile we provide. git clone --recursive https://github.com/waugustus/CarpetFuzz cd CarpetFuzz # Build image -sudo docker build -t carpetfuzz:latest . +sudo docker build -t 4ugustus/carpetfuzz:latest . ``` And you can also build CarpetFuzz yourself: @@ -105,22 +105,14 @@ wget -P models/ https://allennlp.s3.amazonaws.com/models/elmo-constituency-parse ## Usage (Minimal Working Example) ## -We take the program `tiffcp` used in the paper as an example, +We take the program `tiffcp` used in the paper as an example, ``` -export CarpetFuzz=/path/to/CarpetFuzz - # Step 1 -# Download and build the tiffcp repo with CarpetFuzz-fuzzer -git clone https://gitlab.com/libtiff/libtiff -cd libtiff -git reset --hard b51bb -sh ./autogen.sh -CC=${CarpetFuzz}/fuzzer/afl-clang-fast CXX=${CarpetFuzz}/fuzzer/afl-clang-fast++ ./configure --prefix=$PWD/build_carpetfuzz --disable-shared -make -j;make install;make clean -# Prepare the seed -mkdir input -cp ${CarpetFuzz}/fuzzer/testcases/images/tiff/* input/ +# Create container +sudo docker run -it 4ugustus/carpetfuzz bash +# Libtiff has already been built +cd /root/programs/libtiff # Step 2 # Use CarpetFuzz to analyze the relationships from the manpage file @@ -135,6 +127,24 @@ python3 ${CarpetFuzz}/scripts/rank_combination.py --combination ${CarpetFuzz}/ou ${CarpetFuzz}/fuzzer/afl-fuzz -i input/ -o output/ -K ${CarpetFuzz}/output/stubs/ranked_stubs_tiffcp.txt -- $PWD/build_carpetfuzz/bin/tiffcp @@ ``` +If you build CarpetFuzz yourself, you need to change Step 1 as following, + +``` +# Step 1 (without docker) +# Set the environment +export CarpetFuzz=/path/to/CarpetFuzz +# Download and build the tiffcp repo with CarpetFuzz-fuzzer +git clone https://gitlab.com/libtiff/libtiff +cd libtiff +git reset --hard b51bb +sh ./autogen.sh +CC=${CarpetFuzz}/fuzzer/afl-clang-fast CXX=${CarpetFuzz}/fuzzer/afl-clang-fast++ ./configure --prefix=$PWD/build_carpetfuzz --disable-shared +make -j;make install;make clean +# Prepare the seed +mkdir input +cp ${CarpetFuzz}/fuzzer/testcases/images/tiff/* input/ +``` + ## FAQ ## 1. How to find the manpage file of a new program?