Advertisement
JackHaxor

Part 2 - Check 20 first messge FB

Aug 10th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.07 KB | None | 0 0
  1. #include <File.au3>
  2. #include<_HttpRequest.au3>
  3. #include <ButtonConstants.au3>
  4. #include <GUIConstantsEx.au3>
  5. #include <ListViewConstants.au3>
  6. #include <GuiListView.au3>
  7. #include <MsgBoxConstants.au3>
  8. #include <EditConstants.au3>
  9. #include <WindowsConstants.au3>
  10. #include <html.au3>
  11. #include <String.au3>
  12. #Region ### START Koda GUI section ### Form=
  13. $Form1 = GUICreate("Check 20 tin nhắn đầu tiên.", 618, 445, 583, 139)
  14. $ListView = GUICtrlCreateListView("ID|Tin Nhắn", 8, 8, 601, 361)
  15. _GUICtrlListView_SetColumnWidth(-1,0,120)
  16. _GUICtrlListView_SetColumnWidth(-1,1,470)
  17. $Button1 = GUICtrlCreateButton("Kiểm tra", 320, 392, 185, 33)
  18. GUICtrlSetFont(-1, 11, 400, 0, "Tahoma")
  19. GUICtrlSetCursor (-1, 0)
  20.  
  21.  
  22.  
  23.  
  24. $Input1 = GUICtrlCreateInput("", 8, 400, 89, 27, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
  25. GUICtrlSetFont(-1, 12, 400, 0, "Tahoma")
  26. $input2 = GUICtrlCreateInput("", 112, 400, 89, 27, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_PASSWORD))
  27. GUICtrlSetFont(-1, 12, 400, 0, "Tahoma")
  28. $Input3 = GUICtrlCreateInput("", 216, 400, 97, 27, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
  29. GUICtrlSetFont(-1, 12, 400, 0, "Tahoma")
  30. $Label1 = GUICtrlCreateLabel("Tài khoản", 8, 376, 68, 22)
  31. GUICtrlSetFont(-1, 11, 400, 0, "Tahoma")
  32. $Label2 = GUICtrlCreateLabel("Mật khẩu", 112, 376, 65, 22)
  33. GUICtrlSetFont(-1, 11, 400, 0, "Tahoma")
  34. $Label3 = GUICtrlCreateLabel("ID kiểm tra", 216, 376, 78, 22)
  35. GUICtrlSetFont(-1, 11, 400, 0, "Tahoma")
  36. $Button2 = GUICtrlCreateButton("GET ID", 512, 392, 97, 33)
  37. GUICtrlSetFont(-1, 11, 400, 0, "Tahoma")
  38. GUICtrlSetCursor (-1, 0)
  39. GUISetState(@SW_SHOW)
  40. #EndRegion ### END Koda GUI section ###
  41.  
  42. While 1
  43. $nMsg = GUIGetMsg()
  44. Switch $nMsg
  45. Case $GUI_EVENT_CLOSE
  46. Exit
  47. case $Button1
  48. _ad()
  49. case $Button2
  50. ;ShellExecute("https://findmyfbid.com/")
  51. EndSwitch
  52. WEnd
  53.  
  54.  
  55.  
  56. func _ad()
  57. GUICtrlSetState($Button1,128)
  58. $tb = "Thông báo"
  59. if GUICtrlRead($Input1) = '' Then
  60. MsgBox(16,$tb,'Chưa Nhập Tài Khoản')
  61. Return
  62. elseif GUICtrlRead($Input2) = '' Then
  63. MsgBox(16,$tb,'Chưa Nhập Mật Khẩu')
  64. Return
  65. elseif GUICtrlRead($Input3) = '' Then
  66. MsgBox(16,$tb,'Chưa Nhập ID')
  67. Return
  68. Endif
  69. MsgBox(64,"Thông báo","Nhấn oke để chờ xử lý OKE")
  70. _HttpRequest_NewSession()
  71. $Username = GUICtrlRead($Input1)
  72. $Password = GUICtrlRead($Input2)
  73. $idd = GUICtrlRead($Input3)
  74.  
  75.  
  76.  
  77. $idd = $idd
  78. $a = fblogin($Username,$Password)
  79. $cc = _HttpRequest(2, 'https://m.facebook.com/profile.php', "", $a, '', 'Connection: keep-alive')
  80. $fb = StringRegExp($cc,'name="fb_dtsg" value="(.*?)"',3)
  81. $idpr = StringRegExp($cc,'name="target" value="(.*?)"',3)
  82. $i = 1
  83. if @error Then
  84. MsgBox(0,0,'Tài khoản hoặc mật khẩu sai')
  85. Exit
  86. Endif
  87.  
  88.  
  89.  
  90.  
  91.  
  92. Global $CookiePost = _GetCookie($GetCookie)
  93.  
  94. $home = _HttpRequest(2, "https://m.facebook.com/"&$idd&"", "", $CookiePost)
  95.  
  96. $tennhan = StringRegExp($home,"<head><title>(.*?)</title>",3)
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119. $cc = _HttpRequest(2, 'https://m.facebook.com/profile.php', "", $CookiePost, '', 'Connection: keep-alive')
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130. $fb = StringRegExp($cc,'name="fb_dtsg" value="(.*?)"',3)
  131. $idpr = StringRegExp($cc,'name="target" value="(.*?)"',3)
  132. ;MsgBox(0,0,$fb[0])
  133. ;MsgBox(0,0,$idpr[0])
  134.  
  135. $i = 1
  136. $post = '__user='&$idpr[0]&'&__a=1&__dyn=7AgNeS-aF398jgDxyIGzGomzEdpbGAdy8VdLFwgoqwWhE98nwgUaqG2yaBxebkwy6UnGi7VXDG4XzErDAxaFQ3ucDBxe6ohyUCqu58nUszaxbxm1tyrhVo9ohxGbwYUmC-UjDQ6ErKu7EgwLxqawDDgswVwjpUhCK6pESfyaBy8OcxO12zVolyoK7UyUhUKcyU4eQEx1DzXG&__af=jw&__req=u&__be=-1&__pc=EXP3%3Aholdout_pkg&__rev=3211951&fb_dtsg='&$fb[0]&'&jazoest=265817089856881797477105114586581701188790886782485370&queries=%7B%22o0%22%3A%7B%22doc_id%22%3A%221927845863895817%22%2C%22query_params%22%3A%7B%22id%22%3A%22'&$idd&'%22%2C%22message_limit%22%3A'&$i&'%2C%22load_messages%22%3A1%2C%22load_read_receipts%22%3Atrue%2C%22before%22%3A'&_TimeStampUNIX_ms()&'%7D%7D%7D'
  137. $cc = _HttpRequest(2, 'https://www.facebook.com/api/graphqlbatch/', $post, $CookiePost, '', 'Connection: keep-alive')
  138.  
  139.  
  140. if StringInStr($cc,'"successful_results": 0') then
  141. MsgBox(0,0,'Lỗi không xác định, bạn hãy thử lại ID')
  142.  
  143. Endif
  144. if Not StringInStr($cc,'messages_count') Then
  145. MsgBox(0,0,'Lỗi không xác định, bạn hãy thử lại ID')
  146.  
  147. Endif
  148. $mess = _StringBetween($cc,'"messages_count":',',',3)
  149. if $mess[0] < 20 Then
  150. MsgBox(0,0,'Bạn chưa nhắn tin với '&$tennhan&' đủ 20 tin')
  151. Return
  152. Endif
  153. $post1 = '__user='&$idpr[0]&'&__a=1&__dyn=7AgNeS-aF398jgDxyIGzGomzEdpbGAdy8VdLFwgoqwWhE98nwgUaqG2yaBxebkwy6UnGi7VXDG4XzErDAxaFQ3ucDBxe6ohyUCqu58nUszaxbxm1tyrhVo9ohxGbwYUmC-UjDQ6ErKu7EgwLxqawDDgswVwjpUhCK6pESfyaBy8OcxO12zVolyoK7UyUhUKcyU4eQEx1DzXG&__af=jw&__req=u&__be=-1&__pc=EXP3%3Aholdout_pkg&__rev=3211951&fb_dtsg='&$fb[0]&'&jazoest=265817089856881797477105114586581701188790886782485370&queries=%7B%22o0%22%3A%7B%22doc_id%22%3A%221927845863895817%22%2C%22query_params%22%3A%7B%22id%22%3A%22'&$idd&'%22%2C%22message_limit%22%3A'&$mess[0]&'%2C%22load_messages%22%3A1%2C%22load_read_receipts%22%3Atrue%2C%22before%22%3A'&_TimeStampUNIX_ms()&'%7D%7D%7D'
  154. $cc1 = _HttpRequest(2, 'https://www.facebook.com/api/graphqlbatch/', $post1, $CookiePost, '', 'Connection: keep-alive')
  155. $c1 = _StringBetween($cc1,'{"id":"','ge",',3)
  156.  
  157. $path = ''&$idd&'.html'
  158. For $a = 1 to 20
  159.  
  160. $id = _StringBetween($c1[$a],'','",',3)
  161. $tin1 = StringRegExp($c1[$a],'"snippet":"(.*?)"',3)
  162. if IsArray($id) And IsArray($tin1) Then
  163. FileWriteLine($path,$id[0] &"|"&_HTMLDecode($tin1[0]) & "<br>")
  164. ENdif
  165. Next
  166. ;MsgBox(0,0,'OK')
  167. $readddd1 =FileRead(''&$idd&'.html')
  168. $readddd = StringReplace($readddd1,"<br>","")
  169. ;MsgBox(64,"Tin nhắn",_URLDecode($readddd))
  170.  
  171.  
  172. $filetk = _FileCountLines(''&$idd&'.html')
  173. for $i = 1 to $filetk
  174. $ac = FileReadLine(''&$idd&'.html',$i)
  175.  
  176. $ac1 = StringReplace($ac,"<br>","")
  177.  
  178.  
  179. $a1 = StringReplace($ac1,$idd,$tennhan[0])
  180. $a2 = StringReplace($a1,"100008148131533","Nguyen Hong Phong")
  181. GUICtrlCreateListViewItem(_URLDecode($a2), $ListView)
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190. Next
  191. GUICtrlSetState($Button1,64)
  192. EndFunc
  193.  
  194.  
  195.  
  196. Func _TimeStampUNIX_ms($iYear = @YEAR, $iMonth = @MON, $iDay = @MDAY, $iHour = @HOUR, $iMin = @MIN, $iSec = @SEC)
  197. Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort')
  198. DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime))
  199. $iMSec = StringFormat('d', DllStructGetData($stSystemTime, 8))
  200. Local $nYear = $iYear - ($iMonth < 3 ? 1 : 0)
  201. Return ((Int(Int($nYear / 100) / 4) - Int($nYear / 100) + $iDay + Int(365.25 * ($nYear + 4716)) + Int(30.6 * (($iMonth < 3 ? $iMonth + 12 : $iMonth) + 1)) - 2442110) * 86400 + ($iHour * 3600 + $iMin * 60 + $iSec)) * ($iMSec ? 1000 : 1) + $iMSec
  202. EndFunc
  203.  
  204.  
  205. Func fblogin($tk,$mk)
  206. $Username = GUICtrlRead($Input1)
  207. $Password = GUICtrlRead($Input2)
  208.  
  209. $post = '&email='&$Username&'&pass='&$Password&'&login=%C4%90%C4%83ng+nh%E1%BA%ADp'
  210. $kq1 = _HttpRequest(1, 'https://m.facebook.com/login.php?refsrc=https%3A%2F%2Fm.facebook.com%2F&lwv=101&login_try_number=1&ref=dbl', $post, '', '', 'Connection: keep-alive')
  211. $cookie = _GetCookie($kq1)
  212. Return $cookie
  213.  
  214. Endfunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement