diff options
author | Catena cyber <35799796+catenacyber@users.noreply.github.com> | 2018-06-01 18:48:06 +0200 |
---|---|---|
committer | Kostya Serebryany <konstantin.s.serebryany@gmail.com> | 2018-06-01 09:48:06 -0700 |
commit | 8d71a4be616532cc18975a42d04536d3c17d6167 (patch) | |
tree | 841fd8d32eb8d7eb55bc8cdf433ea47d5527dc4d /projects/capstone | |
parent | a3c6e0e227e0312c658fec9e09d0fb84d96c9647 (diff) | |
download | oss-fuzz-8d71a4be616532cc18975a42d04536d3c17d6167.tar.gz |
Adds capstone project (#1457)
* Adds capstone project
* Fuzzes both next and master branch for capstone
* Use main branch of main repo for capstone
Diffstat (limited to 'projects/capstone')
-rw-r--r-- | projects/capstone/Dockerfile | 23 | ||||
-rwxr-xr-x | projects/capstone/build.sh | 42 | ||||
-rw-r--r-- | projects/capstone/project.yaml | 3 |
3 files changed, 68 insertions, 0 deletions
diff --git a/projects/capstone/Dockerfile b/projects/capstone/Dockerfile new file mode 100644 index 000000000..0c23778ac --- /dev/null +++ b/projects/capstone/Dockerfile @@ -0,0 +1,23 @@ +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder +MAINTAINER capstone.engine@gmail.com +RUN apt-get update && apt-get install -y make cmake tshark +RUN git clone --depth 1 --branch master https://github.com/aquynh/capstone.git capstonemaster +#TODO next branch +WORKDIR $SRC +COPY build.sh $SRC/ diff --git a/projects/capstone/build.sh b/projects/capstone/build.sh new file mode 100755 index 000000000..5370c902e --- /dev/null +++ b/projects/capstone/build.sh @@ -0,0 +1,42 @@ +#!/bin/bash -eu +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +#add next branch +for branch in master +do + cd capstone$branch + # build project + mkdir build + # does not seem to work in source directory + # + make.sh overwrites CFLAGS + cd build + cmake -DCAPSTONE_BUILD_SHARED=0 .. + make + + cd ../suite/fuzz + # TODO corpus + + # export other associated stuff + cp *.options $OUT/ + + # build fuzz target + $CC $CFLAGS -I../../include/ -c fuzz_disasm.c -o fuzz_disasm.o + + $CXX $CXXFLAGS fuzz_disasm.o -o $OUT/fuzz_disasm$branch ../../build/libcapstone.a -lFuzzingEngine + + cd ../../../ +done diff --git a/projects/capstone/project.yaml b/projects/capstone/project.yaml new file mode 100644 index 000000000..ad611d29c --- /dev/null +++ b/projects/capstone/project.yaml @@ -0,0 +1,3 @@ +homepage: "https://www.capstone-engine.org" +primary_contact: "capstone.engine@gmail.com" +auto_ccs : "p.antoine@catenacyber.fr" |