Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Icon=Sans titre 1.ico
- #AutoIt3Wrapper_Compression=4
- #AutoIt3Wrapper_UseUpx=y
- #AutoIt3Wrapper_UseX64=n
- #AutoIt3Wrapper_Res_Comment=Why are you looking this? :O
- #AutoIt3Wrapper_Res_Description=Auto-connect to steam
- #AutoIt3Wrapper_Res_Fileversion=1.2.2
- #AutoIt3Wrapper_Res_LegalCopyright=ShiiroSan for REVOLT Forum
- #AutoIt3Wrapper_Res_Language=1036
- #AutoIt3Wrapper_Run_Au3Stripper=y
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #include <ButtonConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <GUIListBox.au3>
- #include <WindowsConstants.au3>
- #include <StaticConstants.au3>
- #include <EditConstants.au3>
- #include <Crypt.au3>
- #include<Array.au3>
- #include <GuiListView.au3>
- #include <File.au3>
- #Region ### START Koda GUI section ### Form=
- Global $Form1 = GUICreate("Steam Account Manager by Shiirosan", 262, 289, 211, 203)
- GUISetIcon("C:\Users\Shiiro\Desktop\Sans titre 1.ico", -1)
- Global $Button1 = GUICtrlCreateButton("", 216, 8, 35, 33, $BS_ICON)
- GUICtrlSetImage(-1, "C:\Windows\System32\imageres.dll", -65)
- Global $Button16 = GUICtrlCreateButton("", 216, 50, 35, 33, $BS_ICON)
- GUICtrlSetImage(-1, "C:\Windows\System32\imageres.dll", -85)
- ;~ Global $List1 = GUICtrlCreateList("", 8, 8, 193, 227)
- ;~ GUICtrlSetData(-1, FileRead(@AppDataDir & "\SteamUsername.txt"))
- $idListview = GUICtrlCreateListView("", 8, 8, 193, 227)
- $hListView = GUICtrlGetHandle($idListview)
- ;~ _GUICtrlListView_AddColumn($hListView, "Account name", 193)
- _GUICtrlListView_InsertColumn($hListView, 1, "Account name", 189)
- $username = _FileCountLines(@AppDataDir & "\SteamUsername.txt")
- For $i = 1 To $username Step 1
- _GUICtrlListView_AddItem($hListView, FileReadLine(@AppDataDir & "\SteamUsername.txt", $i))
- Next
- Global $Button2 = GUICtrlCreateButton("Connect to Steam Account", 72, 248, 139, 33)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- #Region ### START Koda GUI section ### Form=
- Global $Form2 = GUICreate("Add a Steam Account", 201, 127, 489, 200)
- GUISetIcon("C:\Users\Shiiro\Desktop\Sans titre 1.ico", -1)
- Global $Label1 = GUICtrlCreateLabel("Username: ", 8, 16, 58, 17)
- Global $Label2 = GUICtrlCreateLabel("Password: ", 8, 48, 56, 17)
- Global $Input1 = GUICtrlCreateInput("", 72, 16, 121, 21)
- Global $Input2 = GUICtrlCreateInput("", 72, 48, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_PASSWORD))
- Global $Button3 = GUICtrlCreateButton("Add this Steam Account", 32, 80, 139, 33)
- GUISetState(@SW_HIDE)
- #EndRegion ### END Koda GUI section ###
- GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
- $Exit = 0
- _Crypt_Startup()
- Local $iAlgorithm = $CALG_RC4
- Local Const $sUserKey = "CryptPassword"
- ;~ $AccountNameSearching = StringRegExp(FileRead(RegRead("HKCU\Software\Valve\Steam", "SteamPath") & "\config\loginusers.vdf"), "AccountName", 3)
- ;~ $loginuservdf = _FileCountLines(RegRead("HKCU\Software\Valve\Steam", "SteamPath") & "\config\loginusers.vdf")
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- If $Exit Then
- GUISetState(@SW_HIDE, $Form2)
- $Exit = 0
- Else
- Exit
- EndIf
- Case $Button1
- $Exit = 1
- GUISetState(@SW_SHOW, $Form2)
- Case $Button2
- $Index=_GUICtrlListView_GetSelectedIndices($idListView)
- Connect($Index)
- ;~ Run(RegRead("HKCU\Software\Valve\Steam", "SteamPath") & "/Steam.exe" & " -login " & GUICtrlRead($List1) & " " & BinaryToString(_Crypt_DecryptData(IniRead(@AppDataDir & "\SteamAccount.dat", "Account", GUICtrlRead($List1), ""), $sUserKey, $iAlgorithm)))
- Case $Button3
- FileWrite(@AppDataDir & "\SteamUsername.txt", GUICtrlRead($Input1)&@CRLF)
- IniWrite(@AppDataDir & "\SteamAccount.dat", "Account", GUICtrlRead($Input1), _Crypt_EncryptData(GUICtrlRead($Input2), $sUserKey, $iAlgorithm))
- _GUICtrlListView_DeleteAllItems($hListview)
- $username = _FileCountLines(@AppDataDir & "\SteamUsername.txt")
- For $i = 1 To $username Step 1
- _GUICtrlListView_AddItem($hListView, FileReadLine(@AppDataDir & "\SteamUsername.txt", $i))
- Next
- GUICtrlSetData($Input1, "")
- GUICtrlSetData($Input2, "")
- MsgBox(0, "Done!", "Steam Account saved succesfully!")
- Case $Button16
- $Index=_GUICtrlListView_GetSelectedIndices($idListView)
- _FileWriteToLine(@AppDataDir & "\SteamUsername.txt", $Index+1, "", 1)
- _FileWriteToLine(@AppDataDir & "\SteamAccount.dat", $Index+2, "", 1)
- ;~ For $x = 1 to $aRecords[0]
- ;~ if stringinstr($aRecords[$x], _GUICtrlListView_GetItemText($idListView,$Index)) then _FileWriteToLine(@AppDataDir & "\SteamUsername.txt", $x, "", 1)
- ;~ Next
- _GUICtrlListView_DeleteAllItems($hListview)
- $username = _FileCountLines(@AppDataDir & "\SteamUsername.txt")
- For $i = 1 To $username Step 1
- _GUICtrlListView_AddItem($hListView, FileReadLine(@AppDataDir & "\SteamUsername.txt", $i))
- Next
- EndSwitch
- WEnd
- Func Connect($ID)
- ;~ MsgBox(0,"",_GUICtrlListView_GetItemText($hListView,$ID))
- If ProcessExists("Steam.exe") Then
- $askingtoLeave = MsgBox(32 + 4, "Steam Account Changer", "You need to exit Steam before switching to another account." & @CRLF & "Exit Steam now?", 0, $Form1)
- If $askingtoLeave <> 6 Then Exit 1
- Run(RegRead("HKCU\Software\Valve\Steam", "SteamPath") & "/Steam.exe -shutdown")
- EndIf
- While ProcessExists("Steam.exe")
- Sleep(10)
- WEnd
- Sleep(3000)
- 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)))
- EndFunc
- Func _StringBetween2($s, $from, $to)
- $x = StringInStr($s, $from) + StringLen($from)
- $y = StringInStr(StringTrimLeft($s, $x), $to)
- Return StringMid($s, $x, $y)
- EndFunc ;==>_StringBetween2
- Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
- #forceref $hWnd, $iMsg, $wParam
- Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
- $hWndListView = $hListView
- If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)
- $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
- $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
- $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
- $iCode = DllStructGetData($tNMHDR, "Code")
- Switch $hWndFrom
- Case $hWndListView
- Switch $iCode
- Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button
- $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam)
- _DebugPrint("$NM_DBLCLK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _
- "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _
- "-->Code:" & @TAB & $iCode & @CRLF & _
- "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _
- "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _
- "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _
- "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _
- "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _
- "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _
- "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _
- "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _
- "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
- if DllStructGetData($tInfo, "Index") <> -1 Then
- ;~ MsgBox(0,"",DllStructGetData($tInfo, "Index"))
- Connect(DllStructGetData($tInfo, "Index"))
- EndIf
- ; No return value
- EndSwitch
- EndSwitch
- Return $GUI_RUNDEFMSG
- EndFunc ;==>WM_NOTIFY
- Func _DebugPrint($s_Text , $sLine = @ScriptLineNumber)
- ConsoleWrite( _
- "!===========================================================" & @CRLF & _
- "+======================================================" & @CRLF & _
- "-->Line(" & StringFormat("%04d", $sLine) & "):" & @TAB & $s_Text & @CRLF & _
- "+======================================================" & @CRLF)
- EndFunc ;==>_DebugPrint
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement