about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2021-05-04 20:42:24 +0200
committerhexcoder- <heiko@hexco.de>2021-05-04 20:42:24 +0200
commitb35e6deb09c813fbcbd6d5faf84f5b3e395458d0 (patch)
tree051ab2c8c74aca258629fe70d64a59197c4fc2c1 /test
parentdd96f01a16a402f2618481b811a7fdd8496c79b2 (diff)
downloadafl++-b35e6deb09c813fbcbd6d5faf84f5b3e395458d0.tar.gz
fix persistent mode (64-bit)
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-frida-mode.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/test-frida-mode.sh b/test/test-frida-mode.sh
index 8a22454b..63b9e162 100755
--- a/test/test-frida-mode.sh
+++ b/test/test-frida-mode.sh
@@ -14,7 +14,7 @@ test -z "$AFL_CC" && {
 }
 
 test -e ../afl-frida-trace.so && {
-  cc -pie -fPIE -o test-instr ../test-instr.c
+  cc -no-pie -o test-instr ../test-instr.c
   cc -o test-compcov test-compcov.c
   test -e test-instr -a -e test-compcov && {
     {
@@ -41,7 +41,7 @@ test -e ../afl-frida-trace.so && {
         {
           ../afl-fuzz -m none -V10 -O -c 0 -i in -o out -- ./test-compcov >>errors 2>&1
         } >>errors 2>&1
-        test -n "$( ls out/default/queue/id:000001* 2>/dev/null )" && {
+        test -n "$( ls out/default/queue/id:000003* 2>/dev/null )" && {
           $ECHO "$GREEN[+] afl-fuzz is working correctly with frida_mode cmplog"
         } || {
           echo CUT------------------------------------------------------------------CUT
@@ -58,7 +58,15 @@ test -e ../afl-frida-trace.so && {
       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 frida_mode, this will take approx 10 seconds"
         {
+          if file test-instr | grep -q "32-bit"; then
+          else
+            export AFL_FRIDA_PERSISTENT_ADDR=0x`nm test-instr | grep "T main" | awk '{print $1}'`
+          fi
+          $ECHO "Info: AFL_FRIDA_PERSISTENT_ADDR=$AFL_FRIDA_PERSISTENT_ADDR <= $(nm test-instr | grep "T main" | awk '{print $1}')"
+          env|grep AFL_|sort
+          file test-instr
           ../afl-fuzz -m ${MEM_LIMIT} -V10 -O -i in -o out -- ./test-instr
+          unset AFL_FRIDA_PERSISTENT_ADDR
         } >>errors 2>&1
         test -n "$( ls out/default/queue/id:000002* 2>/dev/null )" && {
           $ECHO "$GREEN[+] afl-fuzz is working correctly with persistent frida_mode"