-
Notifications
You must be signed in to change notification settings - Fork 0
/
Progpilot.py
20 lines (18 loc) · 868 Bytes
/
Progpilot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
import json
def scan_Progpilot(Directory_to_progpilot,project_path,project_name):
output_path = Directory_to_progpilot + "/output_progpilot"
if os.path.isdir(output_path) == False:
os.system(f"mkdir {output_path}")
if os.path.exists(f"{output_path}/{project_name}.txt") == True:
os.system(f"rm {output_path}/{project_name}.txt")
os.system(f"{Directory_to_progpilot}/progpilot {project_path} > {output_path}/{project_name}.txt")
def process_output(Directory_to_progpilot,project_name):
output_path = Directory_to_progpilot + "/output_progpilot"
content = open(f"{output_path}/{project_name}.txt","r").read()
json_objects = json.loads(content)
alerts = set()
for json_object in json_objects:
alerts.add((json_object['sink_file'],int(json_object['sink_line'])))
#print(alerts)
return alerts