From 6fadb3b717993c4438b7b703cc2e23bcc10ffe0f Mon Sep 17 00:00:00 2001 From: zlowram Date: Sun, 5 Aug 2018 10:04:23 -0700 Subject: [PATCH] Integration for Radare2 (#1237) * Integration for Radare2 * Remove rss_limit_mb since it does not work. --- projects/radare2/Dockerfile | 9 +++++++++ projects/radare2/build.sh | 24 ++++++++++++++++++++++++ projects/radare2/default.options | 3 +++ 3 files changed, 36 insertions(+) create mode 100644 projects/radare2/Dockerfile create mode 100755 projects/radare2/build.sh create mode 100644 projects/radare2/default.options diff --git a/projects/radare2/Dockerfile b/projects/radare2/Dockerfile new file mode 100644 index 000000000..c5ab9ca74 --- /dev/null +++ b/projects/radare2/Dockerfile @@ -0,0 +1,9 @@ +FROM gcr.io/oss-fuzz-base/base-builder +MAINTAINER zlowram@gmail.com +RUN apt-get update +RUN git clone https://github.com/radare/radare2 radare2 +RUN git clone https://github.com/radare/radare2-regressions radare2-regressions +WORKDIR radare2 +COPY build.sh $SRC/ +COPY *.options $SRC/ + diff --git a/projects/radare2/build.sh b/projects/radare2/build.sh new file mode 100755 index 000000000..c04240a67 --- /dev/null +++ b/projects/radare2/build.sh @@ -0,0 +1,24 @@ +#!/bin/bash -eu + +export USERCC=$CC +export HOST_CC=$CC + +sys/static.sh +cp -r r2-static $OUT/ + +cp -r ../radare2-regressions/fuzz/targets . +export RADARE2_STATIC_BUILD=$OUT/r2-static + +cd targets +make + +for target in $(ls *.cc); do + fuzzer=$(echo $target | cut -d'.' -f1) + cp $fuzzer $OUT + cp $SRC/default.options $OUT/$fuzzer.options +done + +for seed in $(ls corpora); do + zip -j corpora/$seed.zip corpora/$seed/* + cp corpora/$seed.zip $OUT +done diff --git a/projects/radare2/default.options b/projects/radare2/default.options new file mode 100644 index 000000000..08e7afb7e --- /dev/null +++ b/projects/radare2/default.options @@ -0,0 +1,3 @@ +[libfuzzer] +close_fd_mask=3 +detect_leaks=0