亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術文章
文章詳情頁

PHP讀取MSN上的用戶信息類

瀏覽:2日期:2024-02-17 08:03:10

一個可以獲取msn上用戶信息的代碼

<?php$msn = new myMSN('[email protected]', '123');// MSNv9class myMSN {private $server = 'messenger.hotmail.com';private $port = 1863;private $nexus = 'https://nexus.passport.com/rdr/pprdr.asp';private $sshLogin = 'login.live.com/login2.srf'; //loginnet.passport.com/login2.srfprivate $getCode = null;private $_ip = null;private $_port = null;private $connect = null;private $trID = 1;private $maxMessage = 4096;private $userName = null;private $passWord = null;private $debug = true;function myMSN($userName='', $passWord='') {if (!empty($userName) && !empty($passWord)) {$this->userName = $userName;//$this->passWord = urlencode($passWord);$this->passWord = $passWord;$this->startTalk();}}function put($data) {if ($this->isConnect()) {fputs($this->connect, $data);$this->trID++;if ($this->debug)print('<div style='color:green;font-size:13px;'>>>>{$data}</div>');}}function get() {if ($data = @fgets($this->connect, $this->maxMessage)) {if ($this->debug)print('<div style='color:red;font-size:13px;'><<<{$data}</div>');return $data;} else {return false;}}function isConnect() {if (!is_null($this->connect))return true;elsereturn false;}function close() {@fclose($this->connect);}function startTalk() {if ($this->connect = fsockopen($this->server, $this->port, $errno, $errstr, 2))$this->verTalk();}function verTalk() // MSN 協議協商 {$this->put('VER {$this->trID} MSNP9 CVR0 rn');$data = $this->get();//echo $data;if (false !== strripos($data, 'VER'))$this->envTalk();}function envTalk() // 環境協商 {$this->put('CVR {$this->trID} 0x0409 winnt 5.0 i386 MSNMSGR 7.0.0816 MSMSGS {$this->userName} rn');$data = $this->get();//echo $data;if (false !== strripos($data, 'CVR'))$this->reqTalk();}function reqTalk() // 請求確認 {$this->put('USR {$this->trID} TWN I {$this->userName} rn');$data = $this->get(); // XFR 3 NS 207.46.107.41:1863 0 65.54.239.210:1863 XFR 3 NS 207.46.107.25:1863 U D//echo $data;if (false !== strripos($data, 'XFR')) {list(, , , $serv) = explode(' ', $data); // 分析服務器list($ip, $port) = explode(':', $serv); // 分析IP和端口$this->_ip = $ip;$this->_port = $port;$this->reLink($ip, $port);} else {//echo $data; // USR 3 TWN S ct=1205292058,rver=5.0.3270.0,wp=FS_40SEC_0_COMPACT,lc=1033,id=507,ru=http:%2F%2Fmessenger.msn.com,tw=0,kpp=1,kv=4,ver=2.1.6000.1,rn=1lgjBfIL,tpf=b0735e3a873dfb5e75054465196398e0list(, , , , $this->getCode) = explode(' ', trim($data));//echo $data;if (empty($this->sshLogin))$this->reLoginTalk(); // 重新獲取登陸服務器地址else$this->getLoginCode($this->sshLogin);}}function reLink($server, $port) // 重置連接 {$this->connect = null;$this->server = $server;$this->port = $port;$this->trID = 1;$this->startTalk();}function reLoginTalk() // 重新獲取服務器地址 {$ch = curl_init($this->nexus);curl_setopt($ch, CURLOPT_HEADER, 1);curl_setopt($ch, CURLOPT_NOBODY, 1);curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);$header = curl_exec($ch);//print_r($header);curl_close($ch);preg_match ('/DALogin=(.*?),/', $header, $out); // 捕捉服務器登陸匹配//print_r($out);if (isset($out[1])) {$this->getLoginCode($out[1]);}else {//return false;exit('無法捕捉到登陸服務器的URL');}}function getLoginCode($slogin) // 獲取登陸代碼 {//echo($this->getCode);if (!is_null($this->getCode)) {$ch = curl_init('https://' . $slogin);$loginInfo = array('Authorization: Passport1.4 rgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in=' . $this->userName . ',pwd=' . $this->passWord . ',' . $this->getCode,'Host: login.passport.com');curl_setopt($ch, CURLOPT_HTTPHEADER, $loginInfo);//print_r($loginInfo);//$this->getCode = null;curl_setopt($ch, CURLOPT_HEADER, 1);curl_setopt($ch, CURLOPT_NOBODY, 1);curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);$header = curl_exec($ch);//print_r($header);preg_match ('/from-PP='(.*?)'/', $header, $out);//print_r($out);if (isset($out[1])) {$this->loginAction($out[1]);} else {//return false;exit('無法捕捉到登陸代碼的信息');}} else {return false;}}function loginAction($loginCode) // 登陸工作 {$this->put('USR {$this->trID} TWN S {$loginCode} rn'); // USR |trID| SSO S |t=code|$data = $this->get();//echo $data;//print_r($data);//$this->put('SYN {$this->trID} 0 rn');//$this->put('CHG {$this->trID} NLN rn');//print_r($this->get());}}?>

標簽: PHP
主站蜘蛛池模板: 成人免费一级在线播放 | 成人中文字幕在线高清 | 欧美精品免费看 | 亚洲成人免费视频 | 国产一级内谢a级高清毛片 国产一级毛片大陆 | 精品亚洲成a人在线播放 | 亚洲精品三区 | 91视频啊啊啊 | 国产精品嫩模在线播放 | 国产三级日产三级 | 久久精品美女视频 | 大学生一级毛片免费看真人 | 亚洲一级毛片免费观看 | 久久99国产亚洲精品 | 91国内在线国内在线播放 | 精品一区二区高清在线观看 | 欧美一级成人免费大片 | 国产自产2023最新麻豆 | 一级做a爱过程免费视频时看 | 狠狠色狠狠色综合婷婷tag | 日韩欧美国产一区二区三区 | 国产xxwwxxww视频| 91视频青青| 黄色香蕉视频网站 | 国产日韩精品一区二区 | 大香香蕉| 国产成a人片在线观看视频 国产成a人片在线观看视频99 | 99je全部都是精品视频在线 | 国产精品久久久久久久久免费hd | 亚洲欧美日韩久久一区 | 鸥美肥妇特级毛片视频 | 男女啪啪抽搐一进一出小 | 一级片网站在线观看 | 亚洲已满18点击进入在线观看 | 国产三级毛片 | 一区二区免费播放 | 妞干网在线播放 | 国产xxx视频| 久久久久99精品成人片三人毛片 | 一级黄色毛片免费看 | 亚洲精品二区 |