-h, --help Prints this message.
-d, --dump-coverage Dump accumulated coverage information.
-m, --merge Minimize generated corpus.
- -i, --install-deps Install required utilities on device.
-s, --serial SERIAL_NUMBER Send all sdb command to device with specified
serial number.
-t, --test-input TEST_INPUT Push specified input to device and use it as
declare -A LIB_DIRS=([x86_64]="usr/lib64"
[i686]="usr/lib")
-INSTALL_DEPS=0
-
########################################################
# GLOBAL OPTIONS PARSING
########################################################
LIBFUZZER_OPTS[jobs]=1
shift
;;
- '-i'|'--install-deps')
- INSTALL_DEPS=1
- shift
- ;;
'-s'|'--serial')
SDB_CMD="sdb ${1} ${2}"
shift 2
prepare_device
-# check and install, if needed, necessary dependencies
-printf "\nChecking dependencies...\n"
-check_and_install_deps "${INSTALL_DEPS}" 'base' 'binutils'
-
# get the sanitized libraries directory (used in LD_PRELOAD and LD_LIBRARY_PATH)
arch=$(sdb_shell_verbose uname -m)
lib_dir="/sanitized/${LIB_DIRS[$arch]}"
# check which sanitizer should be used
detect_sanitizer_sh=/tmp/detect_sanitizer.sh
sanitizer=$(sdb_shell_verbose echo \
-"if nm -D ${target_bin} | grep __asan_ > /dev/null; then
+"if ldd ${target_bin} | grep libasan.so > /dev/null; then
echo 'ASan'
-elif nm -D ${target_bin} | grep __ubsan_ > /dev/null; then
+elif ldd ${target_bin} | grep libubsan.so > /dev/null; then
echo 'UBSan'
else
echo ''