lyogadi

Gunny Launcher [Full Version]

Jan 4th, 2021 (edited)
1,529
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Outfile_type=a3x
  3. #AutoIt3Wrapper_Tidy_Stop_OnError=n
  4. #AutoIt3Wrapper_Run_Au3Stripper=y
  5. #AutoIt3Wrapper_Tidy_Stop_OnError=n
  6. #Au3Stripper_Parameters=/sf /sv /rm /pe
  7. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  8. ;*****************************************
  9. #AutoIt3Wrapper_Au3stripper_OnError=ForceUse
  10. ;*****************************************
  11.  
  12. #include-once
  13. #include <StaticConstants.au3>
  14. #include <GUIConstantsEx.au3>
  15. #include <WindowsConstants.au3>
  16. #Include <GuiButton.au3>
  17. #include <EditConstants.au3>
  18. #include <ComboConstants.au3>
  19.  
  20. Global $Form1 = GUICreate("Gunny Launcher",269,128,-1,-1,-1,$WS_EX_TOPMOST)
  21. GUICtrlCreateLabel("Username",11,10,74,15,-1,-1)
  22. GUICtrlSetFont(-1,11,400,0,"Arial")
  23. GUICtrlSetBkColor(-1,"-2")
  24. GUICtrlCreateLabel("Password",11,35,74,15,-1,-1)
  25. GUICtrlSetFont(-1,11,400,0,"Arial")
  26. GUICtrlSetBkColor(-1,"-2")
  27. Global $Ip_Username = GUICtrlCreateInput("",110,7,150,22,-1,$WS_EX_CLIENTEDGE)
  28. GUICtrlSetFont(-1,11,400,0,"Arial")
  29. Global $Ip_Password = GUICtrlCreateInput("",110,32,150,22,-1,$WS_EX_CLIENTEDGE)
  30. GUICtrlSetFont(-1,11,400,0,"Arial")
  31. Global $Bt_Login = GUICtrlCreateButton("Login",139,90,100,30,-1,-1)
  32. GUICtrlSetFont(-1,11,400,0,"Arial")
  33. Global $Cb_Server = GUICtrlCreateCombo("",110,57,150,24,-1,-1)
  34. GUICtrlSetData(-1,"")
  35. GUICtrlSetFont(-1,11,400,0,"Arial")
  36. GUICtrlCreateLabel("Server",11,60,50,15,-1,-1)
  37. GUICtrlSetFont(-1,11,400,0,"Arial")
  38. GUICtrlSetBkColor(-1,"-2")
  39. Global $Bt_AutoLogin = GUICtrlCreateButton("Auto Login",31,90,100,30,-1,-1)
  40. GUICtrlSetFont(-1,11,400,0,"Arial")
  41.  
  42. #include <_HttpRequest.au3>
  43. #include <Array.au3>
  44. #include <IE.au3>
  45.  
  46. ; AccountLogin.txt format
  47. ; id1|pass1|server name
  48. ; gunnyclone0|gunnyclone0|Gà Con
  49.  
  50. Global $isFlashObj = True
  51.  
  52. Global $cloneUser = "gunnyclone0"
  53. Global $clonePass = "gunnyclone0"
  54.  
  55. Global $ServerList = _GetServerList()
  56.  
  57. For $sv in $ServerList
  58.     GUICtrlSetData($Cb_Server, $sv, "Gà Con")
  59. Next
  60.  
  61. GUISetState()
  62.  
  63. Local $sMsg
  64. While 1
  65.     $sMsg = GUIGetMsg(1)
  66.     If $sMsg[1] = $Form1 Then
  67.             Switch $sMsg[0]
  68.                 Case $GUI_EVENT_CLOSE
  69.                     Exit
  70.                 Case $Bt_Login
  71.                     _Launch(GUICtrlRead($Ip_Username), GUICtrlRead($Ip_Password), GUICtrlRead($Cb_Server), $isFlashObj)
  72.                 Case $Bt_AutoLogin
  73.                     Local $AccArray = FileReadToArray(@ScriptDir & "\AccountLogin.txt")
  74.                     For $Acc in $AccArray
  75.                         Local $rAcc = StringSplit($Acc, "|", 2)
  76.                         _Launch($rAcc[0], $rAcc[1], $rAcc[2], $isFlashObj)
  77.                     Next
  78.  
  79.             EndSwitch
  80.         Else
  81.             Switch $sMsg[0]
  82.                 Case $GUI_EVENT_CLOSE
  83.                     GUIDelete($sMsg[1])
  84.             EndSwitch
  85.     EndIf
  86. Wend
  87.  
  88. Func _Launch($username, $password, $server, $isFlashObj = False)
  89.     _HttpRequest_SessionClear()
  90.     _HttpRequest(0, 'http://idgunny.360game.vn?download=direct')
  91.     Local $data = _HttpRequest(1, 'https://sso3.zing.vn/xlogin', _Data2SendEncode('u=' & $username & '&p=' & $password & '&u1=http%3A%2F%2Fidgunny.360game.vn%2Flogin-game%3Fdownload%3Ddirect%26sid%3Dnone%26err%3D1&fp=http%3A%2F%2Fidgunny.360game.vn%2Flogin-game%3Fdownload%3Ddirect%26sid%3Dnone%26err%3D1&pid=243&apikey=848dfc7c1dfe4da3b8dd3c58f8d34be8'))
  92.     Local $id = _GetLocationRedirect()
  93.  
  94.     $data = _HTMLDecode(_HttpRequest(2, 'http://idgunny.360game.vn/server-game?download=direct&sid=none&err=1&mess=succ&sid=' & $id))
  95.  
  96.     $data = StringTrimLeft(StringLower($data), StringInStr($data, 'title="' & StringLower($server)))
  97.     $data = StringRegExp($data, 'href="(.*?)">', 3)
  98.     If @error Then Exit MsgBox(4096, 'Lỗi', 'Đăng nhập thất bại')
  99.     ConsoleWrite($data[0])
  100.  
  101.     $data = _HttpRequest(2, $data[0])
  102.  
  103.     Local $Key = StringRegExp($data, 'key=(.*?)"', 3)
  104.     If @error Then Exit MsgBox(4096, 'Lỗi', 'Đăng nhập thất bại')
  105.  
  106.     Local $SeverID = StringRegExp($data, 'src="http:\/\/s(.*?)\.', 3)
  107.     If @error Then Exit MsgBox(4096, 'Lỗi', 'Đăng nhập thất bại')
  108.  
  109.     If $isFlashObj Then
  110.         Local $oSWF = ObjCreate("ShockwaveFlash.ShockwaveFlash.1")
  111.     Else
  112.         Local $oSWF = _IECreateEmbedded()
  113.     EndIf
  114.  
  115.     If @error Or Not IsObj($oSWF) Then Exit MsgBox(4096, 'Lỗi', 'Vui lòng cài Flash ActiveX')
  116.     GUICreate("Gunny Client", 1000, 600);, Default, Default, Default, Default, $Form1)
  117.     GUICtrlCreateObj($oSWF, 0, 0, 1000, 600)
  118.     GUISetState()
  119.  
  120.     If $isFlashObj Then
  121.         With $oSWF
  122.             .Movie = StringFormat('http://res%s.gn.zing.vn/flash/Loading.swf?user=%s&key=%s&isGuest=False&ua=&fbapp=false&v=&rand=&config=http://s%s.gn.zing.vn/config.xml&sessionId=%s', $SeverID[0] == "1" ? "" : $SeverID[0], $username, $Key[0], $SeverID[0], $id)
  123.             .allowScriptAccess = "always"
  124.             .quality2 = "high"
  125.             .menu = "true";"false"
  126.             .bgcolor = "#000000"
  127.             .wmode = "direct"
  128.         EndWith
  129.     Else
  130.         _IENavigate($oSWF,StringFormat("http://s%s.gn.zing.vn/Default.aspx?user=%s&key=%s", $SeverID[0], $username, $Key[0]))
  131.     EndIf
  132.  
  133. EndFunc
  134.  
  135. Func _GetServerList()
  136.     _HttpRequest_SessionClear()
  137.     _HttpRequest(0, 'http://idgunny.360game.vn?download=direct')
  138.     Local $data = _HttpRequest(1, 'https://sso3.zing.vn/xlogin', _Data2SendEncode('u=' & $cloneUser & '&p=' & $clonePass & '&u1=http%3A%2F%2Fidgunny.360game.vn%2Flogin-game%3Fdownload%3Ddirect%26sid%3Dnone%26err%3D1&fp=http%3A%2F%2Fidgunny.360game.vn%2Flogin-game%3Fdownload%3Ddirect%26sid%3Dnone%26err%3D1&pid=243&apikey=848dfc7c1dfe4da3b8dd3c58f8d34be8'))
  139.     Local $id = _GetLocationRedirect()
  140.  
  141.     $data = _HTMLDecode(_HttpRequest(2, 'http://idgunny.360game.vn/server-game?download=direct&sid=none&err=1&mess=succ&sid=' & $id))
  142.  
  143.     $data = StringTrimLeft($data, StringInStr($data, 'class="Active ServerList"'))
  144.  
  145.     Return StringRegExp($data, '<li><a title="(.*?)"', 3)
  146. EndFunc
RAW Paste Data