-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathccgen_wrapper_ext.py
33 lines (25 loc) · 1023 Bytes
/
ccgen_wrapper_ext.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
#!/usr/bin/env python
import sys
import glob
import os
def main():
if len(sys.argv) >1:
inpath = sys.argv[1]
else:
print("\Extracts a collection of CCs in a given pcap(s)")
print("\nUsage:")
print("> python3 ccgen_wrapper_ext.py [path-to-ccgen-config-files]")
print("> (config-files must have .ini extension)")
quit()
for idf, filename in enumerate(sorted(glob.glob(os.path.join(inpath, '*.ini')))):
print("\n----", idf, " Configuration file (.ini): ", filename)
#python3 ccgen/ccgen.py offline extract wrapper/gcc_config/ccflow_1_1e.ini
str_to_run = "python3 ccgen/ccgen.py offline extract "+filename
os.system(str_to_run)
inpath = ""
for idf, filename in enumerate(sorted(glob.glob(os.path.join(inpath, '*.txt')))):
print("----", idf, " Binary message file (.txt):", filename)
str_to_run = "python3 utils/bin2text.py "+filename
os.system(str_to_run)
if __name__ == '__main__':
main()