@@ -285,7 +285,15 @@ def process_afl_test_cases(cargs: argparse.Namespace) -> bool:
285285 cov_paths ["log_file" ],
286286 cargs ,
287287 )
288- time .sleep (cargs .sleep )
288+ try :
289+ time .sleep (cargs .sleep )
290+ except KeyboardInterrupt :
291+ log (
292+ b"[!] Stopping live collection due to user interrupt" ,
293+ cov_paths ["log_file" ],
294+ cargs ,
295+ )
296+ break
289297 continue
290298 else :
291299 logr (
@@ -1170,9 +1178,9 @@ def validate_cargs(cargs: argparse.Namespace) -> bool:
11701178 print ("[*] Must set --src-file in --line-search mode" )
11711179 return False
11721180
1173- if cargs .live and not cargs .ignore_core_pattern :
1174- if not check_core_pattern ():
1175- return False
1181+ # if cargs.live and not cargs.ignore_core_pattern:
1182+ # if not check_core_pattern():
1183+ # return False
11761184
11771185 if not cargs .live and not is_dir (cargs .afl_fuzzing_dir ):
11781186 print (
@@ -1309,20 +1317,20 @@ def stop_afl(cargs: argparse.Namespace) -> bool:
13091317 return rv
13101318
13111319
1312- def check_core_pattern () -> bool :
1313- rv = True
1314-
1315- core_pattern_file = "/proc/sys/kernel/core_pattern"
1316-
1317- # check /proc/sys/kernel/core_pattern to see if afl-fuzz will
1318- # accept it
1319- if os .path .exists (core_pattern_file ):
1320- with open (core_pattern_file , "rb" ) as f :
1321- if f .readline ().rstrip ()[0 ] == b"|" :
1322- # same logic as implemented by afl-fuzz itself
1323- print ("[*] afl-fuzz requires 'echo core >%s'" % core_pattern_file )
1324- rv = False
1325- return rv
1320+ # def check_core_pattern() -> bool:
1321+ # rv = True
1322+ #
1323+ # core_pattern_file = "/proc/sys/kernel/core_pattern"
1324+ #
1325+ # # check /proc/sys/kernel/core_pattern to see if afl-fuzz will
1326+ # # accept it
1327+ # if os.path.exists(core_pattern_file):
1328+ # with open(core_pattern_file, "rb") as f:
1329+ # if f.readline().rstrip()[0] == b"|":
1330+ # # same logic as implemented by afl-fuzz itself
1331+ # print("[*] afl-fuzz requires 'echo core >%s'" % core_pattern_file)
1332+ # rv = False
1333+ # return rv
13261334
13271335
13281336def parse_cmdline () -> argparse .Namespace :
0 commit comments