perfectwargear

SLTUM2015

May 2nd, 2015
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 7.14 KB | None | 0 0
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Icon=ico\ico\Blue\Stock.ico
  3. #AutoIt3Wrapper_Outfile=sltum2015.exe
  4. #AutoIt3Wrapper_Compression=4
  5. #AutoIt3Wrapper_UseUpx=y
  6. #AutoIt3Wrapper_Res_Comment=No need to enter the password !!!!
  7. #AutoIt3Wrapper_Res_Description=SLT Usage Meter 2015 by 3xtr3m3r
  8. #AutoIt3Wrapper_Res_Fileversion=1.1.0.12
  9. #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
  10. #AutoIt3Wrapper_Res_LegalCopyright=No Copyright...
  11. #AutoIt3Wrapper_Res_Field=Compiled with|autoit
  12. #AutoIt3Wrapper_Res_Field=Usage|Just enter the username (login ID) and then hit Submit .
  13. #AutoIt3Wrapper_Res_Field=Product name|SLT Usage Meter 2015 by 3xtr3m3r
  14. #AutoIt3Wrapper_Res_Field=Product version|1.1.0.9
  15. #AutoIt3Wrapper_Run_Tidy=y
  16. #AutoIt3Wrapper_Run_Au3Stripper=y
  17. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  18. Opt("TrayIconHide", 1) ;0=show, 1=hide tray icon
  19.  
  20. #include <IE.au3>
  21. #include <GuiComboBox.au3>
  22. #include <GUIConstantsEx.au3>
  23. #include <Constants.au3>
  24. #include <ButtonConstants.au3>
  25. #include <ComboConstants.au3>
  26. #include <EditConstants.au3>
  27. #include <StaticConstants.au3>
  28. #include <WindowsConstants.au3>
  29. #include <Date.au3>
  30. #include <String.au3>
  31.  
  32. #Region ### START Koda GUI section ### Form=
  33. $Form1 = GUICreate("SLT Usage Meter 2015 by 3xtr3m3r", 370, 200, 190, 120)
  34. $Combo1 = GUICtrlCreateCombo("SLTBB", 8, 162, 177, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL, $WS_DISABLED))
  35. $Input1 = GUICtrlCreateInput("Enter ADSL User ID...", 8, 35, 177, 20)
  36. $Button1 = GUICtrlCreateButton("Usage", 236, 60, 80, 30)
  37. $Label1 = GUICtrlCreateLabel("Login Name (User ID without @sltbb EX:AB1234567 )", 16, 13, 1200, 18)
  38. GUICtrlSetFont(-1, 9, 700, 0, "Consolas")
  39. GUICtrlSetColor(-1, "0x404000")
  40. GUICtrlSetBkColor(-1, "-2")
  41. $Label2 = GUICtrlCreateLabel("Service Type", 16, 140, 80, 18)
  42. $Label3 = GUICtrlCreateLabel("No Password Required!!!", 220, 100, 130, 40)
  43. GUICtrlSetFont(-1, 8, 800, 0, "Consolas")
  44. GUICtrlSetColor(-1, "0xf00000")
  45. GUICtrlSetBkColor(-1, "-2")
  46. $Combo2 = GUICtrlCreateCombo("2013", 8, 100, 60, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
  47. $Combo3 = GUICtrlCreateCombo("JAN", 80, 100, 80, 20, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
  48. $Label4 = GUICtrlCreateLabel("Select Year && Month", 16, 80, 160, 18)
  49. GUICtrlSetFont(-1, 9, 700, 0, "Consolas")
  50. GUICtrlSetColor(-1, "0x404000")
  51. GUICtrlSetBkColor(-1, "-2")
  52. $Label5 = GUICtrlCreateLabel("~Supported Packages~" & @CRLF & "  Entree / Abhimaana / Home / Xcite / Office / Xcel / All Plus Packages ", 230, 135, 120, 80);, $WS_DISABLED)
  53. GUICtrlSetFont(-1, 8, 700, 0, "Consolas")
  54. GUICtrlSetColor(-1, "0x004000")
  55. GUICtrlSetBkColor(-1, "-2")
  56. GUISetState(@SW_SHOW)
  57. #EndRegion ### END Koda GUI section ###
  58.  
  59. _GUICtrlComboBox_BeginUpdate($Combo1)
  60. _GUICtrlComboBox_AddString($Combo1, "ROAM")
  61. _GUICtrlComboBox_AddString($Combo1, "WIFI")
  62. _GUICtrlComboBox_AddString($Combo1, "ISDN")
  63. _GUICtrlComboBox_AddString($Combo1, "PSTN")
  64. _GUICtrlComboBox_AddString($Combo1, "CDMA")
  65. _GUICtrlComboBox_EndUpdate($Combo1)
  66.  
  67. $aList = _GUICtrlComboBox_GetListArray($Combo1)
  68.  
  69. _GUICtrlComboBox_BeginUpdate($Combo2)
  70. _GUICtrlComboBox_AddString($Combo2, "2014")
  71. _GUICtrlComboBox_AddString($Combo2, "2015")
  72. _GUICtrlComboBox_AddString($Combo2, "2016")
  73. _GUICtrlComboBox_EndUpdate($Combo2)
  74. $aList2 = _GUICtrlComboBox_GetListArray($Combo2)
  75.  
  76.  
  77. _GUICtrlComboBox_BeginUpdate($Combo3)
  78. _GUICtrlComboBox_AddString($Combo3, "FEB")
  79. _GUICtrlComboBox_AddString($Combo3, "MAR")
  80. _GUICtrlComboBox_AddString($Combo3, "APR")
  81. _GUICtrlComboBox_AddString($Combo3, "MAY")
  82. _GUICtrlComboBox_AddString($Combo3, "JUN")
  83. _GUICtrlComboBox_AddString($Combo3, "JUL")
  84. _GUICtrlComboBox_AddString($Combo3, "AUG")
  85. _GUICtrlComboBox_AddString($Combo3, "SEP")
  86. _GUICtrlComboBox_AddString($Combo3, "OCT")
  87. _GUICtrlComboBox_AddString($Combo3, "NOV")
  88. _GUICtrlComboBox_AddString($Combo3, "DEC")
  89. _GUICtrlComboBox_EndUpdate($Combo3)
  90.  
  91. $aList3 = _GUICtrlComboBox_GetListArray($Combo3)
  92.  
  93.  
  94.  
  95. Local $sHTML = ""
  96. Local $id
  97. Global $phpssid, $pCock1, $cookiex
  98. Local $tCur = _Date_Time_GetLocalTime()
  99. $dat = StringSplit(_Date_Time_SystemTimeToDateTimeStr($tCur), "/")
  100.  
  101. Switch $dat[3]
  102.     Case 2013
  103.         _GUICtrlComboBox_SetCurSel($Combo2, 0)
  104.     Case 2014
  105.         _GUICtrlComboBox_SetCurSel($Combo2, 1)
  106.     Case 2015
  107.         _GUICtrlComboBox_SetCurSel($Combo2, 2)
  108.     Case 2016
  109.         _GUICtrlComboBox_SetCurSel($Combo2, 3)
  110. EndSwitch
  111.  
  112. _GUICtrlComboBox_SetCurSel($Combo3, $dat[1] - 1)
  113.  
  114. Main() ;Main func call
  115.  
  116. Func Wrapper_RL($oMethod, $oURL, $oReferrer = "", $oData = "", $cookies = "", $oContent_Type = "application/x-www-form-urlencoded")
  117.     Global $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
  118.     Local $oAutoItError = ObjEvent("AutoIt.Error", "oError1")
  119.     $oHTTP.Open($oMethod, $oURL, False)
  120.     $oHTTP.option(4) = 0x00000100
  121.     $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")
  122.  
  123.  
  124.     If $oMethod == "GET" Then
  125.         $oData = ""
  126.         $oHTTP.SetRequestHeader("Cookie", $cookies)
  127.     EndIf
  128.  
  129.     If $oMethod == "POST" Then
  130.         $oReferrer = $oReferrer
  131.         $oData = $oData
  132.         $oHTTP.SetRequestHeader("Cookie", $cookies)
  133.         $oHTTP.SetRequestHeader("Referrer", $oReferrer)
  134.         $oHTTP.SetRequestHeader("Content-Type", $oContent_Type)
  135.     EndIf
  136.  
  137.     $oHTTP.Send($oData)
  138.     $HeaderResponses = $oHTTP.GetAllResponseHeaders()
  139.     $oResponse = $oHTTP.ResponseText()
  140.     $array = StringRegExp($HeaderResponses, 'Set-Cookie: (.+)\r\n', 3)
  141.     $cookies = ''
  142.     For $i = 0 To UBound($array) - 1
  143.         $cookies = $cookies & $array[$i] & @CRLF
  144.     Next
  145.     ConsoleWrite($cookies & @CRLF)
  146.     $cookiex = $cookies
  147.     Return $oResponse
  148. EndFunc   ;==>Wrapper_RL
  149.  
  150.  
  151.  
  152. Func oError1()
  153.     SetError(1)
  154. EndFunc   ;==>oError1
  155.  
  156.  
  157. Func isp($id, $service, $month, $year)
  158.     $res = Wrapper_RL("GET", "https://usagemeter.slt.lk/BBusage/")
  159.     $spl = StringSplit($res, ">")
  160.     For $j = 1 To UBound($spl) - 1
  161.         $tempx = StringRegExp($spl[$j], '(?i)name="tok" value=([\W\w]{0,32}) /', 1)
  162.         If @error Then
  163.         Else
  164.             Local $tok = $tempx[0]
  165.         EndIf
  166.     Next
  167.     $data = "userName=" & $id & "&service=BB&month=" & $month & "%2F" & $year & "&tok=" & $tok
  168.     $sHTML = Wrapper_RL("POST", "https://usagemeter.slt.lk/BBusage/bbUsg", "https://usagemeter.slt.lk/BBusage/bbUsg", $data, $cookiex)
  169.     Local $stripped = strip($sHTML)
  170.     Local $oIE = _IECreate()
  171.     $oDoc = _IEDocGetObj($oIE)
  172.     _IEDocWriteHTML($oIE, $stripped)
  173. EndFunc   ;==>isp
  174.  
  175.  
  176. Func strip($temp)
  177.     Local $splt = StringSplit($temp, @CRLF)
  178.     Local $comb
  179.     For $i = 1 To (UBound($splt) - 1)
  180.         $groupid = StringRegExp($splt[$i], '(?i)Login.jsp([\W\w]{0,500})"', 1)
  181.         If @error Then
  182.         Else
  183.             $splt[$i] = ""
  184.         EndIf
  185.         $groupid = StringRegExp($splt[$i], '(?i)submitForm([\W\w]{0,500})"', 1)
  186.         If @error Then
  187.         Else
  188.             $splt[$i] = ""
  189.         EndIf
  190.         $comb = $comb & $splt[$i] & @CRLF
  191.     Next
  192.     Return ($comb)
  193.  
  194. EndFunc   ;==>strip
  195.  
  196.  
  197.  
  198. Func Main()
  199.     While 1
  200.         $array_msg = GUIGetMsg(1)
  201.         Switch $array_msg[0]
  202.  
  203.             Case $Button1
  204.  
  205.                 isp(GUICtrlRead($Input1, 1), $aList[_GUICtrlComboBox_GetCurSel($Combo1) + 1], $aList3[_GUICtrlComboBox_GetCurSel($Combo3) + 1], $aList2[_GUICtrlComboBox_GetCurSel($Combo2) + 1])
  206.             Case $GUI_EVENT_CLOSE
  207.                 Exit
  208.         EndSwitch
  209.     WEnd
  210. EndFunc   ;==>Main
Advertisement
Add Comment
Please, Sign In to add comment