Skip to content

Commit

Permalink
winafl-cmin: add --skip-dry-run to skip the dry run if it failed and …
Browse files Browse the repository at this point in the history
…add support for AFL_NO_SINKHOLE to ease debugging
  • Loading branch information
Axel '0vercl0k' Souchet committed Aug 16, 2017
1 parent 9e73925 commit a725112
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions winafl-cmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ def _to_showmap_options(args, trace_name = '-'):
'''Takes the argparse namespace, and convert it to the list of options used
to invoke afl-showmap.exe'''
r = [
'afl-showmap.exe', '-q', '-o', trace_name
'afl-showmap.exe', '-o', trace_name
]

if os.getenv('AFL_NO_SINKHOLE') is None:
r.append('-q')

if args.time_limit > 0:
r.extend(['-t', '%d' % args.time_limit])
else:
Expand Down Expand Up @@ -267,6 +270,10 @@ def setup_argparse():
'-w', '--workers', type = int, default = multiprocessing.cpu_count(),
metavar = 'n', help = 'The number of worker processes (default: cpu count)'
)
group.add_argument(
'--skip-dry-run', action = 'store_true', default = False,
help = 'Skip the dry-run step even if it failed'
)
parser.add_argument(
'target_cmdline', nargs = argparse.REMAINDER,
help = 'target command line'
Expand Down Expand Up @@ -375,7 +382,9 @@ def main(argc, argv):
' Return codes matching? %r',
results[0].returncode == results[1].returncode
)
return 1

if not args.skip_dry_run:
return 1

logging.info('[+] OK, %d tuples recorded.', len(results[0].tuples))

Expand Down

0 comments on commit a725112

Please sign in to comment.