Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Icon=ico\ico\Blue\Stock.ico
- #AutoIt3Wrapper_Outfile=sltum2015.exe
- #AutoIt3Wrapper_Compression=4
- #AutoIt3Wrapper_UseUpx=y
- #AutoIt3Wrapper_Res_Comment=No need to enter the password !!!!
- #AutoIt3Wrapper_Res_Description=SLT Usage Meter 2015 by 3xtr3m3r
- #AutoIt3Wrapper_Res_Fileversion=1.1.0.12
- #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
- #AutoIt3Wrapper_Res_LegalCopyright=No Copyright...
- #AutoIt3Wrapper_Res_Field=Compiled with|autoit
- #AutoIt3Wrapper_Res_Field=Usage|Just enter the username (login ID) and then hit Submit .
- #AutoIt3Wrapper_Res_Field=Product name|SLT Usage Meter 2015 by 3xtr3m3r
- #AutoIt3Wrapper_Res_Field=Product version|1.1.0.9
- #AutoIt3Wrapper_Run_Tidy=y
- #AutoIt3Wrapper_Run_Au3Stripper=y
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- Opt("TrayIconHide", 1) ;0=show, 1=hide tray icon
- #include <IE.au3>
- #include <GuiComboBox.au3>
- #include <GUIConstantsEx.au3>
- #include <Constants.au3>
- #include <ButtonConstants.au3>
- #include <ComboConstants.au3>
- #include <EditConstants.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <Date.au3>
- #include <String.au3>
- #Region ### START Koda GUI section ### Form=
- $Form1 = GUICreate("SLT Usage Meter 2015 by 3xtr3m3r", 370, 200, 190, 120)
- $Combo1 = GUICtrlCreateCombo("SLTBB", 8, 162, 177, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL, $WS_DISABLED))
- $Input1 = GUICtrlCreateInput("Enter ADSL User ID...", 8, 35, 177, 20)
- $Button1 = GUICtrlCreateButton("Usage", 236, 60, 80, 30)
- $Label1 = GUICtrlCreateLabel("Login Name (User ID without @sltbb EX:AB1234567 )", 16, 13, 1200, 18)
- GUICtrlSetFont(-1, 9, 700, 0, "Consolas")
- GUICtrlSetColor(-1, "0x404000")
- GUICtrlSetBkColor(-1, "-2")
- $Label2 = GUICtrlCreateLabel("Service Type", 16, 140, 80, 18)
- $Label3 = GUICtrlCreateLabel("No Password Required!!!", 220, 100, 130, 40)
- GUICtrlSetFont(-1, 8, 800, 0, "Consolas")
- GUICtrlSetColor(-1, "0xf00000")
- GUICtrlSetBkColor(-1, "-2")
- $Combo2 = GUICtrlCreateCombo("2013", 8, 100, 60, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $Combo3 = GUICtrlCreateCombo("JAN", 80, 100, 80, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
- $Label4 = GUICtrlCreateLabel("Select Year && Month", 16, 80, 160, 18)
- GUICtrlSetFont(-1, 9, 700, 0, "Consolas")
- GUICtrlSetColor(-1, "0x404000")
- GUICtrlSetBkColor(-1, "-2")
- $Label5 = GUICtrlCreateLabel("~Supported Packages~" & @CRLF & " Entree / Abhimaana / Home / Xcite / Office / Xcel / All Plus Packages ", 230, 135, 120, 80);, $WS_DISABLED)
- GUICtrlSetFont(-1, 8, 700, 0, "Consolas")
- GUICtrlSetColor(-1, "0x004000")
- GUICtrlSetBkColor(-1, "-2")
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- _GUICtrlComboBox_BeginUpdate($Combo1)
- _GUICtrlComboBox_AddString($Combo1, "ROAM")
- _GUICtrlComboBox_AddString($Combo1, "WIFI")
- _GUICtrlComboBox_AddString($Combo1, "ISDN")
- _GUICtrlComboBox_AddString($Combo1, "PSTN")
- _GUICtrlComboBox_AddString($Combo1, "CDMA")
- _GUICtrlComboBox_EndUpdate($Combo1)
- $aList = _GUICtrlComboBox_GetListArray($Combo1)
- _GUICtrlComboBox_BeginUpdate($Combo2)
- _GUICtrlComboBox_AddString($Combo2, "2014")
- _GUICtrlComboBox_AddString($Combo2, "2015")
- _GUICtrlComboBox_AddString($Combo2, "2016")
- _GUICtrlComboBox_EndUpdate($Combo2)
- $aList2 = _GUICtrlComboBox_GetListArray($Combo2)
- _GUICtrlComboBox_BeginUpdate($Combo3)
- _GUICtrlComboBox_AddString($Combo3, "FEB")
- _GUICtrlComboBox_AddString($Combo3, "MAR")
- _GUICtrlComboBox_AddString($Combo3, "APR")
- _GUICtrlComboBox_AddString($Combo3, "MAY")
- _GUICtrlComboBox_AddString($Combo3, "JUN")
- _GUICtrlComboBox_AddString($Combo3, "JUL")
- _GUICtrlComboBox_AddString($Combo3, "AUG")
- _GUICtrlComboBox_AddString($Combo3, "SEP")
- _GUICtrlComboBox_AddString($Combo3, "OCT")
- _GUICtrlComboBox_AddString($Combo3, "NOV")
- _GUICtrlComboBox_AddString($Combo3, "DEC")
- _GUICtrlComboBox_EndUpdate($Combo3)
- $aList3 = _GUICtrlComboBox_GetListArray($Combo3)
- Local $sHTML = ""
- Local $id
- Global $phpssid, $pCock1, $cookiex
- Local $tCur = _Date_Time_GetLocalTime()
- $dat = StringSplit(_Date_Time_SystemTimeToDateTimeStr($tCur), "/")
- Switch $dat[3]
- Case 2013
- _GUICtrlComboBox_SetCurSel($Combo2, 0)
- Case 2014
- _GUICtrlComboBox_SetCurSel($Combo2, 1)
- Case 2015
- _GUICtrlComboBox_SetCurSel($Combo2, 2)
- Case 2016
- _GUICtrlComboBox_SetCurSel($Combo2, 3)
- EndSwitch
- _GUICtrlComboBox_SetCurSel($Combo3, $dat[1] - 1)
- Main() ;Main func call
- Func Wrapper_RL($oMethod, $oURL, $oReferrer = "", $oData = "", $cookies = "", $oContent_Type = "application/x-www-form-urlencoded")
- Global $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
- Local $oAutoItError = ObjEvent("AutoIt.Error", "oError1")
- $oHTTP.Open($oMethod, $oURL, False)
- $oHTTP.option(4) = 0x00000100
- $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 BTRS28059 Firefox/3.6.12 (.NET CLR 3.5.30729) SuperSearchSearchToolbar/1.2")
- If $oMethod == "GET" Then
- $oData = ""
- $oHTTP.SetRequestHeader("Cookie", $cookies)
- EndIf
- If $oMethod == "POST" Then
- $oReferrer = $oReferrer
- $oData = $oData
- $oHTTP.SetRequestHeader("Cookie", $cookies)
- $oHTTP.SetRequestHeader("Referrer", $oReferrer)
- $oHTTP.SetRequestHeader("Content-Type", $oContent_Type)
- EndIf
- $oHTTP.Send($oData)
- $HeaderResponses = $oHTTP.GetAllResponseHeaders()
- $oResponse = $oHTTP.ResponseText()
- $array = StringRegExp($HeaderResponses, 'Set-Cookie: (.+)\r\n', 3)
- $cookies = ''
- For $i = 0 To UBound($array) - 1
- $cookies = $cookies & $array[$i] & @CRLF
- Next
- ConsoleWrite($cookies & @CRLF)
- $cookiex = $cookies
- Return $oResponse
- EndFunc ;==>Wrapper_RL
- Func oError1()
- SetError(1)
- EndFunc ;==>oError1
- Func isp($id, $service, $month, $year)
- $res = Wrapper_RL("GET", "https://usagemeter.slt.lk/BBusage/")
- $spl = StringSplit($res, ">")
- For $j = 1 To UBound($spl) - 1
- $tempx = StringRegExp($spl[$j], '(?i)name="tok" value=([\W\w]{0,32}) /', 1)
- If @error Then
- Else
- Local $tok = $tempx[0]
- EndIf
- Next
- $data = "userName=" & $id & "&service=BB&month=" & $month & "%2F" & $year & "&tok=" & $tok
- $sHTML = Wrapper_RL("POST", "https://usagemeter.slt.lk/BBusage/bbUsg", "https://usagemeter.slt.lk/BBusage/bbUsg", $data, $cookiex)
- Local $stripped = strip($sHTML)
- Local $oIE = _IECreate()
- $oDoc = _IEDocGetObj($oIE)
- _IEDocWriteHTML($oIE, $stripped)
- EndFunc ;==>isp
- Func strip($temp)
- Local $splt = StringSplit($temp, @CRLF)
- Local $comb
- For $i = 1 To (UBound($splt) - 1)
- $groupid = StringRegExp($splt[$i], '(?i)Login.jsp([\W\w]{0,500})"', 1)
- If @error Then
- Else
- $splt[$i] = ""
- EndIf
- $groupid = StringRegExp($splt[$i], '(?i)submitForm([\W\w]{0,500})"', 1)
- If @error Then
- Else
- $splt[$i] = ""
- EndIf
- $comb = $comb & $splt[$i] & @CRLF
- Next
- Return ($comb)
- EndFunc ;==>strip
- Func Main()
- While 1
- $array_msg = GUIGetMsg(1)
- Switch $array_msg[0]
- Case $Button1
- isp(GUICtrlRead($Input1, 1), $aList[_GUICtrlComboBox_GetCurSel($Combo1) + 1], $aList3[_GUICtrlComboBox_GetCurSel($Combo3) + 1], $aList2[_GUICtrlComboBox_GetCurSel($Combo2) + 1])
- Case $GUI_EVENT_CLOSE
- Exit
- EndSwitch
- WEnd
- EndFunc ;==>Main
Advertisement
Add Comment
Please, Sign In to add comment