Closed hexcoder- closed 3 years ago
made target versions with -pie
and -no_pie
:
nm test-instr_pie | grep "T main"
00000000000009ec T main
nm test-instr_nopie | grep "T main"
0000000000400834 T main
and ran them with printf 1 | AFL_DEBUG=1 AFL_QEMU_DEBUG_MAPS=1 ../afl-qemu-trace
printf 1 | AFL_DEBUG=1 AFL_QEMU_DEBUG_MAPS=1 ../afl-qemu-trace ./test-instr_nopie
AFL forkserver entrypoint: 0x400740
AFL forkserver entrypoint: 0x400740
400000-401000 r-xp 00000000 b3:02 436992 /home/heiko/AFLplusplus/test/test-instr_nopie
401000-410000 ---p 00000000 00:00 0
410000-411000 r--p 00000000 b3:02 436992 /home/heiko/AFLplusplus/test/test-instr_nopie
411000-412000 rw-p 00001000 b3:02 436992 /home/heiko/AFLplusplus/test/test-instr_nopie
5500000000-5500001000 ---p 00000000 00:00 0
5500001000-5500801000 rw-p 00000000 00:00 0 [stack]
5500801000-5500820000 r-xp 00000000 b3:02 120119 /usr/lib/ld-2.30.so
5500820000-5500830000 ---p 00000000 00:00 0
5500830000-5500831000 r--p 0001f000 b3:02 120119 /usr/lib/ld-2.30.so
5500831000-5500833000 rw-p 00020000 b3:02 120119 /usr/lib/ld-2.30.so
5500850000-55009a5000 r-xp 00000000 b3:02 120017 /usr/lib/libc-2.30.so
55009a5000-55009b4000 ---p 00155000 b3:02 120017 /usr/lib/libc-2.30.so
55009b4000-55009b7000 r--p 00154000 b3:02 120017 /usr/lib/libc-2.30.so
55009b7000-55009ba000 rw-p 00157000 b3:02 120017 /usr/lib/libc-2.30.so
55009ba000-55009bf000 rw-p 00000000 00:00 0
Debug: Sending status c001ffff
Pretty sure that is a one!
printf 1 | AFL_DEBUG=1 AFL_QEMU_DEBUG_MAPS=1 ../afl-qemu-trace ./test-instr_pie
AFL forkserver entrypoint: 0x55000008e0
AFL forkserver entrypoint: 0x55000008e0
5500000000-5500001000 r-xp 00000000 b3:02 437013 /home/heiko/AFLplusplus/test/test-instr_pie
5500001000-5500011000 ---p 00000000 00:00 0
5500011000-5500012000 r--p 00001000 b3:02 437013 /home/heiko/AFLplusplus/test/test-instr_pie
5500012000-5500013000 rw-p 00002000 b3:02 437013 /home/heiko/AFLplusplus/test/test-instr_pie
5501013000-5501014000 ---p 00000000 00:00 0
5501014000-5501814000 rw-p 00000000 00:00 0 [stack]
5501814000-5501833000 r-xp 00000000 b3:02 120119 /usr/lib/ld-2.30.so
5501833000-5501843000 ---p 00000000 00:00 0
5501843000-5501844000 r--p 0001f000 b3:02 120119 /usr/lib/ld-2.30.so
5501844000-5501846000 rw-p 00020000 b3:02 120119 /usr/lib/ld-2.30.so
5501863000-55019b8000 r-xp 00000000 b3:02 120017 /usr/lib/libc-2.30.so
55019b8000-55019c7000 ---p 00155000 b3:02 120017 /usr/lib/libc-2.30.so
55019c7000-55019ca000 r--p 00154000 b3:02 120017 /usr/lib/libc-2.30.so
55019ca000-55019cd000 rw-p 00157000 b3:02 120017 /usr/lib/libc-2.30.so
55019cd000-55019d2000 rw-p 00000000 00:00 0
Debug: Sending status c001ffff
Pretty sure that is a one!
Then ran them with
AFL_ENTRYPOINT=0x400740 ../afl-fuzz -Q -i in -o out -- ./test-instr_pie
and
AFL_ENTRYPOINT=0x55000008e0 ../afl-fuzz -Q -i in -o out -- ./test-instr_pie
which worked.
So it seems best to replace nm test-instr_pie | grep "T main"
with an run of afl-qemu-trace
in the test script.
I checked the same procedure on Linux 64 bit, worked there too.
That works with 32 bit on i386 and arm too.
I would say just make the change, you tested it.
Yes, will also check for qemu persistent and then commit.
ok, test case for qemu AFL_ENTRYPOINT is ok now with commit https://github.com/AFLplusplus/AFLplusplus/commit/1a713ff4205672bf1bb6f444e9e8ada39472471c.
The test for qemu AFL_ENTRYPOINT from the test suite fails with current dev-Branch