Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
1,303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 8.35 KB | None | 0 0
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Icon=Sans titre 1.ico
  3. #AutoIt3Wrapper_Compression=4
  4. #AutoIt3Wrapper_UseUpx=y
  5. #AutoIt3Wrapper_UseX64=n
  6. #AutoIt3Wrapper_Res_Comment=Why are you looking this? :O
  7. #AutoIt3Wrapper_Res_Description=Auto-connect to steam
  8. #AutoIt3Wrapper_Res_Fileversion=1.2.2
  9. #AutoIt3Wrapper_Res_LegalCopyright=ShiiroSan for REVOLT Forum
  10. #AutoIt3Wrapper_Res_Language=1036
  11. #AutoIt3Wrapper_Run_Au3Stripper=y
  12. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  13. #include <ButtonConstants.au3>
  14. #include <GUIConstantsEx.au3>
  15. #include <GUIListBox.au3>
  16. #include <WindowsConstants.au3>
  17. #include <StaticConstants.au3>
  18. #include <EditConstants.au3>
  19. #include <Crypt.au3>
  20. #include<Array.au3>
  21. #include <GuiListView.au3>
  22. #include <File.au3>
  23.  
  24. #Region ### START Koda GUI section ### Form=
  25. Global $Form1 = GUICreate("Steam Account Manager by Shiirosan", 262, 289, 211, 203)
  26. GUISetIcon("C:\Users\Shiiro\Desktop\Sans titre 1.ico", -1)
  27. Global $Button1 = GUICtrlCreateButton("", 216, 8, 35, 33, $BS_ICON)
  28. GUICtrlSetImage(-1, "C:\Windows\System32\imageres.dll", -65)
  29. Global $Button16 = GUICtrlCreateButton("", 216, 50, 35, 33, $BS_ICON)
  30. GUICtrlSetImage(-1, "C:\Windows\System32\imageres.dll", -85)
  31. ;~ Global $List1 = GUICtrlCreateList("", 8, 8, 193, 227)
  32. ;~ GUICtrlSetData(-1, FileRead(@AppDataDir & "\SteamUsername.txt"))
  33. $idListview = GUICtrlCreateListView("", 8, 8, 193, 227)
  34. $hListView = GUICtrlGetHandle($idListview)
  35. ;~ _GUICtrlListView_AddColumn($hListView, "Account name", 193)
  36. _GUICtrlListView_InsertColumn($hListView, 1, "Account name", 189)
  37. $username = _FileCountLines(@AppDataDir & "\SteamUsername.txt")
  38. For $i = 1 To $username Step 1
  39.     _GUICtrlListView_AddItem($hListView, FileReadLine(@AppDataDir & "\SteamUsername.txt", $i))
  40. Next
  41. Global $Button2 = GUICtrlCreateButton("Connect to Steam Account", 72, 248, 139, 33)
  42. GUISetState(@SW_SHOW)
  43. #EndRegion ### END Koda GUI section ###
  44. #Region ### START Koda GUI section ### Form=
  45. Global $Form2 = GUICreate("Add a Steam Account", 201, 127, 489, 200)
  46. GUISetIcon("C:\Users\Shiiro\Desktop\Sans titre 1.ico", -1)
  47. Global $Label1 = GUICtrlCreateLabel("Username: ", 8, 16, 58, 17)
  48. Global $Label2 = GUICtrlCreateLabel("Password: ", 8, 48, 56, 17)
  49. Global $Input1 = GUICtrlCreateInput("", 72, 16, 121, 21)
  50. Global $Input2 = GUICtrlCreateInput("", 72, 48, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_PASSWORD))
  51. Global $Button3 = GUICtrlCreateButton("Add this Steam Account", 32, 80, 139, 33)
  52. GUISetState(@SW_HIDE)
  53. #EndRegion ### END Koda GUI section ###
  54. GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
  55. $Exit = 0
  56. _Crypt_Startup()
  57. Local $iAlgorithm = $CALG_RC4
  58. Local Const $sUserKey = "CryptPassword"
  59. ;~ $AccountNameSearching = StringRegExp(FileRead(RegRead("HKCU\Software\Valve\Steam", "SteamPath") & "\config\loginusers.vdf"), "AccountName", 3)
  60. ;~ $loginuservdf = _FileCountLines(RegRead("HKCU\Software\Valve\Steam", "SteamPath") & "\config\loginusers.vdf")
  61. While 1
  62.     $nMsg = GUIGetMsg()
  63.     Switch $nMsg
  64.         Case $GUI_EVENT_CLOSE
  65.             If $Exit Then
  66.                 GUISetState(@SW_HIDE, $Form2)
  67.                 $Exit = 0
  68.             Else
  69.                 Exit
  70.             EndIf
  71.         Case $Button1
  72.             $Exit = 1
  73.             GUISetState(@SW_SHOW, $Form2)
  74.         Case $Button2
  75.             $Index=_GUICtrlListView_GetSelectedIndices($idListView)
  76.             Connect($Index)
  77. ;~          Run(RegRead("HKCU\Software\Valve\Steam", "SteamPath") & "/Steam.exe" & " -login " & GUICtrlRead($List1) & " " & BinaryToString(_Crypt_DecryptData(IniRead(@AppDataDir & "\SteamAccount.dat", "Account", GUICtrlRead($List1), ""), $sUserKey, $iAlgorithm)))
  78.         Case $Button3
  79.             FileWrite(@AppDataDir & "\SteamUsername.txt", GUICtrlRead($Input1)&@CRLF)
  80.             IniWrite(@AppDataDir & "\SteamAccount.dat", "Account", GUICtrlRead($Input1), _Crypt_EncryptData(GUICtrlRead($Input2), $sUserKey, $iAlgorithm))
  81.             _GUICtrlListView_DeleteAllItems($hListview)
  82.             $username = _FileCountLines(@AppDataDir & "\SteamUsername.txt")
  83.             For $i = 1 To $username Step 1
  84.                 _GUICtrlListView_AddItem($hListView, FileReadLine(@AppDataDir & "\SteamUsername.txt", $i))
  85.             Next
  86.             GUICtrlSetData($Input1, "")
  87.             GUICtrlSetData($Input2, "")
  88.             MsgBox(0, "Done!", "Steam Account saved succesfully!")
  89.         Case $Button16
  90.             $Index=_GUICtrlListView_GetSelectedIndices($idListView)
  91.             _FileWriteToLine(@AppDataDir & "\SteamUsername.txt", $Index+1, "", 1)
  92.             _FileWriteToLine(@AppDataDir & "\SteamAccount.dat", $Index+2, "", 1)
  93. ;~          For $x = 1 to $aRecords[0]
  94. ;~              if stringinstr($aRecords[$x], _GUICtrlListView_GetItemText($idListView,$Index)) then _FileWriteToLine(@AppDataDir & "\SteamUsername.txt", $x, "", 1)
  95. ;~          Next
  96.             _GUICtrlListView_DeleteAllItems($hListview)
  97.             $username = _FileCountLines(@AppDataDir & "\SteamUsername.txt")
  98.             For $i = 1 To $username Step 1
  99.                 _GUICtrlListView_AddItem($hListView, FileReadLine(@AppDataDir & "\SteamUsername.txt", $i))
  100.             Next
  101.         EndSwitch
  102. WEnd
  103.  
  104. Func Connect($ID)
  105. ;~  MsgBox(0,"",_GUICtrlListView_GetItemText($hListView,$ID))
  106.     If ProcessExists("Steam.exe") Then
  107.         $askingtoLeave = MsgBox(32 + 4, "Steam Account Changer", "You need to exit Steam before switching to another account." & @CRLF & "Exit Steam now?", 0, $Form1)
  108.         If $askingtoLeave <> 6 Then Exit 1
  109.         Run(RegRead("HKCU\Software\Valve\Steam", "SteamPath") & "/Steam.exe -shutdown")
  110.     EndIf
  111.     While ProcessExists("Steam.exe")
  112.         Sleep(10)
  113.     WEnd
  114.     Sleep(3000)
  115.     Run(RegRead("HKCU\Software\Valve\Steam", "SteamPath") & "/Steam.exe" & " -login " & _GUICtrlListView_GetItemText($hListView,$ID) & " " & BinaryToString(_Crypt_DecryptData(IniRead(@AppDataDir & "\SteamAccount.dat", "Account", _GUICtrlListView_GetItemText($hListView,$ID), ""), $sUserKey, $iAlgorithm)))
  116. EndFunc
  117.  
  118. Func _StringBetween2($s, $from, $to)
  119.     $x = StringInStr($s, $from) + StringLen($from)
  120.     $y = StringInStr(StringTrimLeft($s, $x), $to)
  121.     Return StringMid($s, $x, $y)
  122. EndFunc   ;==>_StringBetween2
  123.  
  124. Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
  125.     #forceref $hWnd, $iMsg, $wParam
  126.     Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
  127.     $hWndListView = $hListView
  128.     If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)
  129.  
  130.     $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
  131.     $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
  132.     $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
  133.     $iCode = DllStructGetData($tNMHDR, "Code")
  134.     Switch $hWndFrom
  135.         Case $hWndListView
  136.             Switch $iCode
  137.                 Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button
  138.                     $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam)
  139.                     _DebugPrint("$NM_DBLCLK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _
  140.                             "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _
  141.                             "-->Code:" & @TAB & $iCode & @CRLF & _
  142.                             "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _
  143.                             "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _
  144.                             "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _
  145.                             "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _
  146.                             "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _
  147.                             "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _
  148.                             "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _
  149.                             "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _
  150.                             "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
  151.                             if DllStructGetData($tInfo, "Index") <> -1 Then
  152. ;~                              MsgBox(0,"",DllStructGetData($tInfo, "Index"))
  153.                                 Connect(DllStructGetData($tInfo, "Index"))
  154.                             EndIf
  155.                     ; No return value
  156.             EndSwitch
  157.     EndSwitch
  158.     Return $GUI_RUNDEFMSG
  159. EndFunc   ;==>WM_NOTIFY
  160.  
  161. Func _DebugPrint($s_Text , $sLine = @ScriptLineNumber)
  162.     ConsoleWrite( _
  163.             "!===========================================================" & @CRLF & _
  164.             "+======================================================" & @CRLF & _
  165.             "-->Line(" & StringFormat("%04d", $sLine) & "):" & @TAB & $s_Text  & @CRLF & _
  166.             "+======================================================" & @CRLF)
  167. EndFunc   ;==>_DebugPrint
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement