forked from antojoseph/droid-ff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.py
executable file
·37 lines (27 loc) · 1.17 KB
/
search.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os
import fuzzerConfig
new_crashes = []
#Move files to triage folder
def move_crashes_to_triage():
try:
for x in range(0,len(new_crashes)):
print new_crashes[x]
if os.path.isfile(fuzzerConfig.path_to_generated_samples+new_crashes[x]):
os.rename(fuzzerConfig.path_to_generated_samples+new_crashes[x], fuzzerConfig.path_for_crash_samples+new_crashes[x])
except Exception, e:
print str(e)
def process(filename):
offset_line_to_file = 3
f = open(filename, "r")
lines = f.readlines()
#parse every line of the current log
print "Total Number of lines" +str(len(lines))
for x in range(0, len(lines)):
strings = ("SIGSEGV", "SIGSEGV", "SIGFPE","SIGILL")
if any(s in lines[x] for s in strings):
if ("F/libc" in lines[x]) or (("F/"+fuzzerConfig.target_android_executable) in lines[x]):
if "F/CRASH_LOGGER" in lines[x - offset_line_to_file]:
new_crashes.append(lines[x - offset_line_to_file][32:].strip())
move_crashes_to_triage()
#run triage and process tombstone files
#have a beer :)