Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- goto check_Permissions
- :check_Permissions
- echo Administrative permissions required. Detecting permissions...
- net session >nul 2>&1
- if %errorLevel% == 0 (
- echo Success: Administrative permissions confirmed.
- goto START
- ) else (
- echo Failure: Current permissions inadequate.
- echo Run Bat As Admin!
- goto ERROR1
- )
- :START
- pushd %~dp0
- setlocal enableextensions enabledelayedexpansion
- Set client=iw.exe
- Set server=http://interwebz.cc/forum/download.php
- set inputfile=cfg.ini
- set tempfile=%random%-%random%.tmp
- if exist cfg.ini (
- FOR /F "tokens=*" %%A IN ('type "%inputfile%"') DO SET %%A
- ) else (
- goto ERROR2
- )
- if %appid%==730 (
- set game=csgo.exe
- )
- if %appid%==550 (
- set game=l4d2.exe
- )
- if %appid%==240 (
- set game=hl2.exe
- )
- if %appid%==440 (
- set game=hl2.exe
- )
- ping -n 2 interwebz.cc
- IF ERRORLEVEL 1 (goto ERROR5 ) else (echo interwebz reachable)
- tasklist /NH /FI "imagename eq iw.exe" 2>nul |find /i "iw.exe" >nul
- If not errorlevel 1 (Taskkill /IM iw.exe /F)
- tasklist /NH /FI "imagename eq wget.exe" 2>nul |find /i "wget.exe" >nul
- If not errorlevel 1 (Taskkill /IM wget.exe /F)
- tasklist /NH /FI "imagename eq csgo.exe" 2>nul |find /i "csgo.exe" >nul
- If not errorlevel 1 (Taskkill /IM csgo.exe /F)
- tasklist /NH /FI "imagename eq hl2.exe" 2>nul |find /i "hl2.exe" >nul
- If not errorlevel 1 (Taskkill /IM hl2.exe /F)
- tasklist /NH /FI "imagename eq l4d2.exe" 2>nul |find /i "l4d2.exe" >nul
- If not errorlevel 1 (Taskkill /IM l4d2.exe /F)
- tasklist /NH /FI "imagename eq GameOverlayUI.exe" 2>nul |find /i "GameOverlayUI.exe" >nul
- If not errorlevel 1 (Taskkill /IM GameOverlayUI.exe /F)
- tasklist /NH /FI "imagename eq steam.exe" 2>nul |find /i "steam.exe" >nul
- If not errorlevel 1 (Taskkill /IM steam.exe /F)
- tasklist /NH /FI "imagename eq discord.exe" 2>nul |find /i "discord.exe" >nul
- If not errorlevel 1 (Taskkill /IM discord.exe /F)
- goto UPDATE
- :CLIENT
- Elevate.exe %client% %iwlogin% %iwpassword%
- IF ERRORLEVEL 1 (goto ERROR4 ) else (echo no error on iw run)
- if %autoinject%==1 (
- timeout /T 1
- nircmdc win hide process %client%
- timeout /T 3
- nircmdc dlgany %client% "" click 1 yes
- timeout /T 6
- nircmdc dlg "" "Success" click yes
- ) ELSE (
- echo Autoinject Off
- )
- :checkagain
- timeout /T 1
- echo Wait for injection
- tasklist /NH /FI "imagename eq %client%" 2>nul |find /i "%client%" >nul
- If not errorlevel 1 (goto checkagain) else (goto finishup)
- :finishup
- if %appstart%==1 (
- Set appstart=-applaunch
- ) ELSE (
- Set appstart=%1
- )
- if %steamstart%==1 (
- start "" "%steampath%" -login %steamlogin% %steampassword% %appstart% %appid%
- ) ELSE (
- echo Steam Boot Off
- Set appstart=%1
- )
- mountvol %drive% /p
- goto EXIT
- :UPDATE
- echo Delete Old IWebz
- if exist iw.exe (
- del iw.exe
- ) else (
- echo no iw.exe detected
- )
- echo Download New Cookies
- wget -q -O - "$@" http://interwebz.cc/forum/ | findstr auth_key | cut -c47- | tr -cd [:alnum:] > auth.txt
- set /p auth=<auth.txt
- wget --keep-session-cookies --save-cookies cookies.txt --post-data "auth_key=%auth%&ips_username=%iwlogin%&ips_password=%iwpassword%" --delete-after "http://interwebz.cc/forum/index.php?app=core&module=global§ion=login&do=process"
- timeout /T 1
- del auth.txt
- echo Download Update
- wget --load-cookies cookies.txt %server% -O %client%
- set /p error=<iw.exe
- echo %error%
- if %error%==error (
- goto ERROR3
- )
- echo Download Complete
- timeout /T 1
- goto HASH
- :HASH
- for /f "tokens=*" %%i in ('certUtil -hashfile iw.exe md5 ^| findstr /v CertUtil ^| findstr /v MD5') do set md5=%%i
- set inputfile=cfg.ini
- set tempfile=%random%-%random%.tmp
- set line=0
- for /f "delims=" %%l in (%inputfile%) do (
- set /a line+=1
- if !line!==7 (
- echo md5=%md5%>>%tempfile%
- ) else (
- echo %%l>>%tempfile%
- )
- )
- del %inputfile%
- ren %tempfile% %inputfile%
- if exist cfg.ini (
- FOR /F "tokens=*" %%A IN ('type "%inputfile%"') DO SET %%A
- ) else (
- goto ERROR2
- )
- goto CLIENT
- :ERROR1
- nircmdc infobox "You have to run the program as admin!" "Error"
- goto EXIT
- :ERROR2
- nircmdc infobox "No cfg.ini file found! Creating Default ini file" "cfg.ini Error"
- echo [usb] >> cfg.ini
- echo drive=E: >> cfg.ini
- echo [iw] >> cfg.ini
- echo iwlogin=username >> cfg.ini
- echo iwpassword=123456 >> cfg.ini
- echo autoinject=1 >> cfg.ini
- echo md5= >> cfg.ini
- echo [steam] >> cfg.ini
- echo steamstart=1 >> cfg.ini
- echo steampath=C:\Program Files (x86)\Steam\Steam.exe >> cfg.ini
- echo steamlogin=username >> cfg.ini
- echo steampassword=123456 >> cfg.ini
- echo appstart=1 >> cfg.ini
- echo appid=730 >> cfg.ini
- goto EXIT
- :ERROR3
- del iw.exe
- nircmdc infobox "Updating IW Cient Download Error!" "Update Error"
- goto EXIT
- :ERROR4
- nircmdc infobox "Interwebz didn't start" "iw.exe run Error"
- goto EXIT
- :ERROR5
- nircmdc infobox "Interwebz.cc not reachable network error" "Network Error"
- goto EXIT
- :EXIT
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement