@@ -176,56 +176,70 @@ def PnPDeviceParse(f):
176176 return pnp_device_dict
177177
178178
179-
180179if __name__ == "__main__" :
181180
182181 event_transcript_parser = argparse .ArgumentParser (
183182 description = '''EventTranscript.db parser by Abhiram Kumar.''' ,
184183 epilog = '''For any queries, please reach out to me via Twitter - @_abhiramkumar''' )
185184
186185 event_transcript_parser .add_argument ('-f' ,'--file' , required = True , help = "Please specify the path to EventTranscript.db" )
186+ event_transcript_parser .add_argument ('-o' ,'--output-dir' , required = True , help = "Please specify the output directory" )
187187
188188 parser , empty_list = event_transcript_parser .parse_known_args ()
189189
190+
191+ print ("""\033 [1;97m _____ _ _____ _ _ ____
192+ | ____|_ _____ _ __ | |_ |_ _| __ __ _ _ __ ___ ___ _ __(_)_ __ | |_ | _ \ __ _ _ __ ___ ___ _ __
193+ | _| \ \ / / _ \ '_ \| __| | || '__/ _` | '_ \/ __|/ __| '__| | '_ \| __| | |_) / _` | '__/ __|/ _ \ '__|
194+ | |___ \ V / __/ | | | |_ | || | | (_| | | | \__ \ (__| | | | |_) | |_ | __/ (_| | | \__ \ __/ |
195+ |_____| \_/ \___|_| |_|\__| |_||_| \__,_|_| |_|___/\___|_| |_| .__/ \__| |_| \__,_|_| |___/\___|_|
196+ |_| \033 [0m\n """ )
197+
198+ print ("Author: Abhiram Kumar (Twitter: @_abhiramkumar)\n Github: https://github.com/stuxnet999/EventTranscriptParser\n " )
199+ print ("-" * 50 )
200+
190201 if os .path .exists (parser .file ):
202+ if not os .path .isdir (parser .output_dir ):
203+ os .makedirs (parser .output_dir )
204+
191205 BrowsingHistory = BrowserHistoryParse (parser .file )
192206 df = pd .DataFrame (BrowsingHistory )
193- outfile = "BrowserHistory.csv"
207+ outfile = os . path . join ( parser . output_dir , "BrowserHistory.csv" )
194208 df .to_csv (outfile , index = False )
195- print ("Output written to " + outfile )
209+ print ("Output written to " + os . path . abspath ( outfile ) )
196210
197211 software_inventory = SoftwareInventory (parser .file )
198212 df = pd .DataFrame (software_inventory )
199- outfile = "SoftwareInventory.csv"
213+ outfile = os . path . join ( parser . output_dir , "SoftwareInventory.csv" )
200214 df .to_csv (outfile , index = False )
201- print ("Output written to " + outfile )
215+ print ("Output written to " + os . path . abspath ( outfile ) )
202216
203217 WlanScan = WlanScanResults (parser .file )
204218 df = pd .DataFrame (WlanScan )
205- outfile = "WlanScan.csv"
219+ outfile = os . path . join ( parser . output_dir , "WlanScan.csv" )
206220 df .to_csv (outfile , index = False )
207- print ("Output written to " + outfile )
221+ print ("Output written to " + os . path . abspath ( outfile ) )
208222
209223 pnp_device = PnPDeviceParse (parser .file )
210224 df = pd .DataFrame (pnp_device )
211- outfile = "PnpDeviceInstall.csv"
225+ outfile = os . path . join ( parser . output_dir , "PnpDeviceInstall.csv" )
212226 df .to_csv (outfile , index = False )
213- print ("Output written to " + outfile )
227+ print ("Output written to " + os . path . abspath ( outfile ) )
214228
215229 wificonnectedevents = WiFiConnectedEvents (parser .file )
216230 df = pd .DataFrame (wificonnectedevents )
217- outfile = "WiFiConnectedEvents.csv"
231+ outfile = os . path . join ( parser . output_dir , "WiFiConnectedEvents.csv" )
218232 df .to_csv (outfile , index = False )
219- print ("Output written to " + outfile )
233+ print ("Output written to " + os . path . abspath ( outfile ) )
220234
221- outfile = "UserDefaults.txt"
222- userdefaults = UserDefault (os . path . abspath ( parser .file ) , outfile )
223- print ("Output written to " + outfile )
235+ outfile = os . path . join ( parser . output_dir , "UserDefaults.txt" )
236+ userdefaults = UserDefault (parser .file , outfile )
237+ print ("Output written to " + os . path . abspath ( outfile ) )
224238 userdefaults .close ()
225239
226- outfile = "PhysicalDiskInfo.txt"
240+ outfile = os . path . join ( parser . output_dir , "PhysicalDiskInfo.txt" )
227241 physical_disk_info = PhysicalDiskInfo (parser .file , outfile )
228- print ("Output written to " + outfile )
242+ print ("Output written to " + os . path . abspath ( outfile ) )
229243 physical_disk_info .close ()
230244
231245 else :
0 commit comments