@@ -285,7 +285,15 @@ def process_afl_test_cases(cargs: argparse.Namespace) -> bool:
285
285
cov_paths ["log_file" ],
286
286
cargs ,
287
287
)
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
289
297
continue
290
298
else :
291
299
logr (
@@ -1170,9 +1178,9 @@ def validate_cargs(cargs: argparse.Namespace) -> bool:
1170
1178
print ("[*] Must set --src-file in --line-search mode" )
1171
1179
return False
1172
1180
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
1176
1184
1177
1185
if not cargs .live and not is_dir (cargs .afl_fuzzing_dir ):
1178
1186
print (
@@ -1309,20 +1317,20 @@ def stop_afl(cargs: argparse.Namespace) -> bool:
1309
1317
return rv
1310
1318
1311
1319
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
1326
1334
1327
1335
1328
1336
def parse_cmdline () -> argparse .Namespace :
0 commit comments