aboutsummaryrefslogtreecommitdiffhomepage
path: root/projects/zydis
diff options
context:
space:
mode:
authorGravatar Joel Höner <joel@zyantific.com>2020-11-30 01:43:40 +0100
committerGravatar GitHub <noreply@github.com>2020-11-29 16:43:40 -0800
commit11996eb640155b840f9e94b6537a609cfa65e5ab (patch)
treef49fd4c53b412402cebfdb1d765c8f31f14c6bc6 /projects/zydis
parentf40f590cea46424fa06a90c14315de3e4ca8bfe7 (diff)
[zydis] Initial integration (#4725)
Diffstat (limited to 'projects/zydis')
-rw-r--r--projects/zydis/Dockerfile25
-rwxr-xr-xprojects/zydis/build.sh45
-rw-r--r--projects/zydis/project.yaml9
3 files changed, 79 insertions, 0 deletions
diff --git a/projects/zydis/Dockerfile b/projects/zydis/Dockerfile
new file mode 100644
index 00000000..f0b3c589
--- /dev/null
+++ b/projects/zydis/Dockerfile
@@ -0,0 +1,25 @@
+# Copyright 2020 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
+
+ADD https://github.com/zyantific/zydis/raw/master/assets/ZydisFuzz_seed_corpus.zip \
+ $SRC/ZydisFuzz_seed_corpus.zip
+
+COPY build.sh $SRC/
+
+RUN git clone --recursive https://github.com/zyantific/zydis.git
+WORKDIR zydis
diff --git a/projects/zydis/build.sh b/projects/zydis/build.sh
new file mode 100755
index 00000000..b38ce5b2
--- /dev/null
+++ b/projects/zydis/build.sh
@@ -0,0 +1,45 @@
+#!/bin/bash -eu
+# Copyright 2020 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.
+#
+################################################################################
+
+mv $SRC/ZydisFuzz_seed_corpus.zip $OUT/ZydisFuzz_seed_corpus.zip
+
+mkdir build && cd build
+
+cmake \
+ -DZYDIS_BUILD_EXAMPLES=OFF \
+ -DZYDIS_BUILD_TOOLS=OFF \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_C_COMPILER=$CC \
+ -DCMAKE_CXX_COMPILER=$CXX \
+ -DCMAKE_C_FLAGS="$CFLAGS" \
+ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+ ..
+
+make -j8
+
+$CXX \
+ $CXXFLAGS \
+ $LIB_FUZZING_ENGINE \
+ ../tools/ZydisFuzzIn.c \
+ -DZYDIS_LIBFUZZER \
+ -o $OUT/ZydisFuzz \
+ -I . \
+ -I ./zycore \
+ -I ../include \
+ -I ../dependencies/zycore/include \
+ ./libZydis.a
+
diff --git a/projects/zydis/project.yaml b/projects/zydis/project.yaml
new file mode 100644
index 00000000..333b50f6
--- /dev/null
+++ b/projects/zydis/project.yaml
@@ -0,0 +1,9 @@
+homepage: "https://github.com/zyantific/zydis"
+language: c
+primary_contact: "joel.hoener@gmail.com"
+auto_ccs:
+ - "flobernd90@gmail.com"
+sanitizers:
+ - address
+ - memory
+ - undefined