2019-02-15 22:07:49 +00:00
|
|
|
SOURCES=(dgif_lib.c egif_lib.c getarg.c gifalloc.c gif_err.c gif_font.c \
|
|
|
|
gif_hash.c openbsd-reallocarray.c qprintf.c quantize.c)
|
2019-01-08 19:17:29 +00:00
|
|
|
cd $SRC/giflib-code
|
2019-02-15 22:07:49 +00:00
|
|
|
rm -f *.o
|
|
|
|
for file in ${SOURCES[@]};
|
2019-01-08 19:17:29 +00:00
|
|
|
do
|
|
|
|
name=$(basename $file .c)
|
2019-02-15 22:07:49 +00:00
|
|
|
$CC -c -I . $CFLAGS $file -o $name.o
|
2019-01-08 19:17:29 +00:00
|
|
|
done
|
2019-02-15 22:07:49 +00:00
|
|
|
ar rc libgif.a *.o
|
|
|
|
|
|
|
|
cd $SRC
|
2019-02-16 18:36:03 +00:00
|
|
|
$CC $CFLAGS -Wall -c -I giflib-code dgif_target.c -o dgif_target.o
|
2019-02-15 22:07:49 +00:00
|
|
|
$CXX $CXXFLAGS -std=c++11 -I giflib-code dgif_target.o \
|
|
|
|
-o $OUT/dgif_target -lFuzzingEngine giflib-code/libgif.a
|
|
|
|
|
2019-01-08 19:17:29 +00:00
|
|
|
# Place dict and config in OUT
|
|
|
|
wget -O $OUT/gif.dict \
|
|
|
|
https://raw.githubusercontent.com/mirrorer/afl/master/dictionaries/gif.dict \
|
|
|
|
&> /dev/null
|
|
|
|
cp $SRC/*.options $OUT/
|
|
|
|
find $SRC/giflib-code -iname "*.gif" -exec \
|
|
|
|
zip -ujq $OUT/dgif_target_seed_corpus.zip "{}" \;
|