#include <IE.au3>
#include <Array.au3>
#include <WinHTTP.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Email Creator", 445, 173, 192, 132)
$Pic1 = GUICtrlCreatePic(@ScriptDir & "\Captcha.jpg", -8, 0, 244, 68)
$Name = GUICtrlCreateInput("Name", 240, 8, 121, 24)
$Passwort = GUICtrlCreateInput("Passwort", 240, 40, 121, 24)
$Captcha = GUICtrlCreateInput("Captcha", 56, 72, 121, 24)
$Label1 = GUICtrlCreateLabel("@gmx.de", 360, 8, 62, 20)
$Label2 = GUICtrlCreateLabel("Nach eingabe des Captchas auf weiter", 8, 104, 234, 20)
$Button1 = GUICtrlCreateButton("Button1", 272, 80, 1, 9)
$Button2 = GUICtrlCreateButton("Start", 240, 72, 155, 41)
$Button3 = GUICtrlCreateButton("Weiter", 0, 120, 251, 49)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button2
$User = GUICtrlRead($Name)
$Pw = GUICtrlRead($Passwort)
$url = "https://www.gmx.net/mail/freemail/registrierung/?1"
$oIE = _IECreate($url, 0, 1)
$sQuellText = _IEBodyReadHTML($oIE)
$aResults = StringRegExp($sQuellText, 'src="(.+?)"', 3)
For $src in $aResults
If StringInStr($src, "image-captcha") Then $sCaptchaName = $src
Next
FileDelete("gmx.html")
Filewrite("gmx.html", $sQuellText)
If $sCaptchaName = "" then
MsgBox(16, "ERROR", "Captcha-Name konnte nicht extrahiert werden")
Exit
EndIf
ConsoleWrite("Captchaname is " & "/mail/freemail/registrierung/" & $sCaptchaName & @crlf)
$sCookies = _IE_GetCookies($oIE)
$aResults = StringRegExp($sCookies, "JSESSIONID=.+$", 3)
If NOT IsArray($aResults) Then
MsgBox(16, "ERROR", "Konnte Cookie nicht auslesen!" & @crlf & $sCookies)
Exit
EndIf
$sJSESSION = "Cookie: " & $aResults[0]
ConsoleWrite("Cookie ist: " & $sJSESSION & @crlf)
$HttpOpen = _WinHttpOpen("Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0")
$HttpConnect = _WinHttpConnect($HttpOpen, "www.gmx.net")
$hRequest = _WinHttpSimpleSendSSLRequest($HttpConnect, "GET", "/mail/freemail/registrierung/" & $sCaptchaName, "https://www.gmx.net/mail/freemail/registrierung/", $WINHTTP_NO_REQUEST_DATA, $sJSESSION)
If _WinHttpQueryDataAvailable($hRequest) Then
$header = _WinHttpQueryHeaders($hRequest)
EndIf
Local $data = Binary("")
While 1
$chunk = _WinHttpReadData($hRequest, 2) ; Binär!
If Not @extended Then ExitLoop ; @extended = Länge der Rückgabe
$data &= $chunk
WEnd
$fOpen = FileOpen(@ScriptDir & "\Captcha.jpg", 26)
FileWrite($fOpen,$data)
Func _IE_GetCookies($oIE)
Local $oDocument
$oDocument = _IEDocGetObj($oIE)
Return $oDocument.cookie
EndFunc
$oForm = _IEGetObjById($oIE, "id23")
$obj = _IEGetObjById ($oIE, "id2")
_IEAction ($obj, "click")
$ofName = _IEFormElementGetObjByName($oForm, "personaldataPanel:first-name:textfield")
_IEFormElementSetValue($ofName, "Heinz")
$osName = _IEFormElementGetObjByName($oForm, "personaldataPanel:last-name:textfield")
_IEFormElementSetValue($osName, "Heil")
$oSelect = _IEFormElementGetObjByName($oForm, "personaldataPanel:countryDependentZipCodeCity-form:country:dropdown")
_IEFormElementOptionSelect($oSelect, "Deutschland", 1, "byText")
$oOrtZahl = _IEFormElementGetObjByName($oForm, "personaldataPanel:countryDependentZipCodeCity-form:zipCodeAndCity:zipCode-textfield")
_IEFormElementSetValue($oOrtZahl, "36100")
$oOrt = _IEFormElementGetObjByName($oForm, "personaldataPanel:countryDependentZipCodeCity-form:zipCodeAndCity:city-textfield")
_IEFormElementSetValue($oOrt, "Fulda")
$oStrasse = _IEFormElementGetObjByName($oForm, "personaldataPanel:streetAndStreetNumber:streetNam e-textfield")
_IEFormElementSetValue($oStrasse, "Mozartstraße")
$oStrasseZahl = _IEFormElementGetObjByName($oForm, "personaldataPanel:streetAndStreetNumber:streetNum ber-textfield")
_IEFormElementSetValue($oStrasseZahl, "40")
$oTag = _IEFormElementGetObjByName($oForm, "personaldataPanel:birthday:birthdata:birthday-textfield")
_IEFormElementSetValue($oTag, "06")
$oMonat = _IEFormElementGetObjByName($oForm, "personaldataPanel:birthday:birthdata:birthmon th-textfield")
_IEFormElementSetValue($oMonat, "09")
$oJahr = _IEFormElementGetObjByName($oForm, "personaldataPanel:birthday:birthdata:birthyea r-textfield")
_IEFormElementSetValue($oJahr, "1980")
$oEmail = _IEFormElementGetObjByName($oForm, "wishnamePanel:wishname:subForm:alias")
_IEFormElementSetValue($oEmail, $User)
$oPw = _IEFormElementGetObjByName($oForm, "passwordPanel:password-form:password:textfield")
_IEFormElementSetValue($oPw, $Pw)
$oID = _IEFormElementGetObjByName($oForm, "passwordPanel:password-form:password-confirm:textfield")
_IEFormElementSetValue($oID, $Pw)
$oKontakt = _IEFormElementGetObjByName($oForm, "passwordPanel:email:textfield")
_IEFormElementSetValue($oKontakt, "
[Only registered and activated users can see links. Click Here To Register...]")
$oGeheim = _IEFormElementGetObjByName($oForm, "passwordPanel:challenge-parent:challenge:dropdown")
_IEFormElementOptionSelect($oGeheim, "Geburtsname der Mutter", 1, "byText")
$oGeheimA = _IEFormElementGetObjByName($oForm, "passwordPanel:answer:textfield")
_IEFormElementSetValue($oGeheimA, "gaby")
Case $Button3
$text = GUICtrlRead($Input)
Sleep(1000)
$oCaptcha = _IEFormElementGetObjByName($oForm, "captchaPanel:captcha-response:textfield")
_IEFormElementSetValue($oCaptcha, $text)
Sleep(1000)
$anmeldebutton = _IEGetObjByName($oIE,"submitButton")
_IEAction($anmeldebutton,"click")
Sleep(10000)
Exit
EndSwitch
WEnd