test.sh fix

This commit is contained in:
van Hauser
2020-03-21 21:42:32 +01:00
parent c6db05c5ae
commit f8d717d195
2 changed files with 8 additions and 7 deletions

View File

@ -303,8 +303,6 @@ u8 calibrate_case(afl_state_t *afl, struct queue_entry *q, u8 *use_mem,
trying to calibrate already-added finds. This helps avoid trouble due trying to calibrate already-added finds. This helps avoid trouble due
to intermittent latency. */ to intermittent latency. */
runcnt++;
if (!from_queue || afl->resuming_fuzz) if (!from_queue || afl->resuming_fuzz)
use_tmout = MAX(afl->fsrv.exec_tmout + CAL_TMOUT_ADD, use_tmout = MAX(afl->fsrv.exec_tmout + CAL_TMOUT_ADD,
afl->fsrv.exec_tmout * CAL_TMOUT_PERC / 100); afl->fsrv.exec_tmout * CAL_TMOUT_PERC / 100);
@ -440,6 +438,8 @@ abort_calibration:
if (!first_run) show_stats(afl); if (!first_run) show_stats(afl);
runcnt++;
return fault; return fault;
} }

View File

@ -653,7 +653,7 @@ test -e ../libradamsa.so && {
$ECHO "$BLUE[*] Testing: qemu_mode" $ECHO "$BLUE[*] Testing: qemu_mode"
test -e ../afl-qemu-trace && { test -e ../afl-qemu-trace && {
gcc -no-pie -fPIE -o test-instr ../test-instr.c gcc -no-pie -o test-instr ../test-instr.c
gcc -o test-compcov test-compcov.c gcc -o test-compcov test-compcov.c
test -e test-instr -a -e test-compcov && { test -e test-instr -a -e test-compcov && {
{ {
@ -678,8 +678,8 @@ test -e ../afl-qemu-trace && {
$ECHO "$GREY[*] running afl-fuzz for qemu_mode AFL_ENTRYPOINT, this will take approx 6 seconds" $ECHO "$GREY[*] running afl-fuzz for qemu_mode AFL_ENTRYPOINT, this will take approx 6 seconds"
{ {
{ {
export AFL_ENTRYPOINT=`expr 0x4$(nm test-instr | grep "T main" | awk '{print $1}' )` export AFL_ENTRYPOINT=`expr 0x$(nm test-instr | grep "T main" | awk '{print $1}' )`
#$ECHO AFL_ENTRYPOINT=$AFL_ENTRYPOINT - $(nm test-instr | grep "T main") - $(file ./test-instr) $ECHO AFL_ENTRYPOINT=$AFL_ENTRYPOINT - $(nm test-instr | grep "T main") - $(file ./test-instr)
../afl-fuzz -m ${MEM_LIMIT} -V2 -Q -i in -o out -- ./test-instr ../afl-fuzz -m ${MEM_LIMIT} -V2 -Q -i in -o out -- ./test-instr
unset AFL_ENTRYPOINT unset AFL_ENTRYPOINT
} >>errors 2>&1 } >>errors 2>&1
@ -727,9 +727,10 @@ test -e ../afl-qemu-trace && {
test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc" -o "$SYS" = "aarch64" -o ! "${SYS%%arm*}" && { test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" -o "$SYS" = "i86pc" -o "$SYS" = "aarch64" -o ! "${SYS%%arm*}" && {
$ECHO "$GREY[*] running afl-fuzz for persistent qemu_mode, this will take approx 10 seconds" $ECHO "$GREY[*] running afl-fuzz for persistent qemu_mode, this will take approx 10 seconds"
{ {
export AFL_QEMU_PERSISTENT_ADDR=`expr 0x4$(nm test-instr | grep "T main" | awk '{print $1}' )` export AFL_QEMU_PERSISTENT_ADDR=`expr 0x$(nm test-instr | grep "T main" | awk '{print $1}' | sed 's/0*//' )`
export AFL_QEMU_PERSISTENT_GPR=1 export AFL_QEMU_PERSISTENT_GPR=1
#$ECHO "Info: AFL_QEMU_PERSISTENT_ADDR=$AFL_QEMU_PERSISTENT_ADDR <= $(nm test-instr | grep "T main" | awk '{print $1}')" $ECHO "Info: AFL_QEMU_PERSISTENT_ADDR=$AFL_QEMU_PERSISTENT_ADDR <= $(nm test-instr | grep "T main" | awk '{print $1}')"
env|grep AFL_|sort
file test-instr file test-instr
../afl-fuzz -m ${MEM_LIMIT} -V10 -Q -i in -o out -- ./test-instr ../afl-fuzz -m ${MEM_LIMIT} -V10 -Q -i in -o out -- ./test-instr
unset AFL_QEMU_PERSISTENT_ADDR unset AFL_QEMU_PERSISTENT_ADDR