Func _GetCookies();получение кук
$winpcap=_PcapSetup() ; initialise the Library
$pcap_devices=_PcapGetDeviceList() ; Get the interfaces list for which a capture is possible
; Start a capture on interface #0, in promiscuous mode, for http packets only
$pcap=_PcapStartCapture($pcap_devices[1][0],"dst host worldoftanks.ru and tcp port 80",1)
; Open pcap file for writting
$pcapfile=_PcapSaveToFile($pcap,"mycapture.pcap")
If ($pcapfile=0) Then MsgBox(16,"Pcap error !",_PcapGetLastError())
; Write all http traffic to the file for 10s...
$time0=TimerInit()
While (TimerDiff($time0)<5000)
$packet=_PcapGetPacket($pcap)
If IsArray($packet) Then _PcapWriteLastPacket($pcapfile)
Wend
$text = FileRead("mycapture.pcap")
$cookie = StringRegExp($text, "Cookie: (.*)hlauth=1", 3)
$token = StringRegExp($text, "X-CSRFToken: (.*)\r", 3)
If IsArray($cookie) And IsArray($token) Then
$sCookie=$cookie[0]&"hlauth=1"
$sToken=$token[0]
Return 1
Else
Return 0
EndIf
_PcapStopCaptureFile($pcapfile) ; Close pcap file
_PcapStopCapture($pcap) ; Stop capture
_PcapFree() ; release ressources
EndFunc ;==>__GetCookies()