tis-dangerous-package-wads-run-deploy

21-0
Very dangerous package, modifies the startup sequence to start the winpe wads and thus format the computer. Will only work if the installation is launched in force mode
0 downloads
Download
View on luti logo
tis-dangerous-package-wads-run-deploy icon

  Description 

  • package : tis-dangerous-package-wads-run-deploy
  • version : 21-0
  • architecture : x64
  • categories :
  • maintainer : Simon Fonteneau
  • description : Very dangerous package, modifies the startup sequence to start the winpe wads and thus format the computer. Will only work if the installation is launched in force mode
  • locale :
  • target_os : windows
  • min_wapt_version :
  • sources :
  • installed_size :
  • impacted_process :
  • description_fr : Paquet très dangereux, modifie la séquence de démarrage pour démarrer les wads winpe et ainsi formater l'ordinateur. Ne fonctionnera que si l'installation est lancée en mode force
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence :
  • signature_date : 2022-07-04T10:37:35.467104

  Setup.py 

# -*- coding: utf-8 -*-
from setuphelpers import *
from common import WaptServer

name_menu = "Wads Deploy"
guid = "{2bdabb2b-eb21-11ec-ba0b-c85b76537da2}"
loc_folder = "wadswinpe"
loc_systemdrive = systemdrive()
full_loc_folder = makepath(loc_systemdrive,loc_folder)

def install():

    error('This package is protect against accidental launch, to disable the protection, edit the package and remove this line')
    server = server = WaptServer()
    server.load_config_from_file(WAPT.config_filename)

    if not isdir(full_loc_folder):
        mkdirs(full_loc_folder)

    filecopyto('boot.sdi',makepath(full_loc_folder,"boot.sdi"))
    filecopyto('boot.wim',makepath(full_loc_folder,"boot.wim"))

    #TODO INTEGRER DANS LE Boot.wim avec 7zip les drivers déjà existant sur la machine on pourrait même extraire les profiles wifi pour faire un déploiement par wifi

    wait_deploy = False
    for net in [u['mac'] for u in networking()] :
        dataipxe = server.get('api/v3/get_host_ipxe?mac_address=%s' % net ,decode_json=False).decode('utf-8')
        if ("wads/winpe/x64" in dataipxe) and (not 'registerwinpe' in dataipxe):
            wait_deploy=True
            break

    if wait_deploy:
        run(r'bcdedit /create {ramdiskoptions} /d "%s"' % name_menu)
        run(r'bcdedit /set {ramdiskoptions} ramdisksdidevice partition=%s' % loc_systemdrive)
        run(r'bcdedit /set {ramdiskoptions} ramdisksdipath \%s\boot.sdi' % loc_folder)
        run(r'bcdedit /create %s /d "%s" /application OSLOADER' % (guid,name_menu))
        run(r'bcdedit /set %s device ramdisk=[%s]\%s\boot.wim,{ramdiskoptions}' % (guid,loc_systemdrive,loc_folder))
        run(r'bcdedit /set %s osdevice ramdisk=[%s]\%s\boot.wim,{ramdiskoptions}' % (guid,loc_systemdrive,loc_folder))
        run(r'bcdedit /set %s systemroot \windows' % guid)
        run(r'bcdedit /set %s winpe yes' % guid)
        run(r'bcdedit /set %s detecthal yes' % guid)
        run(r'bcdedit /displayorder %s /addlast' % guid)
        run(r'bcdedit /default %s' % guid)
        run(r'bcdedit /timeout 5')
        run('shutdown /f /r /t 0')
    else:
        print('Skip, run installation')


def update_package():

    urlserver = WAPT.waptserver.server_url
    server_cert = WAPT.config.get('global','verify_cert')

    old_version = control.get_software_version()

    if str(server_cert) == '0':
        server_cert = None

    wget('%s/wads/winpe/x64/media/Boot/boot.sdi' % (urlserver),'boot.sdi',verify_cert=server_cert)
    wget('%s/wads/winpe/x64/media/sources/boot.wim' % (urlserver),'boot.wim',verify_cert=server_cert)
    version = control.version.split('-')[0]
    version_package = str(int(control.version.split('-')[1]) + 1)
    control.version = version + '-' +  version_package

def uninstall():
    if isdir(full_loc_folder):
        remove_tree(full_loc_folder)
										

  Changelog 



No changelog.txt.
									
  manifest.sha256