Skip to content
Snippets Groups Projects
Commit 1a97fb75 authored by Anh Nguyen-Tuong's avatar Anh Nguyen-Tuong
Browse files

Add testing scripts

parent e42a37b8
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,9 @@ echo "Zafl: Transforming input binary $input_binary into $output_zafl_binary"
cmd="$PSZ $input_binary $output_zafl_binary -c move_globals=on -c zafl=on -o move_globals:--elftables -o zipr:--traceplacement:on -o zipr:true -o zafl:--stars $*"
echo "Zafl: Issuing command: $cmd"
eval $cmd
ldd $output_zafl_binary | grep libzafl >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
echo "Zafl: error: output binary does not show a dependence on the Zafl support library"
if [ $? -eq 0 ]; then
ldd $output_zafl_binary | grep libzafl >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
echo "Zafl: error: output binary does not show a dependence on the Zafl support library"
fi
fi
......@@ -3,3 +3,4 @@ export AFL_TRANSFORMS=$ZFUZZ_HOME/afl_transforms
export AFL_PATH=$ZFUZZ_HOME/afl
export PATH=$PATH:$AFL_PATH:$ZFUZZ_HOME/bin
export AFL_SKIP_BIN_CHECK=1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SECURITY_TRANSFORMS_HOME/lib
#binutils_binaries="size strings readelf strip-new nm-new"
binutils_binaries="size strings readelf objdump cxxfilt ar"
echo "Build afl-gcc version of $binutils_binaries"
for b in $binutils_binaries
do
aflgcc_dir="${b}_aflgcc"
if [ ! -d $aflgcc_dir ];
then
mkdir ${b}_aflgcc
fi
cp binutils-gdb/binutils/$b ${b}_aflgcc/${b}.aflgcc
pushd $aflgcc_dir
echo "Building Zafl version of $b"
mkdir in
echo "1" > in/1
popd
done
source binutils.spec
echo "Build dyninst version of $binutils_binaries"
AFL_DYNINST_DIR=/home/an7s/aware/zfuzz/afl-dyninst/
AFL_DYNINST=$AFL_DYNINST_DIR/afl-dyninst
for b in $binutils_binaries
do
dyninst_dir="${b}_dyninst"
if [ ! -d $dyninst_dir ];
then
mkdir ${b}_dyninst
fi
cp binutils-gdb/binutils/$b ${b}_dyninst
pushd $dyninst_dir
echo "Building Zafl version of $b"
ln -s $AFL_DYNINST_DIR/libAflDyninst.so .
$AFL_DYNINST -f -i $b -o ${b}.dyninst
mkdir in
echo "1" > in/1
popd
done
source binutils.spec
echo "Build qemu version of $binutils_binaries"
for b in $binutils_binaries
do
qemu_dir="${b}_qemu"
if [ ! -d $qemu_dir ];
then
mkdir ${b}_qemu
fi
cp binutils-gdb/binutils/$b ${b}_qemu/${b}.qemu
pushd $qemu_dir
mkdir in
echo "1" > in/1
popd
done
tools="aflgcc zafl dyninst qemu"
binutils_binaries="size strings readelf strip-new nm-new"
for b in $binutils_binaries
do
for t in $tools
do
pushd ${b}_${t}
if [ ! -d in ]; then
mkdir in
fi
echo "1" > in/1
popd
done
done
pushd binutils-gdb
make clean distclean
rm -fr config.cache
rm -fr */config.cache
rm -fr */*/config.cache
CC=afl-gcc ./configure
make clean all
popd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment