From 788bf543c8b1bc4dc75a0c14486f2aab58a9d7c3 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Tue, 30 Jun 2015 21:24:00 -0400 Subject: [PATCH] [extras] added ramdisk-create-osx.sh for Mac OS X systems --- extras/ramdisk/ramdisk-create-osx.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 extras/ramdisk/ramdisk-create-osx.sh diff --git a/extras/ramdisk/ramdisk-create-osx.sh b/extras/ramdisk/ramdisk-create-osx.sh new file mode 100755 index 00000000..546a5871 --- /dev/null +++ b/extras/ramdisk/ramdisk-create-osx.sh @@ -0,0 +1,27 @@ +#!/bin/sh -x +# +# This script creates a ramdisk and clones the fwknop git repository +# into it. This is meant for AFL fuzzing cycles. +# + +### 1GB +RSIZE=2097152 +LABEL="ramdisk-for-fwknop" +RAMDISK=/Volumes/$LABEL + +if [ -d $RAMDISK ] +then + echo "[*] $RAMDISK mount point already exists" + exit 1 +fi + +if [ -f extras/ramdisk/ramdisk-create-osx.sh ] +then + diskutil erasevolume HFS+ "$LABEL" `hdiutil attach -nomount ram://$RSIZE` + git clone . $RAMDISK/fwknop.git +else + echo "[*] Run this script from the top level fwknop sources directory" + exit 1 +fi + +exit $?