aboutsummaryrefslogtreecommitdiff
path: root/utils/libtokencap
diff options
context:
space:
mode:
authorAlexander Shvedov <60114847+a-shvedov@users.noreply.github.com>2024-06-01 01:18:03 +0300
committerGitHub <noreply@github.com>2024-06-01 01:18:03 +0300
commit5e708b23c60e0d95f1d12897e5a47a08b1ade1c0 (patch)
tree67f043793e32447a596bea77df85016bdd839506 /utils/libtokencap
parentc202d80dea287c9aaaa6c0dd3eba49398e0b247c (diff)
downloadafl++-5e708b23c60e0d95f1d12897e5a47a08b1ade1c0.tar.gz
Update make_dict_v2.sh
(-) removed default vars ; (+) added LD_PRELOAD_PATH check
Diffstat (limited to 'utils/libtokencap')
-rw-r--r--utils/libtokencap/make_dict_v2.sh18
1 files changed, 7 insertions, 11 deletions
diff --git a/utils/libtokencap/make_dict_v2.sh b/utils/libtokencap/make_dict_v2.sh
index 0e8ca531..1ddec06b 100644
--- a/utils/libtokencap/make_dict_v2.sh
+++ b/utils/libtokencap/make_dict_v2.sh
@@ -1,32 +1,28 @@
-#default values
-timeout_sec=5
-LD_PRELOAD_PATH="/home/${USER}/AFLplusplus/utils/libtokencap/libtokencap.so"
-
#help
usage() {
- echo "Usage: $0 -o <target_output> -b <target_bin> [-t <timeout_sec>] [-p <LD_PRELOAD_PATH>]"
+ echo "Usage: $0 -o <target_output> -b <target_bin> -p <LD_PRELOAD_PATH> [-t <timeout_sec>]"
echo "Options:"
echo " -o Path to target output directory"
echo " -b Path to target program binary"
- echo " -t Timeout in seconds (default: 5)"
- echo " -p Path to LD_PRELOAD library (default: ${LD_PRELOAD_PATH})"
+ echo " -p Path to LD_PRELOAD library"
+ echo " -t Timeout in seconds"
exit 1
}
#parse cli options
-while getopts ":o:b:t:p:" opt; do
+while getopts ":o:b:p:t:" opt; do
case $opt in
o) target_output="$OPTARG" ;;
b) target_bin="$OPTARG" ;;
- t) timeout_sec="$OPTARG" ;;
p) LD_PRELOAD_PATH="$OPTARG" ;;
+ t) timeout_sec="$OPTARG" ;;
\?) echo "Invalid option: -$OPTARG" >&2; usage ;;
- :) echo "Option -$OPTARG requires an args" >&2; usage ;;
+ :) echo "Option -$OPTARG requires an argument." >&2; usage ;;
esac
done
#check options
-if [ -z "$target_output" ] || [ -z "$target_bin" ]; then
+if [ -z "$target_output" ] || [ -z "$target_bin" ] || [ -z "$LD_PRELOAD_PATH" ]; then
echo "Error: Missing mandatory opts" >&2
usage
fi