& Lt ;? Phperror_reporting (7); & nbsp; classmsn & nbsp; {& nbsp; private $ startcomm0; & nbsp; & nbsp; private $ username; & nbsp; priv
Error_reporting (7 );
Class msn
{
Private $ startcomm = 0;
Private $ username =;
Private $ password =;
Private $ commend =;
Private $ domain =;
Private $ socket =;
Private $ challenge =;
Private $ status = array ();
Private $ data = array ();
Function set_account ($ username, $ password)
{
$ This-> username = $ username;
$ This-> password = $ password;
}
Function getData (){
$ Buffer = "";
While (! Feof ($ this-> socket )){
$ Buffer. = fread ($ this-> socket, 1024 );
If (preg_match ("//", $ buffer )){
Break;
}
}
$ This-> checkData ($ buffer );
}
Function getData2 (){
$ Buffer = "";
While (! Feof ($ this-> socket )){
$ Buffer. = fread ($ this-> socket, 1024 );
If (preg_match ("//", $ buffer )){
Break;
}
}
$ This-> checkData ($ buffer );
}
Function checkData ($ buffer ){
If (preg_match ("/lc = (. + ?) /Ui ", $ buffer, $ matches )){
$ This-> challenge = "lc =". $ matches [1];
}
If (preg_match ("/(XFR 3 NS) ([0-9.:] + ?) (. *) ([0-9.:] + ?) /Is ", $ buffer, $ matches )){
$ Split = explode (":", $ matches [2]);
$ This-> startcomm = 1;
$ This-> msn_connect ($ split [0], $ split [1]);
}
If (preg_match ("/tpf = ([a-zA-Z0-9] + ?) /Ui ", $ buffer, $ matches )){
$ This-> nexus_connect ($ matches [1]);
}
$ Split = explode ("", $ buffer );
For ($ I = 0; $ I
$ Detail = explode ("", $ split [$ I]);
If ($ detail [0] = "LST "){
If (isset ($ detail [2]) $ this-> data [] = array ($ detail [1], urldecode ($ detail [2]);
}
}
$ This-> status = array (200, $ this-> data );
// Echo $ buffer;
}
Function msn_connect ($ server, $ port ){
If ($ this-> socket ){
Fclose ($ this-> socket );
}
$ This-> socket = @ fsockopen ($ server, $ port, $ errno, $ errstr, 20 );
If (! $ This-> socket ){
$ This-> status = array (500, MSN verification server cannot connect );
Return false;
} Else {
$ This-> startcomm ++;
$ This-> send_command ("VER". $ this-> startcomm. "MSNP8 CVR0", 1 );
$ This-> send_command ("CVR". $ this-> startcomm. "0x0409 win 4.10 i386 MSNMSGR 6.2 MSMSGS". $ this-> username, 1 );
$ This-> send_command ("USR". $ this-> startcomm. "twn I". $ this-> username, 1 );
}
}
Function send_command ($ command ){
$ This-> commend = $ command;
$ This-> startcomm ++;
Fwrite ($ this-> socket, $ command ."");
$ This-> getData ();
}
Function nexus_connect ($ tpf ){
$ Arr [] = "GET/rdr/pprdr. asp HTTP/1.0 ";
$ Curl = curl_init ();
Curl_setopt ($ curl, CURLOPT_URL, "https://nexus.passport.com: 443/rdr/pprdr. asp ");
Curl_setopt ($ curl, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ curl, CURLOPT_VERBOSE, 0 );
Curl_setopt ($ curl, CURLOPT_HEADER, 1 );
Curl_setopt ($ curl, CURLOPT_HTTPHEADER, $ arr );
Curl_setopt ($ curl, CURLOPT_SSL_VERIFYPEER, FALSE );
$ Data = curl_exec ($ curl );
Curl_close ($ c