SomeBody22 Posted September 11, 2011 Share Posted September 11, 2011 (edited) I have problems with sending a request containing raw strings and HEX. Any solution please? I need send this AMF request Request content NulETXNulNulNulSOHNulDLEService.proccessNulSTX/1NulNulNulY NulNulNulETXSTXNul#[{"method":"getFriendList","fT":2}]STXNul 13775dfdd60b7bc7b9ff621077bb24e1STXNulBS24705703 expandcollapse popup#include<string.au3> #include <file.au3> Global $zauth , $response $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") Func login($u,$p) $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $url="https://loginme.zing.vn/login/act" $oHTTP.Open('POST',$url,True) initHeader($oHTTP) $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") $data="u=" & $u & "&pp=" & $p $oHTTP.Send($data) $response = $oHTTP.responseBody $k=$oHTTP.getallresponseheaders $zauth=getZauth($k) ;~ ConsoleWrite($k) EndFunc Func getZauth($str) $start = StringInStr($str, 'Set-Cookie: ZAUTH=',1,2) + StringLen("Set-Cookie: ZAUTH=") $end = StringInStr($str, ';', 0, 1, $start) $size = StringMid($str, $start, $end - $start) return $size EndFunc Func initHeader($oHTTP) $oHTTP.SetRequestHeader("Acept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") $oHTTP.SetRequestHeader("Acept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") $oHTTP.SetRequestHeader("Accept-Language", "en-us,en;q=0.5") $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10") $oHTTP.SetRequestHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7") $oHTTP.SetRequestHeader("Keep-Alive", "115") EndFunc Func getFriendList() $id="24705703" $oHTTP.Open('GET','http://me.zing.vn/apps/ntvv2') initHeader($oHTTP) $oHTTP.Send() $response = $oHTTP.Responsetext ;~ ConsoleWrite($response) dim $NULL=0x00 , $SOH=0x01,$ETX=0x03,$STX=0x02,$DLE=0x10,$CAN=0x18,$BS=0x10 $data=Chr($NULL)&Chr($ETX)&Chr($NULL)&Chr($NULL)&Chr($NULL)&Chr($SOH)&Chr($NULL)&Chr($DLE)&'Service.proccess'&Chr($NULL)&Chr($STX)&'/0'&Chr($NULL)&Chr($NULL)&Chr($NULL)&'Q'&@CRLF&Chr($NULL)&Chr($NULL)&Chr($NULL)&Chr($ETX)&Chr($STX)&'#[{"fT":2,"method":"getFriendList"}]'&Chr($STX)&Chr($NULL)&Chr($CAN)&$zauth&Chr($STX)&Chr($NULL)&Chr($BS)&$id ;~ $data=_StringToHex(0x$data) ;~ $data="0003000000010010536572766963652e70726f636365737300022f31000000590a000000030200235b7b226d6574686f64223a22676574467269656e644c697374222c226654223a327d5d020020"&_StringToHex($zauth)&"0200083234373035373033" $test=_HexToString($data) ConsoleWrite($test) $oHTTP.Open('POST',"http://friends-ntvv2.apps.zing.vn/3in1/amf/gateway") initHeader($oHTTP) $oHTTP.SetRequestHeader("Content-Type", "application/x-amf") $oHTTP.Send($data) $response = $oHTTP.responseBody ConsoleWrite($response) EndFunc login("123123","123123");~ just test . getFriendList() Edited September 11, 2011 by SomeBody22 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now