-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·44 lines (37 loc) · 1.57 KB
/
setup.sh
File metadata and controls
executable file
·44 lines (37 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
fail() {
echo -en '\033[31mError: '
echo "$@"
echo "Installation has failed."
echo -en '\033[0m'
exit 1
}
echo -n "Checking for dependencies..."
which afl-showmap &>/dev/null || fail "Please install AFL++."
which python3 &>/dev/null || fail "Please install python3."
which git &>/dev/null || fail "Please install git."
echo "done"
echo -n "Setting up venv..."
python3 -c 'import sys; exit(sys.prefix != sys.base_prefix)' || fail "Looks like you're already in a venv. This script needs to make its own venv. Please deactivate your venv and source this script again."
rm -rf fuzz_env || fail "Couldn't remove old venv."
python3 -m venv fuzz_env || fail "Couldn't make a venv."
source ./fuzz_env/bin/activate || fail "Couldn't activate the venv."
pip3 install --upgrade pip &>/dev/null || fail "Couldn't update pip."
echo "done"
echo -n "Installing dependencies..."
for pkg in tqdm types-tqdm python-afl black mypy pylint matplotlib; do
pip3 install "$pkg" &>/dev/null || fail "Couldn't install remote package $pkg."
done
echo "done"
echo "Installing fuzzing targets..."
for target in targets/*; do
echo -n " Installing $(basename "$target")..."
pushd "$target" || fail "Couldn't pushd into $target."
make &>/dev/null || fail "Couldn't install local package $target."
popd || fail "Couldn't popd from $target."
echo "done"
done
echo "done"
mkdir -p seeds results reports benchmarking/{bench_configs,queues,analyses}
deactivate
echo -e "\033[32mThe fuzzing venv has now been created. run \`source fuzz_env/bin/activate\` to enter the venv.\033[0m"