Skip to content

Commit

Permalink
Update afl-tmin.c
Browse files Browse the repository at this point in the history
allow the winafl library path to be specified by -w in afl-tmin
  • Loading branch information
cvspvr authored Apr 8, 2024
1 parent 4e08dbc commit 6282106
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions afl-tmin.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ static HANDLE child_handle,
child_thread_handle;
static char *dynamorio_dir;
static char *client_params;
static char *winafl_dll_path;
int fuzz_iterations_max = 1, fuzz_iterations_current;

static CRITICAL_SECTION critical_section;
Expand Down Expand Up @@ -488,8 +489,8 @@ static void create_target_process(char** argv) {
} else {
pidfile = alloc_printf("childpid_%s.txt", fuzzer_id);
cmd = alloc_printf(
"%s\\drrun.exe -pidfile %s -no_follow_children -c winafl.dll %s -fuzz_iterations 1 -fuzzer_id %s -- %s",
dynamorio_dir, pidfile, client_params, fuzzer_id, target_cmd
"%s\\drrun.exe -pidfile %s -no_follow_children -c %s %s -fuzz_iterations 1 -fuzzer_id %s -- %s",
dynamorio_dir, pidfile, winafl_dll_path, client_params, fuzzer_id, target_cmd
);
}

Expand Down Expand Up @@ -1352,6 +1353,7 @@ int main(int argc, char** argv) {
optind = 1;
dynamorio_dir = NULL;
client_params = NULL;
winafl_dll_path = NULL;

#ifdef USE_COLOR
enable_ansi_console();
Expand All @@ -1361,7 +1363,7 @@ int main(int argc, char** argv) {
SAYF("Based on WinAFL " cBRI VERSION cRST " by <[email protected]>\n");
SAYF("Based on AFL " cBRI VERSION cRST " by <[email protected]>\n");

while ((opt = getopt(argc,argv,"+i:o:f:m:t:B:D:l:xeQYVNMS")) > 0)
while ((opt = getopt(argc,argv,"+i:o:w:f:m:t:B:D:l:xeQYVNMS")) > 0)

switch (opt) {

Expand Down Expand Up @@ -1389,6 +1391,12 @@ int main(int argc, char** argv) {
}
break;

case 'w': /* winafl.dll path */

if (winafl_dll_path) FATAL("Multiple -w options not supported");
winafl_dll_path = optarg;
break;

case 'f':

if (prog_in) FATAL("Multiple -f options not supported");
Expand Down

0 comments on commit 6282106

Please sign in to comment.