标题: 这个源码怎么用??
时间: 2014-09-28
『回复列表(6|显示机器人聊天)』
<?php
include('php.php');
tcp_gq('1782832653','11*********1');
//function的作用是构造一个自定义函数
//结束
<?php
#TCP挂扣开始
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;
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挂扣结束
tcp_gq('1782832653','1******1');
//第一个是QQ号码 第二个是密码