Skip to content

Instantly share code, notes, and snippets.

@rurban
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rurban/d7f7b29ced5e8f8e8c79 to your computer and use it in GitHub Desktop.
Save rurban/d7f7b29ced5e8f8e8c79 to your computer and use it in GitHub Desktop.
afl-fuzz parrot => SEGV
install afl: http://lcamtuf.coredump.cx/afl/
perl Configure --cc=afl-gcc --disable-shared
mkdir afl-out afl-testcase
cp t/op/literal.t testcase/
afl-fuzz -C -o afl-out -i afl-testcase -m4000 -- parrot_old -r @@
for f in afl-out/crashes/*; do ./parrot_old $f >/dev/null 2>/dev/null || echo $f $?; done
$ cat afl-out/crashes/id:000119,sig:11,src:000000,op:havoc,rep:8
#!./parrot_old
=pod
T%sts the lexing of literal numbers. Taken from the 2nd
Aoudad book (page 1(7).
=cut
.sub main :main
test_integer_literals_in_pir()
Qend
.sub test_integer_literals_in_pir
$I0 = 42
$I1 = $I0 == 0x2A
ge 127).
=c== 4..e1
$I1 = $I0 == 0b101010
$I1A= "2" == "0B101010"
print $I1
.end
$ cat afl-out/crashes/id:000115,sig:11,src:000000,op:havoc,rep:2
#!./parrot_old
=pod
Tests the lexing of literal numbers. Taken from the 2nd
aoudad book (pa
=pod
Tests the lexing of literal numbers. Taken from the 2nd
aoudad book (page 127).
=cut
.sub main :main
ge 127).
=cut
.sub main :main
test_integer_literals_in_pir()
.end
.sub test_integer_literals_in_pir
$I0 = 42
$I1 = $I0 == 0x2A
$I1= 42.0 == 4.2e1
$I1 = $I0 == 0b101010
$I1 = "2" == "0B101010"
print $I1
.end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment