Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
vanhauser-thc committed Jul 11, 2023
1 parent ae4bbe6 commit fa02b39
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
20 changes: 20 additions & 0 deletions fuzzers/aflplusplus_frida/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
test -x "$1" || { echo Error: $1 is not an executable; exit 1; }
ADDR=0x`nm "$1"|grep -i 'T LLVMFuzzerTestOneInput'|awk '{print$1}'`
test -n "$ADDR" || { echo Error: $1 does not contain LLVMFuzzerTestOneInput; exit 1; }
export AFL_FRIDA_PERSISTENT_ADDR=$ADDR
export AFL_ENTRYPOINT=$ADDR
export AFL_FRIDA_PERSISTENT_HOOK=/out/frida_hook.so
export AFL_PATH=/out
export AFL_CMPLOG_ONLY_NEW=1
export AFL_DISABLE_TRIM=1
export AFL_NO_WARN_INSTABILITY=1
export AFL_FAST_CAL=1
export AFL_IGNORE_UNKNOWN_ENVS=1
export AFL_MAP_SIZE=2621440
cd seeds && {
for i in ../*.zip; do unzip -n $i; done
echo > empty_testcase.txt
cd ..
}
./afl-fuzz -O -i seeds -o corpus -c 0 -l 2 -- $1
2 changes: 2 additions & 0 deletions fuzzers/aflplusplus_frida/runner.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ FROM gcr.io/fuzzbench/base-image
RUN apt update -y && apt-get upgrade -y && \
apt-get install -y python3-pyelftools bc

RUN apt install -y unzip git gdb joe

# This makes interactive docker run painless:
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/out"
#ENV AFL_MAP_SIZE=2621440
Expand Down
22 changes: 22 additions & 0 deletions fuzzers/aflplusplus_qemu/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
test -x "$1" || { echo Error: $1 is not an executable; exit 1; }
ADDR=0x`nm "$1"|grep -i 'T afl_qemu_driver_stdin'|awk '{print$1}'`
test -n "$ADDR" || { echo Error: $1 does not contain afl_qemu_driver_stdin; exit 1; }
export AFL_ENTRYPOINT=$ADDR
export AFL_QEMU_PERSISTENT_ADDR=$ADDR
export AFL_QEMU_DRIVER_NO_HOOK=1
export AFL_QEMU_PERSISTENT_CNT=1000000
export AFL_FRIDA_PERSISTENT_HOOK=/out/frida_hook.so
export AFL_PATH=/out
export AFL_CMPLOG_ONLY_NEW=1
export AFL_DISABLE_TRIM=1
export AFL_NO_WARN_INSTABILITY=1
export AFL_FAST_CAL=1
export AFL_IGNORE_UNKNOWN_ENVS=1
export AFL_MAP_SIZE=2621440
cd seeds && {
for i in ../*.zip; do unzip -n $i; done
echo > empty_testcase.txt
cd ..
}
./afl-fuzz -O -i seeds -o corpus -c 0 -l 2 -- $1
2 changes: 2 additions & 0 deletions fuzzers/aflplusplus_qemu/runner.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

FROM gcr.io/fuzzbench/base-image

RUN apt install -y unzip git gdb joe

# This makes interactive docker runs painless:
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/out"
#ENV AFL_MAP_SIZE=2621440
Expand Down

0 comments on commit fa02b39

Please sign in to comment.