From f367728c4435670caf2e9cc5acad257e7766cc65 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Tue, 28 May 2019 16:40:24 +0200 Subject: afl++ 2.52c initial commit --- test-instr.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 test-instr.c (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c new file mode 100644 index 00000000..09a1c9f7 --- /dev/null +++ b/test-instr.c @@ -0,0 +1,37 @@ +/* + american fuzzy lop - a trivial program to test the build + -------------------------------------------------------- + + Written and maintained by Michal Zalewski + + Copyright 2014 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + */ + +#include +#include +#include + +int main(int argc, char** argv) { + + char buf[8]; + + if (read(0, buf, 8) < 1) { + printf("Hum?\n"); + exit(1); + } + + if (buf[0] == '0') + printf("Looks like a zero to me!\n"); + else + printf("A non-zero value? How quaint!\n"); + + exit(0); + +} -- cgit v1.2.3 From db3cc11195af0dfae7c4bfcac78c75f48fbaa430 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Mon, 17 Jun 2019 18:47:13 +0200 Subject: minor documentation update --- test-instr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 09a1c9f7..1b978c55 100644 --- a/test-instr.c +++ b/test-instr.c @@ -22,15 +22,17 @@ int main(int argc, char** argv) { char buf[8]; - if (read(0, buf, 8) < 1) { + if (read(0, buf, sizeof(buf)) < 1) { printf("Hum?\n"); exit(1); } if (buf[0] == '0') printf("Looks like a zero to me!\n"); + else if (buf[0] == '1') + printf("Pretty sure that is a one!\n"); else - printf("A non-zero value? How quaint!\n"); + printf("Neither one or zero? How quaint!\n"); exit(0); -- cgit v1.2.3 From 41d2e7d6b6ac1bab20f73e1e023c8450bbfc657e Mon Sep 17 00:00:00 2001 From: van Hauser Date: Fri, 9 Aug 2019 00:34:26 +0200 Subject: minor corrections --- test-instr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 1b978c55..9107f15e 100644 --- a/test-instr.c +++ b/test-instr.c @@ -20,9 +20,12 @@ int main(int argc, char** argv) { - char buf[8]; + char buff[8]; + char *buf = buff; - if (read(0, buf, sizeof(buf)) < 1) { + if (argc > 1) + buf = argv[1]; + else if (read(0, buf, sizeof(buf)) < 1) { printf("Hum?\n"); exit(1); } -- cgit v1.2.3 From 0e59a591693901ec6a69c7de2e9de2dcca52c101 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Tue, 27 Aug 2019 13:31:35 +0200 Subject: include and src folders --- test-instr.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 test-instr.c (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c deleted file mode 100644 index 9107f15e..00000000 --- a/test-instr.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - american fuzzy lop - a trivial program to test the build - -------------------------------------------------------- - - Written and maintained by Michal Zalewski - - Copyright 2014 Google Inc. All rights reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at: - - http://www.apache.org/licenses/LICENSE-2.0 - - */ - -#include -#include -#include - -int main(int argc, char** argv) { - - char buff[8]; - char *buf = buff; - - if (argc > 1) - buf = argv[1]; - else if (read(0, buf, sizeof(buf)) < 1) { - printf("Hum?\n"); - exit(1); - } - - if (buf[0] == '0') - printf("Looks like a zero to me!\n"); - else if (buf[0] == '1') - printf("Pretty sure that is a one!\n"); - else - printf("Neither one or zero? How quaint!\n"); - - exit(0); - -} -- cgit v1.2.3 From 4adca18337a5036d93d78e0522bcaa066e0a85b9 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Tue, 27 Aug 2019 15:04:27 +0200 Subject: afl-as is now alive --- test-instr.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 test-instr.c (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c new file mode 100644 index 00000000..9107f15e --- /dev/null +++ b/test-instr.c @@ -0,0 +1,42 @@ +/* + american fuzzy lop - a trivial program to test the build + -------------------------------------------------------- + + Written and maintained by Michal Zalewski + + Copyright 2014 Google Inc. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at: + + http://www.apache.org/licenses/LICENSE-2.0 + + */ + +#include +#include +#include + +int main(int argc, char** argv) { + + char buff[8]; + char *buf = buff; + + if (argc > 1) + buf = argv[1]; + else if (read(0, buf, sizeof(buf)) < 1) { + printf("Hum?\n"); + exit(1); + } + + if (buf[0] == '0') + printf("Looks like a zero to me!\n"); + else if (buf[0] == '1') + printf("Pretty sure that is a one!\n"); + else + printf("Neither one or zero? How quaint!\n"); + + exit(0); + +} -- cgit v1.2.3 From b24639d0113e15933e749ea0f96abe3f25a134a0 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Mon, 2 Sep 2019 18:49:43 +0200 Subject: run code formatter --- test-instr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 9107f15e..71838462 100644 --- a/test-instr.c +++ b/test-instr.c @@ -20,14 +20,16 @@ int main(int argc, char** argv) { - char buff[8]; - char *buf = buff; + char buff[8]; + char* buf = buff; if (argc > 1) buf = argv[1]; else if (read(0, buf, sizeof(buf)) < 1) { + printf("Hum?\n"); exit(1); + } if (buf[0] == '0') @@ -40,3 +42,4 @@ int main(int argc, char** argv) { exit(0); } + -- cgit v1.2.3 From c75abda5711d19340688be1dc8a9af7cd4ea0b7a Mon Sep 17 00:00:00 2001 From: van Hauser Date: Thu, 17 Oct 2019 09:30:50 +0200 Subject: return instead of exit in test-instr --- test-instr.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 71838462..3750b1b5 100644 --- a/test-instr.c +++ b/test-instr.c @@ -23,15 +23,19 @@ int main(int argc, char** argv) { char buff[8]; char* buf = buff; - if (argc > 1) + // we support command line parameter and stdin + if (argc > 1) { + buf = argv[1]; - else if (read(0, buf, sizeof(buf)) < 1) { + + } else if (read(0, buf, sizeof(buf)) < 1) { printf("Hum?\n"); - exit(1); + return 1; } + // we support three input cases (plus a 4th if stdin is used but there is no input) if (buf[0] == '0') printf("Looks like a zero to me!\n"); else if (buf[0] == '1') @@ -39,7 +43,6 @@ int main(int argc, char** argv) { else printf("Neither one or zero? How quaint!\n"); - exit(0); + return 0; } - -- cgit v1.2.3 From 8a786377196fbaafeecbca17fad66ea1e76c7de2 Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Sat, 19 Oct 2019 16:19:46 +0200 Subject: add gcc_plugin to code formatter and run it --- test-instr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 3750b1b5..2450dbf4 100644 --- a/test-instr.c +++ b/test-instr.c @@ -35,7 +35,8 @@ int main(int argc, char** argv) { } - // we support three input cases (plus a 4th if stdin is used but there is no input) + // we support three input cases (plus a 4th if stdin is used but there is no + // input) if (buf[0] == '0') printf("Looks like a zero to me!\n"); else if (buf[0] == '1') @@ -46,3 +47,4 @@ int main(int argc, char** argv) { return 0; } + -- cgit v1.2.3 From c83e8e1e6255374b085292ba8673efdca7388d76 Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Sat, 19 Oct 2019 18:23:01 +0200 Subject: Remove lcamtuf's old email from Google (not valid anymore), also remove maintainance from him. --- test-instr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 2450dbf4..161bdb8e 100644 --- a/test-instr.c +++ b/test-instr.c @@ -2,7 +2,7 @@ american fuzzy lop - a trivial program to test the build -------------------------------------------------------- - Written and maintained by Michal Zalewski + Written by Michal Zalewski Copyright 2014 Google Inc. All rights reserved. -- cgit v1.2.3 From 878a80de7f5f4fb0733bd48c974b498c0010514e Mon Sep 17 00:00:00 2001 From: van Hauser Date: Mon, 30 Dec 2019 22:01:36 +0100 Subject: critical bugfix for afl-tmin --- test-instr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 161bdb8e..0b58eec0 100644 --- a/test-instr.c +++ b/test-instr.c @@ -27,6 +27,7 @@ int main(int argc, char** argv) { if (argc > 1) { buf = argv[1]; + printf("Input %s - ", buf); } else if (read(0, buf, sizeof(buf)) < 1) { -- cgit v1.2.3 From 67cbeeb395c7e0aa8820e79c92f5e8e1322f8be0 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Mon, 6 Jan 2020 11:46:14 +0100 Subject: added ++ to copyright notes --- test-instr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 161bdb8e..eaa71440 100644 --- a/test-instr.c +++ b/test-instr.c @@ -1,5 +1,5 @@ /* - american fuzzy lop - a trivial program to test the build + american fuzzy lop++ - a trivial program to test the build -------------------------------------------------------- Written by Michal Zalewski -- cgit v1.2.3 From b2bee5c32a4bd4d7b063f1189ac71a9658114f71 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Mon, 6 Jan 2020 16:17:23 +0100 Subject: moar moar copyrights --- test-instr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 7d59fd9c..ddfd3695 100644 --- a/test-instr.c +++ b/test-instr.c @@ -2,9 +2,10 @@ american fuzzy lop++ - a trivial program to test the build -------------------------------------------------------- - Written by Michal Zalewski + Originally written by Michal Zalewski Copyright 2014 Google Inc. All rights reserved. + Copyright 2019-2020 AFLplusplus Project. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. -- cgit v1.2.3 From 581097d58d6f8de05e05eec74344053bd74c3145 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Mon, 9 Mar 2020 11:39:12 +0100 Subject: expanded test-instr to also work with input files via "-f @@" and changed the test.sh values --- test-instr.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index ddfd3695..f96db868 100644 --- a/test-instr.c +++ b/test-instr.c @@ -18,22 +18,39 @@ #include #include #include +#include +#include +#include +#include int main(int argc, char** argv) { + int fd = 0; char buff[8]; char* buf = buff; // we support command line parameter and stdin - if (argc > 1) { + if (argc == 2) { buf = argv[1]; printf("Input %s - ", buf); - } else if (read(0, buf, sizeof(buf)) < 1) { + } else { - printf("Hum?\n"); - return 1; + if (argc >= 3 && strcmp(argv[1], "-f") == 0) + if ((fd = open(argv[2], O_RDONLY)) < 0) { + + fprintf(stderr, "Error: unable to open %s\n", argv[2]); + exit(-1); + + } + + if (read(fd, buf, sizeof(buf)) < 1) { + + printf("Hum?\n"); + return 1; + + } } -- cgit v1.2.3 From cc1d6b33b1524d52b21a6e9794ee6b0d6a2a9d50 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Tue, 10 Mar 2020 22:04:05 +0100 Subject: unified pointer placement --- test-instr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index f96db868..579577a4 100644 --- a/test-instr.c +++ b/test-instr.c @@ -23,11 +23,11 @@ #include #include -int main(int argc, char** argv) { +int main(int argc, char **argv) { int fd = 0; char buff[8]; - char* buf = buff; + char *buf = buff; // we support command line parameter and stdin if (argc == 2) { -- cgit v1.2.3 From 5efd306f7bd2a87ff4b628d6034ba2bcea4e022b Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Tue, 7 Apr 2020 10:50:21 +0200 Subject: snapshot() in llvm mode --- test-instr.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 579577a4..84ac0036 100644 --- a/test-instr.c +++ b/test-instr.c @@ -1,18 +1,13 @@ /* american fuzzy lop++ - a trivial program to test the build -------------------------------------------------------- - Originally written by Michal Zalewski - Copyright 2014 Google Inc. All rights reserved. Copyright 2019-2020 AFLplusplus Project. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: - http://www.apache.org/licenses/LICENSE-2.0 - */ #include -- cgit v1.2.3 From 981ffb27a8a166b51a06d57fce044ed1eaf1aa62 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Mon, 1 Feb 2021 12:01:23 +0100 Subject: making AFL_MAP_SIZE obsolete --- test-instr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 84ac0036..00799103 100644 --- a/test-instr.c +++ b/test-instr.c @@ -32,7 +32,8 @@ int main(int argc, char **argv) { } else { - if (argc >= 3 && strcmp(argv[1], "-f") == 0) + if (argc >= 3 && strcmp(argv[1], "-f") == 0) { + if ((fd = open(argv[2], O_RDONLY)) < 0) { fprintf(stderr, "Error: unable to open %s\n", argv[2]); @@ -40,6 +41,8 @@ int main(int argc, char **argv) { } + } + if (read(fd, buf, sizeof(buf)) < 1) { printf("Hum?\n"); -- cgit v1.2.3 From 166c8f93b5166087255265f9a00fd8babbd432d7 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Thu, 18 Mar 2021 21:34:12 +0100 Subject: test-dlopen llvm test --- test-instr.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 00799103..4129a5b4 100644 --- a/test-instr.c +++ b/test-instr.c @@ -18,6 +18,10 @@ #include #include +#ifdef TEST_SHARED_OBJECT +#define main main_exported +#endif + int main(int argc, char **argv) { int fd = 0; -- cgit v1.2.3 From 2102264acf5c271b7560a82771b3af8136af9354 Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Fri, 19 Mar 2021 16:06:06 +0100 Subject: fix for new llvm 13 change --- test-instr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 4129a5b4..13d4eb93 100644 --- a/test-instr.c +++ b/test-instr.c @@ -19,7 +19,7 @@ #include #ifdef TEST_SHARED_OBJECT -#define main main_exported + #define main main_exported #endif int main(int argc, char **argv) { -- cgit v1.2.3 From 9325a4fcbb8eb4ed1d71f93de5301bf1a9a68253 Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Sat, 6 Nov 2021 10:28:22 +0100 Subject: http->https --- test-instr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index 13d4eb93..eaae50ef 100644 --- a/test-instr.c +++ b/test-instr.c @@ -7,7 +7,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 */ #include -- cgit v1.2.3 From e1082f2548a2497690d48a23b366362d478afdb6 Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Sat, 1 Jan 2022 00:49:17 +0100 Subject: welcome 2022 --- test-instr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test-instr.c') diff --git a/test-instr.c b/test-instr.c index eaae50ef..b2caa1fe 100644 --- a/test-instr.c +++ b/test-instr.c @@ -3,7 +3,7 @@ -------------------------------------------------------- Originally written by Michal Zalewski Copyright 2014 Google Inc. All rights reserved. - Copyright 2019-2020 AFLplusplus Project. All rights reserved. + Copyright 2019-2022 AFLplusplus Project. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: -- cgit v1.2.3