Hallo!
Gleich mal vorweg: das Programm wird wahrscheinlich nur für Rapidshare-Fans was taugen. Damit können nämlich Punkte gesammelt werden.
Screenshot:
[Blockierte Grafik: http://i33.tinypic.com/b81iqp.jpg]
Download:
333 KB bei Fast-Load.net
Source
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=fireicon.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Run_Obfuscator=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <File.au3>
#include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <String.au3>
#include <IE.au3>
HotKeySet("{ESC}","abbrechen")
Global $quitloop
Global $autostart
Opt('TrayMenuMode', 1)
Opt('TrayAutoPause', 0)
$TrayShow = TrayCreateItem('Show RSP.Gen')
$TrayExit = TrayCreateItem('Quit')
$GUI = GUICreate('RSP.Generator',190,90, -1, -1)
$radio_reconnect = GUICtrlCreateRadio("Reconnect",5,5,90,20)
$radio_proxy = GUICtrlCreateRadio("Proxy",5,25,90,20)
$cb_autorun = GUICtrlCreateCheckbox("Load @Startup",95,5,90,20)
$link_button = GUICtrlCreateButton("DL Link",95,25,90,20)
$Run = GUICtrlCreateButton("RUN",5,50,90,25)
GUICtrlSetFont(-1,11,1800)
$Spread = GUICtrlCreateButton("SPREAD",95,50,90,25)
GUICtrlSetFont(-1,11,1800)
$statuslabel = GUICtrlCreateLabel("",2,77,186,12,$SS_CENTER)
If Not FileExists(@ScriptDir&"\proxylist.txt") Then
FileInstall("C:\proxylist.txt",@ScriptDir&"\proxylist.txt")
Endif
If Not FileExists(@ScriptDir&"\reconnect.bat") Then
FileInstall("C:\reconnect.bat",@ScriptDir&"\reconnect.bat")
Endif
If Not FileExists(@ScriptDir&"\tmp.sav") Then
FileInstall("C:\tmp.sav",@ScriptDir&"\tmp.sav")
Endif
If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","NewIP_Methode") = "Reconnect" Then
GUICtrlSetState($radio_reconnect,$GUI_CHECKED)
EndIf
If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","NewIP_Methode") = "Proxy" Then
GUICtrlSetState($radio_proxy,$GUI_CHECKED)
EndIf
If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","RSP.Generator") <> "" Then
GUICtrlSetState($cb_autorun,$GUI_CHECKED)
EndIf
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_MINIMIZE
Opt('TrayIconHide', 0)
GUISetState(@SW_HIDE, $GUI)
While 2
Switch TrayGetMsg()
Case $TrayShow
Opt('TrayIconHide', 1)
GUISetState(@SW_SHOW, $GUI)
GUISetState(@SW_RESTORE, $GUI)
ExitLoop
Case $TrayExit
ExitLoop(2)
EndSwitch
WEnd
Case $GUI_EVENT_CLOSE
ExitLoop
Case $radio_reconnect
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","NewIP_Methode","REG_SZ","Reconnect")
Case $radio_proxy
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","NewIP_Methode","REG_SZ","Proxy")
Case $cb_autorun
If GUICtrlRead($cb_autorun) = 1 Then
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","RSP.Generator","REG_SZ",@ScriptDir&"\RSP.Generator.exe")
Else
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","RSP.Generator")
EndIf
Case $link_button
If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","Link") = "" Then
$chosen_link = "http://rapidshare.com/files/"
Else
$chosen_link = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","Link")
EndIf
$sInputBoxAnswer = InputBox("DL Link","Hier den Link zur Datei eingeben:",$chosen_link,"",250,120)
Select
Case @Error = 0 ;OK - The string returned is valid
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","Link","REG_SZ",$sInputBoxAnswer)
EndSelect
Case $Run
_Run()
Case $Spread
_Spread()
EndSwitch
Wend
Func _Run()
$file = FileOpen(@Scriptdir&"\tmp.sav",0)
$quitloop = 0
GUICtrlSetState($Run,$GUI_DISABLE)
GUICtrlSetState($Spread,$GUI_DISABLE)
If Ping("www.rapidshare.com", 400) <> 0 Then
GUICtrlSetData($statuslabel,"... downloading ...")
If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","NewIP_Methode") = "Reconnect" Then
Do
_Download(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","Link"))
If $quitloop = 1 Then ExitLoop
_Download(_StringEncrypt(0,FileReadLine($file,1),"rspgenpass",1))
If $quitloop = 1 Then ExitLoop
_Download(_StringEncrypt(0,FileReadLine($file,2),"rspgenpass",1))
If $quitloop = 1 Then ExitLoop
GUICtrlSetData($statuslabel,"... reconnecting ...")
RunWait(@Scriptdir&"\reconnect.bat","",@SW_HIDE)
GUICtrlSetData($statuslabel,"... downloading ...")
_Download(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","Link"))
If $quitloop = 1 Then ExitLoop
_Download(_StringEncrypt(0,FileReadLine($file,1),"rspgenpass",1))
If $quitloop = 1 Then ExitLoop
_Download(_StringEncrypt(0,FileReadLine($file,2),"rspgenpass",1))
If $quitloop = 1 Then ExitLoop
GUICtrlSetData($statuslabel,"... reconnecting ...")
RunWait(@Scriptdir&"\reconnect.bat","",@SW_HIDE)
GUICtrlSetData($statuslabel,"... downloading ...")
_Download(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","Link"))
If $quitloop = 1 Then ExitLoop
_Download(_StringEncrypt(0,FileReadLine($file,1),"rspgenpass",1))
If $quitloop = 1 Then ExitLoop
_Download(_StringEncrypt(0,FileReadLine($file,3),"rspgenpass",1))
If $quitloop = 1 Then ExitLoop
GUICtrlSetData($statuslabel,"... reconnecting ...")
RunWait(@Scriptdir&"\reconnect.bat","",@SW_HIDE)
GUICtrlSetData($statuslabel,"... downloading ...")
Until $quitloop = 1
EndIf
If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","NewIP_Methode") = "Proxy" Then
$proxylist = FileOpen(@Scriptdir&"\proxylist.txt",0)
$i = 0
Do
$i += 1
$proxy = FileReadLine($proxylist,$i)
HttpSetProxy(2,$proxy)
If $i = _FileCountLines(@Scriptdir&"\proxylist.txt") Then $i = 0
_Download(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","Link"))
If $quitloop = 1 Then ExitLoop
_Download(_StringEncrypt(0,FileReadLine($file,1),"rspgenpass",1))
If $quitloop = 1 Then ExitLoop
_Download(_StringEncrypt(0,FileReadLine($file,2),"rspgenpass",1))
If $quitloop = 1 Then ExitLoop
GUICtrlSetData($statuslabel,"... setting proxy ...")
$i += 1
$proxy = FileReadLine($proxylist,$i)
HttpSetProxy(2,$proxy)
If $i = _FileCountLines(@Scriptdir&"\proxylist.txt") Then $i = 0
GUICtrlSetData($statuslabel,"... downloading ...")
_Download(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","Link"))
If $quitloop = 1 Then ExitLoop
_Download(_StringEncrypt(0,FileReadLine($file,1),"rspgenpass",1))
If $quitloop = 1 Then ExitLoop
_Download(_StringEncrypt(0,FileReadLine($file,2),"rspgenpass",1))
If $quitloop = 1 Then ExitLoop
GUICtrlSetData($statuslabel,"... setting proxy ...")
$i += 1
$proxy = FileReadLine($proxylist,$i)
HttpSetProxy(2,$proxy)
If $i = _FileCountLines(@Scriptdir&"\proxylist.txt") Then $i = 0
GUICtrlSetData($statuslabel,"... downloading ...")
_Download(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","Link"))
If $quitloop = 1 Then ExitLoop
_Download(_StringEncrypt(0,FileReadLine($file,1),"rspgenpass",1))
If $quitloop = 1 Then ExitLoop
_Download(_StringEncrypt(0,FileReadLine($file,3),"rspgenpass",1))
If $quitloop = 1 Then ExitLoop
Until $quitloop = 1
FileClose($proxylist)
EndIf
Else
MsgBox(64,"","Cannot connect to rapidshare.com")
EndIf
GUICtrlSetState($Run,$GUI_ENABLE)
GUICtrlSetState($Spread,$GUI_ENABLE)
GUICtrlSetData($statuslabel,"")
FileClose($file)
EndFunc
Func abbrechen()
$quitloop = 1
EndFunc
Func _Spread()
If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","Spread") <> 1 Then
$Confirm = MsgBox(36,"Confirm","Really make a new version?" & @CRLF & "This can only be done once.")
Select
Case $Confirm = 6 ;Yes
$file = FileOpen(@Scriptdir&"\tmp.sav",0)
GUICtrlSetState($Run,$GUI_DISABLE)
GUICtrlSetState($Spread,$GUI_DISABLE)
GUICtrlSetData($statuslabel,"... exporting file ...")
$zip = @DesktopDir&"\RSP.Generator_new\RSP.Generator.zip"
$link1 = _StringEncrypt(0,FileReadLine($file,1),"rspgenpass",1)
$link3 = _StringEncrypt(0,FileReadLine($file,3),"rspgenpass",1)
$newfile = FileOpen(@TempDir&"\tmp.sav",2)
If @error Then MsgBox(0,"","error")
FileWriteLine($newfile,_StringEncrypt(1,RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","Link"),"rspgenpass",1)&@CRLF& _
_StringEncrypt(1,$link1,"rspgenpass",1)&@CRLF& _
_StringEncrypt(1,$link3,"rspgenpass",1)&@CRLF)
$link1 = ""
$link3 = ""
FileClose($newfile)
FileCopy(@ScriptFullPath,@DesktopDir&"\RSP.Generator_new\"&@ScriptName,9)
FileCopy(@TempDir&"\tmp.sav",@DesktopDir&"\RSP.Generator_new\tmp.sav",9)
FileDelete(@TempDir&"\tmp.sav")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\RSP.Gen","Spread","REG_SZ",1)
GUICtrlSetState($Run,$GUI_ENABLE)
GUICtrlSetState($Spread,$GUI_ENABLE)
GUICtrlSetData($statuslabel,"")
FileClose($file)
EndSelect
Else
MsgBox(64,"Error","You have already made your own version."&@CRLF&"Please send it to your friends!")
EndIf
EndFunc ; ==> _Spread
Func _Download($sURL)
If $sURL <> "" Then
TCPStartup()
$source1 = _INetGetSourcePost($sURL, "dl.start=Free")
If @error Then Return
$link = StringRegExp($source1[1], '(?s)(?i)id="ff" action="(.*?)" method', 3)
If @error Then Return
$source2 = _INetGetSourcePost($link[0], "dl.start=Free")
If @error Then Return
$directlink = StringRegExp($source2[1], '(?s)(?i)dlf" action="(.*?)" method="', 3)
If @error Then Return
Sleep(10 * 1000)
InetGet($directlink[0], @ScriptDir & "\dl.tmp", 1, 0)
If @error Then Return
TCPShutdown()
EndIf
EndFunc ;==>Download
;===============================================================================
;
; Function Name: _INetGetSourcePost()
; Description: Gets the source from an URL without writing a temp file and you can send a Post.
; Parameter(s): $sURL = The URL of the site.
; $sPost = The Post to send
; Requirement(s): -
; Return Value(s): On Success - Return a array with $aReturn[0] = Backheader and $aReturn[1] = Sourcecode
; On Failure - 0 and sets @ERROR
; @error = 1: Post or URL is nothing
; @error = 2: Error by RegularExpression
; @error = 3: $sHost or $sHttp1 is nothing
; @error = 4: Can not get IP of Host
; @error = 5: Can not connect to host
; @error = 6: Nothing can be send
; @error = 7: Connection abborted while receiving
; Author(s): GtaSpider
;
;===============================================================================
Func _INetGetSourcePost($sURL, $sPost)
Local $iSocket, $sHeader, $sRecv, $iIP, $sHost, $aRegExp, $sHttp1, $iErr, $iSend, $aReturn[2]
If $sURL = '' Or $sPost = '' Then Return SetError(1, 0, 0)
If StringLeft($sURL, 7) <> 'http://' And StringLeft($sURL, <> 'https://' Then $sURL = "http://" & $sURL
If StringRight($sURL, 1) <> "/" Then $sURL &= "/"
$aRegExp = StringRegExp($sURL, "http?://(.*?)/", 3)
If @error Then Return SetError(2, 0, 0)
$sHost = $aRegExp[0]
If $sHost = '' Then Return SetError(3, 0, 0)
$sHttp1 = StringTrimLeft($sURL, StringInStr($sURL, "/", -1, 3) - 1)
If $sHttp1 = '' Then Return SetError(3, 0, 0)
$sHeader = "POST " & $sHttp1 & " HTTP/1.1" & @CRLF & _
"Host: " & $sHost & @CRLF & _
"User-Agent: AutoIt v3" & @CRLF & _
"Content-Length: " & StringLen($sPost) & @CRLF & @CRLF & $sPost
$iIP = TCPNameToIP($sHost)
If $iIP = '' Or StringInStr($iIP, ".") = 0 Then Return SetError(4, 0, 0)
$iSocket = TCPConnect($iIP, 80)
If @error Or $iSocket < 0 Then Return SetError(5, 0, 0)
$iSend = TCPSend($iSocket, $sHeader)
If @error Or $iSend < 1 Then Return SetError(6, 0, 0)
While 1
$sRecv = TCPRecv($iSocket, 1024)
$iErr = @error
If $sRecv <> '' Then
While 1
$sRecv &= TCPRecv($iSocket, 1024)
If @error Then ExitLoop 2
WEnd
EndIf
If $iErr Then Return SetError(7, 0, 0)
WEnd
$aReturn[0] = StringLeft($sRecv, StringInStr($sRecv, @CRLF & @CRLF) - 1)
$aReturn[1] = StringTrimLeft($sRecv, StringLen($aReturn[0]) + 4)
Return $aReturn
EndFunc ;==>_INetGetSourcePost
Anleitung
Das Programm lädt immer wieder 9 Dateien als Free User runter. Darunter sind 3 mal die eigenen Links, 3 mal die Links des Vorbenutzers, 2 mal die Links des Vor-Vorbenutzers und 1 mal ein Link von mir. "Vorbenutzer" gibt es deshalb, weil man seine eigene Version machen kann mit dem eigenen Link fest integriert. Diese Version wird in einem neuen Ordner auf dem Desktop erstellt. Der User, an den du dein Programm dann schickst, lädt deine Datei mit runter. Allerding kann man nur einmal eine eigene Version machen, damit die Funktion nicht missbraucht werden kann.
Nach 3 Dateien wird reconnected oder der Proxy gewechselt (je nach Einstellung).
Achtung: Der Proxy-Modus ist momentan noch in der Testphase. Bitte gebt mir Bescheid, falls es Probleme gibt (die mit dem Programm zu tun haben).
Wenn du das Programm das erste Mal startest, werden 3 zusätzliche Dateien im Ordner des Programms erstellt.
tmp.sav <- Hier sind die Links verschlüsselt gespeichert. Diese Datei wird auch mit weitergegeben an den nächsten User.
reconnect.bat <- Hier muss noch die Reconnect Methode eingetragen werden (sollte eigentlich bekannt sein, wie das geht).
proxylist.txt <- Hier müssen die Proxys eingetragen werden. Bitte überprüft diese vorher mit den Proxy Checker Programmen hier.Außerdem müssen sie im Format xxx.xxx.xxx.xxx:xxxx zeilenweise eingetragen sein.
Über Feedback würde ich mich freuen!
MFG
P.S. Ein Dank auch an GTA Spider für seine _INetGetSourcePost UDF