已掉线,重新登录

首页 > 绿虎论坛 > 历史版块 > 编程 > PHP > 讨论/求助

标题: php模拟手机qq问题,

作者: @Ta

时间: 2014-09-06

点击: 2640

@胜永@无道,1.    登录命令: VER=1.4&CON=1&CMD=Login&SEQ={seq}&UIN={qq}&PS={ps}&M5=1&LG=0&LC={lc}&GD={gd}&CKE=\r\n 
       服务器响应:VER=1.1&CMD=Login&SEQ={seq}&UIN=2933278370&RES=0&RS=0&HI=60&LI=300&SG=***&SSG=207390864\r\n 
                   SEQ序号应该和你发送时一样, 不然就是错的. 
                   RES=0代表服务器成功响应
                   RS=0代表登录成功,其它均为失败; 若失败:则有相应的RA字段标识错误信息, 比如Password Error!
见过你们研究过,前来求助,登录成功服务器返回,怎样判断啊,用@无道
<?php
function post_str($post_str){
$ip='121.14.102.159';

$port=14000;

$errno=0;

$errstr='';

$timeout=10;

$fp=fsockopen($ip,$port,$errno,$errstr,$timeout);

$content_length=strlen($post_str); 

$post_header="POST / HTTP/1.1";

$post_header.="Content-Type: text/plain";

$post_header.="User-Agent: UNTRUSTED/1.1";

$post_header.="Host:".$ip.":".$port;

$post_header.="Content-Length:".$content_length."\r\n"; 

$post_header.="Connection: close\r\n\r\n" ;


$post_header.=$post_str."\r\n";

fwrite($fp,$post_header);

$str=fread($fp,1024);


return $str;

echo  $str[0];
fclose($fp);

}
function tcp_gq($uin,$pw){

post_str("VER=1.4&CON=1&CMD=Login&SEQ=".rand(100,999)."&UIN=".$uin."&PS=".md5($pw)."&M5=1&LG=0&LC=2EC70D1101DB674F&GD=JTAIAHW97YPSYRPV&CKE="); 



}


tcp_gq($uin,$pw);发的这个,可以登陆,可登陆成功没有没有提示,或者说有验证码怎么办啊,

[隐藏样式|查看源码]


『回复列表(5|隐藏机器人聊天)』

1. @我就喜欢,这个只是新手时弄的。。

你可以判断 服务器响应 后的rs的值,为0成功,反之失败
(/@Ta/2014-09-06 20:04//)

2. @无道,服务器响应的值在哪获取啊,我不懂这个
(/@Ta/2014-09-06 20:05//)

3. @我就喜欢,你发送后,会显示 服务器响应:VER=1.1&CMD=Login&SEQ={seq}&UIN=2933278370&RES=0&RS=0&HI=60&LI=300&SG=***&SSG=207390864

其中有RS
(/@Ta/2014-09-06 20:15//)

4. @无道,没有显示任何东西,
(/@Ta/2014-09-06 22:24//)

5. @我就喜欢,我这个代码是没有显示东西,你可以自己写一个获取内容的啊
(/@Ta/2014-09-07 01:45//)

回复需要登录

7月20日 22:14 星期天

本站由hu60wap6驱动

备案号: 京ICP备18041936号-1