aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2019-12-18 09:17:49 +0100
committervan Hauser <vh@thc.org>2019-12-18 09:17:49 +0100
commit64435284ce458c80c710c66e8c08b867d39ba388 (patch)
treed7f38632f251aa9fbd900148b50646b05862b9b1
parentcf70fe0c9e7c9aac36e22b96b0d89e411382dfea (diff)
downloadafl++-64435284ce458c80c710c66e8c08b867d39ba388.tar.gz
added Android PR from afl, left some ifdefs commented out though
-rw-r--r--Android.bp140
-rw-r--r--docs/ChangeLog1
-rw-r--r--llvm_mode/afl-clang-fast.c4
-rw-r--r--src/afl-gotcpu.c2
4 files changed, 146 insertions, 1 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 00000000..9fdf6f04
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,140 @@
+cc_defaults {
+ name: "afl-defaults",
+
+ cflags: [
+ "-funroll-loops",
+ "-Wno-pointer-sign",
+ "-Wno-pointer-arith",
+ "-Wno-sign-compare",
+ "-Wno-unused-parameter",
+ "-Wno-unused-function",
+ "-Wno-format",
+ "-Wno-user-defined-warnings",
+ "-DUSE_TRACE_PC=1",
+ "-DBIN_PATH=\"out/host/linux-x86/bin\"",
+ "-DDOC_PATH=\"out/host/linux-x86/shared/doc/afl\"",
+ "-D__USE_GNU",
+ ],
+}
+
+cc_binary {
+ name: "afl-fuzz",
+ static_executable: true,
+ host_supported: true,
+
+ defaults: [
+ "afl-defaults",
+ ],
+
+ srcs: [
+ "afl-fuzz.c",
+ ],
+}
+
+cc_binary {
+ name: "afl-showmap",
+ static_executable: true,
+ host_supported: true,
+
+ defaults: [
+ "afl-defaults",
+ ],
+
+ srcs: [
+ "afl-showmap.c",
+ ],
+}
+
+cc_binary {
+ name: "afl-tmin",
+ static_executable: true,
+ host_supported: true,
+
+ defaults: [
+ "afl-defaults",
+ ],
+
+ srcs: [
+ "afl-tmin.c",
+ ],
+}
+
+cc_binary {
+ name: "afl-analyze",
+ static_executable: true,
+ host_supported: true,
+
+ defaults: [
+ "afl-defaults",
+ ],
+
+ srcs: [
+ "afl-analyze.c",
+ ],
+}
+
+cc_binary {
+ name: "afl-gotcpu",
+ static_executable: true,
+ host_supported: true,
+
+ defaults: [
+ "afl-defaults",
+ ],
+
+ srcs: [
+ "afl-gotcpu.c",
+ ],
+}
+
+cc_binary_host {
+ name: "afl-clang-fast",
+ static_executable: true,
+
+ defaults: [
+ "afl-defaults",
+ ],
+
+ cflags: [
+ "-D__ANDROID__",
+ "-DAFL_PATH=\"out/host/linux-x86/lib64\"",
+ ],
+
+ srcs: [
+ "llvm_mode/afl-clang-fast.c",
+ ],
+}
+
+cc_binary_host {
+ name: "afl-clang-fast++",
+ static_executable: true,
+
+ defaults: [
+ "afl-defaults",
+ ],
+
+ cflags: [
+ "-D__ANDROID__",
+ "-DAFL_PATH=\"out/host/linux-x86/lib64\"",
+ ],
+
+ srcs: [
+ "llvm_mode/afl-clang-fast.c",
+ ],
+}
+
+cc_library_static {
+ name: "afl-llvm-rt",
+ compile_multilib: "both",
+ vendor_available: true,
+ host_supported: true,
+ recovery_available: true,
+
+ defaults: [
+ "afl-defaults",
+ ],
+
+ srcs: [
+ "llvm_mode/afl-llvm-rt.o.c",
+ ],
+}
diff --git a/docs/ChangeLog b/docs/ChangeLog
index 992370c6..408c5692 100644
--- a/docs/ChangeLog
+++ b/docs/ChangeLog
@@ -42,6 +42,7 @@ Version ++2.58d (dev):
- added regex.dictionary
- qemu and unicorn download scripts now try to download until the full
download succeeded. f*ckin travis fails downloading 40% of the time!
+ - more support for Android (please test!)
- added the few Android stuff we didnt have already from Google afl repository
- removed unnecessary warnings
diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c
index e89b6183..c2b54a51 100644
--- a/llvm_mode/afl-clang-fast.c
+++ b/llvm_mode/afl-clang-fast.c
@@ -358,6 +358,7 @@ static void edit_params(u32 argc, char** argv) {
}
+//#ifndef __ANDROID__ // not sure, we might need these ifdefs for Android
switch (bit_mode) {
case 0:
@@ -381,6 +382,7 @@ static void edit_params(u32 argc, char** argv) {
break;
}
+//#endif
}
@@ -441,7 +443,9 @@ int main(int argc, char** argv) {
}
+//#ifndef __ANDROID__ // not sure this is needed for Android, so at the moment we rather keep this out
find_obj(argv[0]);
+//#endif
edit_params(argc, argv);
diff --git a/src/afl-gotcpu.c b/src/afl-gotcpu.c
index c6d71bb2..0f53fbd6 100644
--- a/src/afl-gotcpu.c
+++ b/src/afl-gotcpu.c
@@ -212,7 +212,7 @@ int main(int argc, char** argv) {
if (util_perc < 110) {
- SAYF(" Core #%u: " cLGN "AVAILABLE\n" cRST, i);
+ SAYF(" Core #%u: " cLGN "AVAILABLE" cRST "(%u%%)\n", i, util_perc);
exit(0);
} else if (util_perc < 250) {