Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.81 KB | None | 0 0
  1. @echo off
  2. goto check_Permissions
  3. :check_Permissions
  4. echo Administrative permissions required. Detecting permissions...
  5. net session >nul 2>&1
  6. if %errorLevel% == 0 (
  7. echo Success: Administrative permissions confirmed.
  8. goto START
  9. ) else (
  10. echo Failure: Current permissions inadequate.
  11. echo Run Bat As Admin!
  12. goto ERROR1
  13. )
  14.  
  15. :START
  16. pushd %~dp0
  17. setlocal enableextensions enabledelayedexpansion
  18.  
  19. Set client=iw.exe
  20. Set server=http://interwebz.cc/forum/download.php
  21. set inputfile=cfg.ini
  22. set tempfile=%random%-%random%.tmp
  23.  
  24. if exist cfg.ini (
  25. FOR /F "tokens=*" %%A IN ('type "%inputfile%"') DO SET %%A
  26. ) else (
  27. goto ERROR2
  28. )
  29.  
  30. if %appid%==730 (
  31. set game=csgo.exe
  32. )
  33. if %appid%==550 (
  34. set game=l4d2.exe
  35. )
  36. if %appid%==240 (
  37. set game=hl2.exe
  38. )
  39. if %appid%==440 (
  40. set game=hl2.exe
  41. )
  42.  
  43. ping -n 2 interwebz.cc
  44. IF ERRORLEVEL 1 (goto ERROR5 ) else (echo interwebz reachable)
  45.  
  46. tasklist /NH /FI "imagename eq iw.exe" 2>nul |find /i "iw.exe" >nul
  47. If not errorlevel 1 (Taskkill /IM iw.exe /F)
  48. tasklist /NH /FI "imagename eq wget.exe" 2>nul |find /i "wget.exe" >nul
  49. If not errorlevel 1 (Taskkill /IM wget.exe /F)
  50. tasklist /NH /FI "imagename eq csgo.exe" 2>nul |find /i "csgo.exe" >nul
  51. If not errorlevel 1 (Taskkill /IM csgo.exe /F)
  52. tasklist /NH /FI "imagename eq hl2.exe" 2>nul |find /i "hl2.exe" >nul
  53. If not errorlevel 1 (Taskkill /IM hl2.exe /F)
  54. tasklist /NH /FI "imagename eq l4d2.exe" 2>nul |find /i "l4d2.exe" >nul
  55. If not errorlevel 1 (Taskkill /IM l4d2.exe /F)
  56. tasklist /NH /FI "imagename eq GameOverlayUI.exe" 2>nul |find /i "GameOverlayUI.exe" >nul
  57. If not errorlevel 1 (Taskkill /IM GameOverlayUI.exe /F)
  58. tasklist /NH /FI "imagename eq steam.exe" 2>nul |find /i "steam.exe" >nul
  59. If not errorlevel 1 (Taskkill /IM steam.exe /F)
  60. tasklist /NH /FI "imagename eq discord.exe" 2>nul |find /i "discord.exe" >nul
  61. If not errorlevel 1 (Taskkill /IM discord.exe /F)
  62. goto UPDATE
  63.  
  64. :CLIENT
  65. Elevate.exe %client% %iwlogin% %iwpassword%
  66. IF ERRORLEVEL 1 (goto ERROR4 ) else (echo no error on iw run)
  67. if %autoinject%==1 (
  68. timeout /T 1
  69. nircmdc win hide process %client%
  70. timeout /T 3
  71. nircmdc dlgany %client% "" click 1 yes
  72. timeout /T 6
  73. nircmdc dlg "" "Success" click yes
  74. ) ELSE (
  75. echo Autoinject Off
  76. )
  77.  
  78. :checkagain
  79. timeout /T 1
  80. echo Wait for injection
  81. tasklist /NH /FI "imagename eq %client%" 2>nul |find /i "%client%" >nul
  82. If not errorlevel 1 (goto checkagain) else (goto finishup)
  83.  
  84. :finishup
  85. if %appstart%==1 (
  86. Set appstart=-applaunch
  87. ) ELSE (
  88. Set appstart=%1
  89. )
  90. if %steamstart%==1 (
  91. start "" "%steampath%" -login %steamlogin% %steampassword% %appstart% %appid%
  92. ) ELSE (
  93. echo Steam Boot Off
  94. Set appstart=%1
  95. )
  96. mountvol %drive% /p
  97. goto EXIT
  98.  
  99. :UPDATE
  100. echo Delete Old IWebz
  101. if exist iw.exe (
  102. del iw.exe
  103. ) else (
  104. echo no iw.exe detected
  105. )
  106. echo Download New Cookies
  107. wget -q -O - "$@" http://interwebz.cc/forum/ | findstr auth_key | cut -c47- | tr -cd [:alnum:] > auth.txt
  108. set /p auth=<auth.txt
  109. 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&section=login&do=process"
  110. timeout /T 1
  111. del auth.txt
  112. echo Download Update
  113. wget --load-cookies cookies.txt %server% -O %client%
  114. set /p error=<iw.exe
  115. echo %error%
  116. if %error%==error (
  117. goto ERROR3
  118. )
  119. echo Download Complete
  120. timeout /T 1
  121. goto HASH
  122.  
  123. :HASH
  124. for /f "tokens=*" %%i in ('certUtil -hashfile iw.exe md5 ^| findstr /v CertUtil ^| findstr /v MD5') do set md5=%%i
  125. set inputfile=cfg.ini
  126. set tempfile=%random%-%random%.tmp
  127. set line=0
  128. for /f "delims=" %%l in (%inputfile%) do (
  129. set /a line+=1
  130. if !line!==7 (
  131. echo md5=%md5%>>%tempfile%
  132. ) else (
  133. echo %%l>>%tempfile%
  134. )
  135. )
  136. del %inputfile%
  137. ren %tempfile% %inputfile%
  138. if exist cfg.ini (
  139. FOR /F "tokens=*" %%A IN ('type "%inputfile%"') DO SET %%A
  140. ) else (
  141. goto ERROR2
  142. )
  143. goto CLIENT
  144.  
  145. :ERROR1
  146. nircmdc infobox "You have to run the program as admin!" "Error"
  147. goto EXIT
  148.  
  149. :ERROR2
  150. nircmdc infobox "No cfg.ini file found! Creating Default ini file" "cfg.ini Error"
  151. echo [usb] >> cfg.ini
  152. echo drive=E: >> cfg.ini
  153. echo [iw] >> cfg.ini
  154. echo iwlogin=username >> cfg.ini
  155. echo iwpassword=123456 >> cfg.ini
  156. echo autoinject=1 >> cfg.ini
  157. echo md5= >> cfg.ini
  158. echo [steam] >> cfg.ini
  159. echo steamstart=1 >> cfg.ini
  160. echo steampath=C:\Program Files (x86)\Steam\Steam.exe >> cfg.ini
  161. echo steamlogin=username >> cfg.ini
  162. echo steampassword=123456 >> cfg.ini
  163. echo appstart=1 >> cfg.ini
  164. echo appid=730 >> cfg.ini
  165. goto EXIT
  166.  
  167. :ERROR3
  168. del iw.exe
  169. nircmdc infobox "Updating IW Cient Download Error!" "Update Error"
  170. goto EXIT
  171.  
  172. :ERROR4
  173. nircmdc infobox "Interwebz didn't start" "iw.exe run Error"
  174. goto EXIT
  175.  
  176. :ERROR5
  177. nircmdc infobox "Interwebz.cc not reachable network error" "Network Error"
  178. goto EXIT
  179.  
  180. :EXIT
  181. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement