def on_message(message, data): current_time = time.strftime("%H:%M:%S", time.localtime()) global output_dir if not os.path.exists(output_dir): os.makedirs(output_dir) if message['type'] == 'send': writePath = os.path.join(output_dir, app_name + '.db') db.save_to_database(writePath, message['payload']) #writePath = os.path.join(output_dir, app_name + '.json') #writeBinFile(writePath, message['payload']) #writeBinFile(writePath, binascii.unhexlify(message['payload'])) print colored('[%s] Dumped to %s' % (current_time, writePath), 'green') elif message['type'] == 'error': print(message['stack'])
def on_message(message, data): current_time = time.strftime('%b %d %Y %l:%M %p', time.localtime()) global output_dir if not os.path.exists(output_dir): os.makedirs(output_dir) if message['type'] == 'send': writePath = os.path.join(output_dir, str(app_name) + '.db') db.save_to_database(writePath, message['payload']) #writePath = os.path.join(output_dir, app_name + '.json') #writeBinFile(writePath, message['payload']) #writeBinFile(writePath, binascii.unhexlify(message['payload'])) print colored('[%s] Dumped to %s' % (current_time, writePath), 'green') elif message['type'] == 'error': print(message['stack'])
def on_message(message, data): os_string = platform_module.system() if os_string == "Windows": current_time = time.strftime('%b %d %Y %I:%M %p', time.localtime()) else: current_time = time.strftime('%b %d %Y %l:%M %p', time.localtime()) if not os.path.exists(output_dir): os.makedirs(output_dir) if message['type'] == 'send': writePath = os.path.join(output_dir, str(report_name) + '.db') db.save_to_database(writePath, message['payload']) #writePath = os.path.join(output_dir, app_name + '.json') #writeBinFile(writePath, message['payload']) #writeBinFile(writePath, binascii.unhexlify(message['payload'])) print(colored('[%s] Dumped to %s' % (current_time, writePath), 'green')) elif message['type'] == 'error': print((message['stack']))
def on_message(message, data): os_string = platform_module.system() if os_string == "Windows": current_time = time.strftime("%b %d %Y %I:%M %p", time.localtime()) else: current_time = time.strftime("%b %d %Y %l:%M %p", time.localtime()) if not os.path.exists(output_dir): os.makedirs(output_dir) if message["type"] == "send": writePath = os.path.join(output_dir, str(report_name) + ".db") db.save_to_database(writePath, message["payload"]) # writePath = os.path.join(output_dir, app_name + '.json') # writeBinFile(writePath, message['payload']) #writeBinFile(writePath, binascii.unhexlify(message['payload'])) print(colored("[%s] Dumped to %s" % (current_time, writePath), "green")) elif message["type"] == "error": print((message["stack"]))
def on_message(message, data): os_string = platform_module.system() if os_string == "Windows": current_time = time.strftime('%b %d %Y %I:%M %p', time.localtime()) else: current_time = time.strftime('%b %d %Y %l:%M %p', time.localtime()) if not os.path.exists(output_dir): os.makedirs(output_dir) if message['type'] == 'send': writePath = os.path.join(output_dir, str(report_name) + '.db') db.save_to_database(writePath, message['payload']) #writePath = os.path.join(output_dir, app_name + '.json') #writeBinFile(writePath, message['payload']) #writeBinFile(writePath, binascii.unhexlify(message['payload'])) print colored('[%s] Dumped to %s' % (current_time, writePath), 'green') elif message['type'] == 'error': print(message['stack'])