aboutsummaryrefslogtreecommitdiff
path: root/afl-showmap.c
diff options
context:
space:
mode:
authorDominik Maier <domenukk@gmail.com>2019-07-25 02:26:51 +0200
committerDominik Maier <domenukk@gmail.com>2019-07-25 02:26:51 +0200
commit00dc8a0ad577fc9219b2d4999c32005a8fc5cc3a (patch)
tree1e82752db9c2ac36f6862941ab71cedf52683415 /afl-showmap.c
parent9246f21f2a75fbe4113dd7340f870679a7953b24 (diff)
downloadafl++-00dc8a0ad577fc9219b2d4999c32005a8fc5cc3a.tar.gz
Added AFL-Unicorn mode
Diffstat (limited to 'afl-showmap.c')
-rw-r--r--afl-showmap.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/afl-showmap.c b/afl-showmap.c
index 1382e5f0..baf8352e 100644
--- a/afl-showmap.c
+++ b/afl-showmap.c
@@ -72,7 +72,6 @@ static volatile u8
child_timed_out, /* Child timed out? */
child_crashed; /* Child crashed? */
-
/* Classify tuple counts. Instead of mapping to individual bits, as in
afl-fuzz.c, we map to more user-friendly numbers between 1 and 8. */
@@ -405,7 +404,9 @@ static void usage(u8* argv0) {
" -t msec - timeout for each run (none)\n"
" -m megs - memory limit for child process (%u MB)\n"
- " -Q - use binary-only instrumentation (QEMU mode)\n\n"
+ " -Q - use binary-only instrumentation (QEMU mode)\n"
+ " -U - use Unicorn-based instrumentation (Unicorn mode)\n"
+ " (Not necessary, here for consistency with other afl-* tools)\n\n"
"Other settings:\n\n"
@@ -534,19 +535,18 @@ static char** get_qemu_argv(u8* own_loc, char** argv, int argc) {
}
-
/* Main entry point */
int main(int argc, char** argv) {
s32 opt;
- u8 mem_limit_given = 0, timeout_given = 0, qemu_mode = 0;
+ u8 mem_limit_given = 0, timeout_given = 0, qemu_mode = 0, unicorn_mode = 0;
u32 tcnt;
char** use_argv;
doc_path = access(DOC_PATH, F_OK) ? "docs" : DOC_PATH;
- while ((opt = getopt(argc,argv,"+o:m:t:A:eqZQbc")) > 0)
+ while ((opt = getopt(argc,argv,"+o:m:t:A:eqZQUbc")) > 0)
switch (opt) {
@@ -643,6 +643,14 @@ int main(int argc, char** argv) {
qemu_mode = 1;
break;
+ case 'U':
+
+ if (unicorn_mode) FATAL("Multiple -U options not supported");
+ if (!mem_limit_given) mem_limit = MEM_LIMIT_UNICORN;
+
+ unicorn_mode = 1;
+ break;
+
case 'b':
/* Secret undocumented mode. Writes output in raw binary format