Can a DOS batch expert analyze this code?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
TruthSeeker
Posts: 1
Joined: 19 Nov 2011 15:49

Can a DOS batch expert analyze this code?

#1 Post by TruthSeeker » 19 Nov 2011 15:54

Is there anything malicious here or is the code safe?

Can you see any strange behavior?

Code:

Code: Select all


@echo off
cls
mode con: cols=49 lines=12
REG QUERY "HKU\S-1-5-19" >NUL 2>&1 && (
GOTO mainmenu
) || (
echo Right click App v1.0 and run as administrator...
echo.
pause
GOTO exit
)

:mainmenu
title App v1.0
mode con: cols=49 lines=11
CLS
echo.
echo. 
echo.              ---- App v1.0 ----
echo.   
echo.          A. LAUNCH1 (Windows 7 and Servers)
echo.          B. LAUNCH2 (Office 2010 VL)
echo.          C. LAUNCH3 (Adobe CS5.5)
echo.          D. Details
echo.          E. ISO Installation Basics
echo.          F. Exit App v1.0
echo.
 
:CHOOSEACTION
set /p userinp=    ^   Make your selection:
set userinp=%userinp:~0,1%
if /i "%userinp%"=="A" goto LAUNCH1
if /i "%userinp%"=="B" goto LAUNCH2
if /i "%userinp%"=="C" goto LAUNCH3
if /i "%userinp%"=="D" goto Detailsgo
if /i "%userinp%"=="E" goto ISO
if /i "%userinp%"=="F" goto Exit
echo.Try Again...
GOTO CHOOSEACTION

:LAUNCH1
REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion | FINDSTR 6.1 >NUL
IF ERRORLEVEL 1 cls & echo Supports only windows 7 and server 2008 R2 & ping -n 5 127.0.0.1 >nul & goto mainmenu
for /f "tokens=2 delims==" %%A in ('"wmic volume where DriveLetter="%SystemDrive%" get SerialNumber /format:list"') do set sn=%%A
for /f "tokens=2 delims==" %%A in ('"wmic volume where SystemVolume="true" get DeviceId /format:list"') do set sd=%%A

:start
title LAUNCH1 4.0
mode con: cols=45 lines=12
cls
echo.
echo.
echo.             InfiniteRearm5 (LAUNCH1)
echo.                   
echo.                A. Install
echo.                B. Uninstall
echo.                C. Rearm
echo.                D. Status               
echo.                E. Instructions
echo.                F. App v1.0
echo.                G. Exit App v1.0
echo.

:CHOOSEACTION2
set /p userinp=    ^   Make your selection:
set userinp=%userinp:~0,1%
if /i "%userinp%"=="A" goto InstallLAUNCH1
if /i "%userinp%"=="B" goto UninstallLAUNCH1
if /i "%userinp%"=="C" goto RearmLAUNCH1
if /i "%userinp%"=="D" goto StatusLAUNCH1
if /i "%userinp%"=="E" goto InstructionsLAUNCH1
if /i "%userinp%"=="F" goto MAINMENU
if /i "%userinp%"=="G" goto Exit
echo.Try Again...
GOTO CHOOSEACTION2

:InstallLAUNCH1
CLS
schtasks /query | FINDSTR /I "LAUNCH1" >NUL
IF ERRORLEVEL 1 (
echo.
) ELSE (
echo LAUNCH1 is already installed...
ping -n 5 127.0.0.1 >nul
GOTO start
)
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Activation" /v NotificationDisabled /t REG_DWORD /d 1 /f >NUL
echo edition = CreateObject("WScript.Shell").RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\EditionID") >key.vbs
echo Set keys = CreateObject ("Scripting.Dictionary") >>key.vbs
echo keys.Add "Enterprise",                     "xxxxx-xxxxx-xxxxx-xxxxx-xxxx" >>key.vbs
>>key.vbs
echo if keys.Exists(edition) then >>key.vbs
echo WScript.Echo keys.Item(edition) >>key.vbs
echo End If >>key.vbs
FOR /F %%A in ('cscript /nologo key.vbs') do SET PIDKEY=%%A
del key.vbs
SET file=%sd%\LAUNCH1.bat
echo @echo off>>%file%
echo echo Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") ^>^>drive.vbs>>%file%
echo echo Set colItems = objWMIService.ExecQuery( "SELECT * FROM Win32_Volume",,48) ^>^>drive.vbs>>%file%
echo echo For Each objItem in colItems ^>^>drive.vbs>>%file%
echo echo If Hex(%sn%) = Hex(objItem.SerialNumber) then ^>^>drive.vbs>>%file%
echo echo Wscript.Echo objItem.DriveLetter ^>^>drive.vbs>>%file%
echo echo End If ^>^>drive.vbs>>%file%
echo echo Next ^>^>drive.vbs>>%file%
echo for /f %%%%A IN ('"cscript /nologo drive.vbs"') do set dl=%%%%A>>%file%
echo set dl=%%dl:~0,-1%%>>%file%
echo del drive.vbs>>%file%
echo reg load HKLM\MY_SYSTEM "%%dl%%\Windows\System32\config\system" ^>NUL >>%file%
echo reg delete HKLM\MY_SYSTEM\WPA /f ^>NUL >>%file%
echo reg unload HKLM\MY_SYSTEM ^>NUL >>%file%
echo echo cscript /b slmgr.vbs /ipk %PIDKEY% ^>%%dl%%\installkey.bat >>%file%
echo echo slmgr.vbs /dlv ^>^>%%dl%%\installkey.bat >>%file%
echo echo del "C:\installkey.bat" ^>^>%%dl%%\installkey.bat >>%file%
echo echo CreateObject("WScript.Shell").Run """C:\installkey.bat""", 0, False ^>%%dl%%\key.vbs >>%file%
echo echo @echo off ^>%%dl%%\launch.bat >>%file%
echo echo wscript.exe "C:\key.vbs" ^>^>%%dl%%\launch.bat >>%file%
echo echo del "%sd%\LAUNCH1.bat" ^>^>%%dl%%\launch.bat >>%file%
echo echo del "C:\key.vbs" ^>^>%%dl%%\launch.bat >>%file%
echo echo del "C:\launch.bat" ^>^>%%dl%%\launch.bat >>%file%
echo reg load HKLM\MY_SOFTWARE "%%dl%%\Windows\System32\config\software" ^>NUL >>%file%
echo reg add HKLM\MY_SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v InstallKey /t REG_SZ /d C:\launch.bat ^>NUL >>%file%
echo reg unload HKLM\MY_SOFTWARE >>%file%
echo wpeutil reboot >>%file%
reagentc /boottore >NUL
CLS
echo Windows is restarting now...
ping -n 6 127.0.0.1 >nul
schtasks /create /tn "LAUNCH1" /tr "'%SystemDrive%\Windows\system32\cmd.exe' /c cscript.exe /b %SystemDrive%\Windows\System32\slmgr.vbs /rearm && net stop sppsvc && net start sppsvc" /sc daily /mo 30 /ru "" /f >NUL
shutdown /r /t 0
GOTO Exit

:UninstallLAUNCH1
cls
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Activation" /v NotificationDisabled /t REG_DWORD /d 0 /f >NUL
schtasks /delete /tn "LAUNCH1" /f >NUL 2>&1
IF %ERRORLEVEL%==0 ( echo LAUNCH1 has been successfully uninstalled...
) ELSE (
echo LAUNCH1 is already uninstalled...
)
ping -n 5 127.0.0.1 >nul
GOTO Start

:RearmLAUNCH1
mode con: cols=62 lines=7
CLS
cscript.exe /b %windir%\system32\slmgr.vbs /rearm
IF %ERRORLEVEL% NEQ 0 ( echo No rearms detected...
ping -n 5 127.0.0.1 >nul
GOTO Start
) ELSE (
echo Rearming...
net stop sppsvc >NUL
net start sppsvc >NUL
cscript.exe %windir%\system32\slmgr.vbs /dlv | FINDSTR /I "Status"
echo.
cscript.exe %windir%\system32\slmgr.vbs /dlv | FINDSTR /I "Remaining"
echo.
echo Rearm completed successfully...
ping -n 5 127.0.0.1 >nul
)
schtasks /query | FINDSTR /i "LAUNCH1" >nul
if %errorlevel%==0 (
schtasks /create /tn "LAUNCH1" /tr "'%SystemDrive%\Windows\system32\cmd.exe' /c cscript.exe /b %SystemDrive%\Windows\System32\slmgr.vbs /rearm && net stop sppsvc && net start sppsvc" /sc daily /mo 30 /ru "" /f >NUL
)
GOTO Start

:StatusLAUNCH1
mode con: cols=64 lines=8
echo Retrieving status...
echo.
echo.
echo.
echo.
echo.
cscript.exe %windir%\system32\slmgr.vbs /dlv | FINDSTR /I "Status"
echo.
cscript.exe %windir%\system32\slmgr.vbs /dlv | FINDSTR /I "Remaining"
echo.
schtasks /query /tn "LAUNCH1" 2>NUL | FINDSTR "LAUNCH1"
IF ERRORLEVEL 1 echo LAUNCH1 is not installed...
ping -n 5 127.0.0.1 >nul
GOTO Start

:InstructionsLAUNCH1
mode con: cols=112 lines=20
echo  1. Select Install then your computer will automatically restart into Recovery Environment (RE)
echo.
echo  2. Enter your keyboard language and login information
echo.
echo  3. Click command prompt and type "C:LAUNCH1" (without quotes) then press enter
echo.
echo  4. Ignore any non-genuine messages while windows is restarting
echo.
echo  5. Desktop watermark will disappear momentarily
echo.
echo  * Select rearm option if license status says "notification"
echo.
echo  * Reinstall LAUNCH1 when you have 0 rearms and 1 days left
echo.
echo  * If rearms do not reset try D:LAUNCH1, E:LAUNCH1, F:LAUNCH1, G:LAUNCH1, H:LAUNCH1 or I:LAUNCH1 at step 3
echo.
echo  * If LAUNCH1 doesn't automatically restart into Recovery Environment (RE), restart your computer and press the F8
echo    function key when BIOS screen flashes, then choose the option to repair your computer and go to step 2   
echo.
pause
goto start

:LAUNCH2
setlocal enabledelayedexpansion
title LAUNCH2 4.0
if not exist "%Windir%\system32\schtasks.exe" ( cls
echo You don't have schtasks.exe installed
echo.
echo LAUNCH2 is not compatable with XP Home Edition
echo Install XP Professional or schtasks.exe
ping -n 10 127.0.0.1 >NUL
goto MAINMENU
)
set OfficeArchType=
if '%processor_architecture%'=='x86' Set OfficeArchType=32 && Goto:EndArchCheck
goto:WOWCheck
:WOWCheck
2>nul REG QUERY HKLM\SOFTWARE\Microsoft\Office\14.0\Common | find /i "InstallRoot" 1>nul
IF ERRORLEVEL 1 Set OfficeArchType=WOW && Goto:EndArchCheck
Set OfficeArchType=64
:EndArchCheck
if %OfficeArchType%==WOW (
FOR /F "tokens=2* delims=    " %%A IN ('"REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Common\InstallRoot" /v Path 2>NUL"') DO SET InstallRoot=%%B
if not defined InstallRoot ( cls & echo Office 2010 VL is not installed... & ping -n 5 127.0.0.1 >nul & goto mainmenu )
Goto:FoundPath
)
FOR /F "tokens=2* delims=    " %%A IN ('"REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Common\InstallRoot" /v Path 2>NUL"') DO SET InstallRoot=%%B
if not defined InstallRoot ( cls & echo Office 2010 VL is not installed... & ping -n 5 127.0.0.1 >nul & goto mainmenu )
:FoundPath
1>nul 2>nul net start OSPsvc
cscript "%InstallRoot%"OSP.vbs /dstatus |FINDSTR /i "KMS_Client" >NUL
if %errorlevel% EQU 1 ( cls & echo No office 2010 VL detected... & ping -n 5 127.0.0.1 >nul & goto mainmenu )

:LAUNCH21
mode con: cols=45 lines=11
CLS
echo.
echo. 
echo.    InfiniteOfficeRestoreRearmTask (LAUNCH2)
echo.   
echo.               A. Install
echo.               B. Uninstall
echo.               C. Restore/Rearm
echo.               D. Status
echo.               E. App v1.0
echo.               F. Exit App v1.0
echo.
 
:CHOOSEACTION1
set /p userinp=    ^   Make your selection:
set userinp=%userinp:~0,1%
if /i "%userinp%"=="A" goto InstallLAUNCH2
if /i "%userinp%"=="B" goto UninstallLAUNCH2
if /i "%userinp%"=="C" goto Rearm
if /i "%userinp%"=="D" goto StatusLAUNCH2
if /i "%userinp%"=="E" goto MAINMENU
if /i "%userinp%"=="F" goto Exit
echo.Try Again...
GOTO CHOOSEACTION1

:InstallLAUNCH2
CLS
title LAUNCH2 4.0
mode con: cols=45 lines=11
schtasks /query | FINDSTR /I "LAUNCH2" >NUL
IF %ERRORLEVEL% NEQ 0 (
echo.
) ELSE (
echo LAUNCH2 is already installed...
ping -n 5 127.0.0.1 >nul
GOTO LAUNCH21
)
mode con: cols=62 lines=5
title LAUNCH2 4.0
echo Installing LAUNCH2...
echo.
set onstart=onstart
set daily=daily
VER | FINDSTR /IL "5.1." > NUL
if %ERRORLEVEL% EQU 0 ( for /f "tokens=2,*" %%A in ('"reg query "HKLM\system\controlset001\control\nls\language" /v InstallLanguage"') do set Language=%%B
if '!Language!' EQU '0407' ( set daily=täglich & set onstart=beimstart )
if '!Language!' EQU '0416' ( set daily=diariamente )
if '!Language!' EQU '0415' ( set daily=codziennie & set onstart=przy_uruchomieniu )
if '!Language!' EQU '041f' ( set daily=günlük )
)
schtasks /create /tn "LAUNCH2" /tr "%SystemDrive%\LAUNCH2\LAUNCH2.bat" /sc %daily% /mo 1 /ru "" >NUL 2>&1
if %ERRORLEVEL% NEQ 0 ( cls
echo LAUNCH2 task could not be installed
echo.
echo Your language version is not yet compatable with LAUNCH2
echo Seek assistance in App v1.0
ping -n 10 127.0.0.1 >NUL
goto LAUNCH21
) else ( schtasks /delete /tn "LAUNCH2" /f >NUL )
schtasks /create /tn "Hybrid" /tr "%SystemDrive%\LAUNCH2\LAUNCH2.bat" /sc %onstart% /ru "" >NUL 2>&1
if %ERRORLEVEL% NEQ 0 ( cls
echo Hybrid task could not be installed
echo.
echo Your language version is not yet compatable with LAUNCH2
echo Seek assistance in App v1.0 development thread
ping -n 10 127.0.0.1 >NUL
goto LAUNCH21
) else ( schtasks /delete /tn "Hybrid" /f >NUL )
mkdir "%SystemDrive%\Check"
net stop OSPsvc >NUL
xcopy /cheriky "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" "%SystemDrive%\Check\Backup\Files\Tokens" >NUL
mkdir "%SystemDrive%\Check\Backup\Registry" >NUL
reg save "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\Check\Backup\Registry\OfficeSPPInfo.hiv >NUL
net start OSPsvc >NUL
IF Exist "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\LAUNCHER2.exe" (
"%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\LAUNCHER2.exe" >NUL
) ELSE ( "%commonprogramfiles(x86)%\microsoft shared\OfficeSoftwareProtectionPlatform\LAUNCHER2.exe" >NUL
)
if errorlevel==0 goto Pass
net stop OSPsvc >NUL
xcopy /cheriky "%SystemDrive%\Check\Backup\Files\Tokens" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" >NUL
REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >NUL
reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\Check\Backup\Registry\OfficeSPPInfo.hiv >NUL
net start OSPsvc >NUL
DEL "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform\Backup.hiv" 2> nul
SET file=%SystemDrive%\Check
IF EXIST %file% attrib -h %file%
RD /S /Q  %file%
cd /d "%InstallRoot%"
echo.
cscript OSP.VBS /dstatus | FINDSTR /i "Status"
cscript OSP.VBS /dstatus | FINDSTR /i "Remaining"
echo.
echo No Rearms Detected...
set msg=No rearms detected
call :speak "No rearms detected"
goto :END
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
GOTO LAUNCH21
:Pass
net stop OSPsvc >NUL
xcopy /cheriky "%SystemDrive%\Check\Backup\Files\Tokens" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" >NUL
REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >NUL
reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\Check\Backup\Registry\OfficeSPPInfo.hiv >NUL
net start OSPsvc >NUL
DEL "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform\Backup.hiv" 2> nul
SET file=%SystemDrive%\Check
IF EXIST %file% attrib -h %file%
RD /S /Q  %file%
mkdir "%SystemDrive%\LAUNCH2"
net stop OSPsvc >NUL
xcopy /cheriky "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" "%SystemDrive%\LAUNCH2\Backup\Files\Tokens" >NUL
mkdir "%SystemDrive%\LAUNCH2\Backup\Registry"
reg save "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\LAUNCH2\Backup\Registry\OfficeSPPInfo.hiv >NUL
net start OSPsvc >NUL
SET file=%SystemDrive%\LAUNCH2\LAUNCH2.bat
IF EXIST %file% attrib -h %file%
echo @echo off >%file%
echo net stop OSPsvc >>%file%
echo xcopy /cheriky "%SystemDrive%\LAUNCH2\Backup\Files\Tokens" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" >>%file%
echo REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >>%file%
echo REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >>%file%
echo reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\LAUNCH2\Backup\Registry\OfficeSPPInfo.hiv >>%file%
echo net start OSPsvc >>%file%
echo IF Exist "%COMMONPROGRAMFILES%\microsoft shared\OfficeSoftwareProtectionPlatform\LAUNCHER2.exe" ( >>%file%
echo "%COMMONPROGRAMFILES%\microsoft shared\OfficeSoftwareProtectionPlatform\LAUNCHER2.exe" >>%file%
echo ) ELSE ( "%COMMONPROGRAMFILES(X86)%\microsoft shared\OfficeSoftwareProtectionPlatform\LAUNCHER2.exe" >>%file%
echo ) >>%file%
echo schtasks /delete /tn "LAUNCH2" /f >>%file%
echo schtasks /create /tn "LAUNCH2" /tr "%SystemDrive%\LAUNCH2\LAUNCH2.bat" /sc %daily% /mo 1 /ru "" >>%file%
IF Exist "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\LAUNCHER2.exe" (
"%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\LAUNCHER2.exe" >NUL
) ELSE ( "%commonprogramfiles(x86)%\microsoft shared\OfficeSoftwareProtectionPlatform\LAUNCHER2.exe" >NUL
)
attrib +h "%SystemDrive%\LAUNCH2"
schtasks /create /tn "Hybrid" /tr "%SystemDrive%\LAUNCH2\LAUNCH2.bat" /sc %onstart% /ru "" >NUL
schtasks /create /tn "LAUNCH2" /tr "%SystemDrive%\LAUNCH2\LAUNCH2.bat" /sc %daily% /mo 1 /ru "" >NUL
echo.
title LAUNCH2 4.0
cd /d "%InstallRoot%"
echo.
echo.
cscript OSP.VBS /dstatus | FINDSTR /i "Status"
cscript OSP.VBS /dstatus | FINDSTR /i "Remaining"
echo.
echo Installation Successful...
set msg=Installation Successful
call :speak "Installation Successful"
goto :END
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
GOTO LAUNCH21

:UninstallLAUNCH2
schtasks /query | FINDSTR /I "LAUNCH2" >NUL
IF '%ERRORLEVEL%' EQU '0' (
echo.
) ELSE (
mode con: cols=45 lines=10
title LAUNCH2 4.0
echo LAUNCH2 is already uninstalled...
ping -n 5 127.0.0.1 >nul
GOTO LAUNCH21
)
mode con: cols=62 lines=5
title LAUNCH2 4.0
echo Uninstalling LAUNCH2...
echo.
net stop OSPsvc >NUL
xcopy /cheriky "%SystemDrive%\LAUNCH2\Backup\Files\Tokens" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" >NUL
REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >NUL
reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\LAUNCH2\Backup\Registry\OfficeSPPInfo.hiv >NUL
net start OSPsvc >NUL
DEL "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform\Backup.hiv" 2> nul
SET file=%SystemDrive%\LAUNCH2
IF EXIST %file% attrib -h %file%
rd /S /Q  %file%
schtasks /delete /tn "Hybrid" /f >NUL
schtasks /delete /tn "LAUNCH2" /f >NUL
cd /d "%InstallRoot%"
echo.
echo.
cscript OSP.VBS /dstatus | FINDSTR /i "Status"
cscript OSP.VBS /dstatus | FINDSTR /i "Remaining"
echo.
echo Successfully Uninstalled...
set msg=Successfully Uninstalled
call :speak "Successfully Uninstalled"
goto :END
:speak
echo On Error Resume Next: CreateObject("SAPI.SpVoice").Speak %1 >"%~dp0vc.vbs"
"%~dp0vc.vbs" & del "%~dp0vc.vbs"
ping -n 5 127.0.0.1 >nul
GOTO LAUNCH21

:Rearm
mode con: cols=45 lines=11
title LAUNCH2 4.0
schtasks /query | FINDSTR /I "LAUNCH2" >NUL
IF %ERRORLEVEL% EQU 0 ( echo.
) ELSE (
echo LAUNCH2 is not installed...
ping -n 5 127.0.0.1 >nul
GOTO LAUNCH21
)
mode con: cols=64 lines=6
echo Restoring and rearming...
echo.
set daily=daily
VER | FINDSTR /IL "5.1." > NUL
if %ERRORLEVEL% EQU 0 ( for /f "tokens=2,*" %%A in ('"reg query "HKLM\system\controlset001\control\nls\language" /v InstallLanguage"') do set Language=%%B
if '!Language!' EQU '0407' ( set daily=täglich )
if '!Language!' EQU '0416' ( set daily=diariamente )
if '!Language!' EQU '0415' ( set daily=codziennie )
if '!Language!' EQU '041f' ( set daily=günlük )
)
net stop OSPsvc >NUL
xcopy /cheriky "C:\LAUNCH2\Backup\Files\Tokens" "%SystemDrive%\ProgramData\Microsoft\OfficeSoftwareProtectionPlatform" >NUL
REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >NUL
reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\LAUNCH2\Backup\Registry\OfficeSPPInfo.hiv >NUL
net start OSPsvc >NUL
IF Exist "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\LAUNCHER2.exe" (
"%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\LAUNCHER2.exe" >NUL
) ELSE ( "%commonprogramfiles(x86)%\microsoft shared\OfficeSoftwareProtectionPlatform\LAUNCHER2.exe" >NUL
)
schtasks /delete /tn "LAUNCH2" /f >NUL
schtasks /create /tn "LAUNCH2" /tr "%SystemDrive%\LAUNCH2\LAUNCH2.bat" /sc %daily% /mo 1 /ru "" >NUL
cd /d "%InstallRoot%"
cscript OSP.VBS /dstatus | FINDSTR /i "Status"
cscript OSP.VBS /dstatus | FINDSTR /i "Remaining"
echo.
schtasks /query | FINDSTR /I "LAUNCH2"
IF ERRORLEVEL 1 echo LAUNCH2 is not installed...
ping -n 5 127.0.0.1 >nul
GOTO LAUNCH21

:StatusLAUNCH2
mode con: cols=64 lines=6
title LAUNCH2 4.0
cd /d "%InstallRoot%"
cscript OSP.VBS /dstatus | FINDSTR /i "Status"
cscript OSP.VBS /dstatus | FINDSTR /i "Remaining"
echo.
schtasks /query | FINDSTR /I "LAUNCH2"
IF ERRORLEVEL 1 echo LAUNCH2 is not installed...
ping -n 5 127.0.0.1 >nul
GOTO LAUNCH21
endlocal

:LAUNCH3
title LAUNCH3 4.5
mode con: cols=45 lines=12
CLS
echo.
echo. 
echo.     AdobeCreativeSuite5.5Tool (LAUNCH3)
echo.   
echo.               A. Install
echo.               B. Uninstall
echo.               C. Keys
echo.               D. Status
echo.               E. Instructions
echo.               F. App v1.0
echo.               G. Exit App v1.0
echo.
 
:CHOOSEACTION3
set /p userinp=    ^   Make your selection:
set userinp=%userinp:~0,1%
if /i "%userinp%"=="A" goto InstallLAUNCH3
if /i "%userinp%"=="B" goto UninstallLAUNCH3
if /i "%userinp%"=="C" goto KeysLAUNCH3
if /i "%userinp%"=="D" goto StatusLAUNCH3
if /i "%userinp%"=="E" goto InstructionsLAUNCH3
if /i "%userinp%"=="F" goto MAINMENU
if /i "%userinp%"=="G" goto Exit
echo.Try Again...
GOTO CHOOSEACTION3

:InstallLAUNCH3
CLS
SET hosts=%windir%\system32\drivers\etc\hosts
findstr /i "3dns-2.adobe.com" %hosts% >nul
IF %ERRORLEVEL% EQU 0 (
echo LAUNCH3 is already installed...
ping -n 5 127.0.0.1 >nul
goto LAUNCH3
)
attrib -r %hosts%
echo. >>%hosts%
FOR %%A IN (
activate.adobe.com
echo 127.0.0.1 %%A >>%hosts%
)
attrib +r %hosts%
echo LAUNCH3 has been successfully installed...
ping -n 5 127.0.0.1 >nul
GOTO LAUNCH3

:UninstallLAUNCH3
CLS
SET hosts=%windir%\system32\drivers\etc\hosts
findstr /i "3dns-2.adobe.com" %hosts% >nul
IF %ERRORLEVEL% NEQ 0 (
echo LAUNCH3 is already uninstalled...
ping -n 5 127.0.0.1 >nul
goto LAUNCH3
)
attrib -r %hosts%
FOR %%A IN (
3dns-2.adobe.com
3dns-3.adobe.com
activate.adobe.com
activate.wip3.adobe.com
activate-sea.adobe.com
activate-sjc0.adobe.com
adobe-dns.adobe.com
adobe-dns-2.adobe.com
adobe-dns-3.adobe.com
adobeereg.com
ereg.adobe.com
ereg.wip3.adobe.com
hl2rcv.adobe.com
practivate.adobe.com
wip3.adobe.com
wwis-dubc1-vip60.adobe.com
www.adobeereg.com
) DO (
 MOVE %hosts% hosts.bak >NUL
 FINDSTR /V /C:"%%A" hosts.bak > %hosts%
 DEL /F /Q hosts.bak
)
attrib +r %hosts%
echo LAUNCH3 has been successfully uninstalled...
ping -n 5 127.0.0.1 >nul
GOTO LAUNCH3

:KeysLAUNCH3
mode con: cols=33 lines=16
echo   CS5.5 keys
echo.
echo   XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
echo   XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
echo   XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
echo   XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
echo   XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
echo   XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
echo   XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
echo   XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
echo   XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
echo   XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
echo   XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
echo   XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
echo.
pause
GOTO LAUNCH3

:StatusLAUNCH3
mode con: cols=38 lines=19
START "" "CMD /C color 06 & type %systemroot%\system32\drivers\etc\hosts & >NUL ping -n 5 127.0.0.1"
GOTO LAUNCH3

:InstructionsLAUNCH3
mode con: cols=85 lines=15
echo  1. Select the install option
echo.
echo  2. Sign up at http://www.adobe.com/products
echo.
echo  3. Remember your ID and password
echo.
echo  4. Run the set-up file
echo.
echo  5. Select keys option
echo.
echo  6. Enter your ID and password then install
echo.
echo  * LAUNCH3 does not support CS live online services
echo.
pause
GOTO LAUNCH3

:Detailsgo
title Details
mode con: cols=107 lines=31
echo  App v1.0 4.2
echo.
echo  LAUNCH1 -  Windows 7 trial Rearm Solution
echo.
echo  * LAUNCH1 allows you to use windows 7 and servers without patches, cracks, loaders, activators or leaked keys
echo  * LAUNCH1 task runs silently once every 30 days
echo  * LAUNCH1 keeps you in trial and in trial you are always genuine
echo  * LAUNCH1 works with all updates and service packs
echo  * LAUNCH1 supports all windows 7, servers, languages, versions, editions, 32/64bit
echo  * LAUNCH1 does not modify any system files and never causes restart problems
echo.
echo  LAUNCH2 - The Official Office 2010 VL Rearm Solution
echo.
echo  * LAUNCH2 allows you to use office 2010 VL without patches, cracks, activators or leaked keys
echo  * LAUNCH2 works with all updates and service packs
echo  * LAUNCH2 gives A.I. voice confirmation
echo  * LAUNCH2 and Hybrid tasks both run silently
echo.
echo  LAUNCH3 - The Official Adobe CS5.5 MC Solution
echo.
echo  * Adds hosts file entries
echo.
echo  App v1.0 4.2 Development
echo.
echo  *echo.
echo  Windows 7
echo.
echo  *
echo.
pause
GOTO MAINMENU

:ISO
title ISO Installation Basics
mode con: cols=112 lines=29
echo  Windows 7 ISO...
echo.
echo  You must burn a windows 7 ISO to a USB (4GB) or DVD-R with UltraISO
echo.
echo  For USB (4GB)
echo.
echo  Double click on the windows 7 ISO then click the bootable tab then write disk image then write
echo.
echo  For DVD-R
echo.
echo  1. Right-click the ISO image then click UltraISO then Burn to Disc
echo  2. Select a minimum Write Speed (4x recommended)
echo  3. Click on the Burn button
echo.
echo  Then you can upgrade or clean install from inside windows or clean install from boot
echo.
echo  4. You can upgrade from Vista, but if you have XP a clean install will be necessary
echo.
echo  5. When installing windows 7 just bypass entering any key then un-check the activate online box and click next
echo.
echo  6. Install with updates and internet on
echo.
echo  Office 2010 VL ISO...
echo.
echo  1. Right click the office ISO then choose UltraISO and mount the Office ISO image
echo.
echo  2. Then in computer open the drive office is mounted on and install
echo.
pause
GOTO MAINMENU

:Exit
exit


jeb
Expert
Posts: 1059
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: Can a DOS batch expert analyze this code?

#2 Post by jeb » 19 Nov 2011 17:33

Hi TruthSeeker,

I didn't read the complete code, but some suggestions ...

I would use echo( instead of echo. as it is faster and safer.
Faster as echo. always search the disk for a file named "echo", and that's also the point why echo( is safer.
Simply create a file named "echo" without extension and restart your batch...

I would prefere delayed expansion, especialy at the userinput, else a simple input of a single quote breaks your code.
Preset the variable userinput to a value or set it to nothing, else you got the last value if the user didn't enter anyting.

Start your code with "setlocal" to avoid to change to much variables permanently.

Use parenthesis blocks to formatting your code nicer.

Instead of
TruthSeeker wrote:IF ERRORLEVEL 1 cls & echo Supports only windows 7 and server 2008 R2 & ping -n 5 127.0.0.1 >nul & goto mainmenu

You could write

Code: Select all

IF ERRORLEVEL 1 (
   cls
   echo Supports only windows 7 and server 2008 R2
   ping -n 5 127.0.0.1 >nul
   goto mainmenu
)


And avoid multiline redirections, it's hard to read and hard to maintain

TruthSeeker wrote:echo @echo off>>%file%
echo echo Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") ^>^>drive.vbs>>%file%
echo echo Set colItems = objWMIService.ExecQuery( "SELECT * FROM Win32_Volume",,48) ^>^>drive.vbs>>%file%

Code: Select all

(
   echo @echo off
   echo echo Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") ^>^>drive.vbs
   echo echo Set colItems = objWMIService.ExecQuery( "SELECT * FROM Win32_Volume",,48) ^>^>drive.vbs
) > %file%



hope it helps
jeb

renzlo
Posts: 116
Joined: 03 May 2011 19:06

Re: Can a DOS batch expert analyze this code?

#3 Post by renzlo » 19 Nov 2011 21:08

Hi Jeb,

I think the thread starter wanted to verify if the above codes contain malicious code. For me, the code edits the registry which is something strange for me, but im no pro. Just my opinion.

Rileyh
Posts: 147
Joined: 01 Sep 2011 03:54
Location: Perth, Western Australia

Re: Can a DOS batch expert analyze this code?

#4 Post by Rileyh » 20 Nov 2011 03:29

I think you need to define the issue here, as the code is roughly 800-1000 lines long. But I think you should analyse each part one by one to see if you can find the answer.

Rileyh

alan_b
Expert
Posts: 357
Joined: 04 Oct 2008 09:49

Re: Can a DOS batch expert analyze this code?

#5 Post by alan_b » 20 Nov 2011 15:36

Adobe is notorious for 2 things :-
Useless Bloat ;
Endless vulnerabilities to Malware.

The script seems to greatly modify the Windows HOSTS files with many Adobe entries.

It gets involved with things like
"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Activation"

Before I let such a script run on my system I would need excellent reasons for trusting that :-
I have a good validated partition image backup that can be restored to undo any harm that might occur ; and
The author is not intending any harm ; and
The author is truly competent and has not made any mistakes.

Post Reply