1. Study description
Tencent has an http qq interface in 8000 of tqq.tencent.com. Through this interface, you can perform some basic operations, such: login, logout, and change login status (online, busy, offline, and invisible) add and delete friends, view friends information, send verification information (accept added as friends, apply to add peer as friends, reject added as friends), send and receive user messages, system information.
At present, I am studying the http qq protocol of Version 1.1. The research is based on the results of Weicheng. I dare not say anything beyond it, but it is more detailed and accurate.
2. Interface Description:
Interface location: tqq.tencent.com: 8000
Communication Protocol: HTTP
Data transmission method: POST
HTTP request format:
Posthttp/1.1
Host: tqq.tencent.com: 8000
Content-Type: text/plain; charset = UTF-8
Content-length: length
Connection: close
Data
The length is the data length. The data format is as follows:
VER = 1.1 & CMD = command & SEQ = Mark & UIN = QQ number &....
The preceding four parameters are mandatory for each request. In this example, VER indicates the Protocol version. Currently, it is 1.1. It is said that 1.2 has come out. In this case, the server returns NULL. CMD indicates the operation instruction, there are Login, List, Query_Stat, GetInfo, AddToList, Ack_AddToList, DelFromList, Change_Stat, GetMsgEx, CLTMSG, and Logout. SEQ is the flag of the current request to prevent repeated sending. The current time can be used, you can also use a random number. UIN is the QQ number of the current operation. However, different CMD parameters are required. I will publish my research results below.
3. Research Methods:
I am not satisfied with the current information on the Internet. I write a program, send multiple requests with the same CMD parameters, and make judgments based on the server's return. If you are interested, you can skip this step.
I will publish the code I tested (PHP) below ):
$ Uin = "QQ number ";
$ Pwd = md5 ("QQ password ");
// Login Test
$ Poststring [] = "VER = 1.1 & CMD = Login & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& PS = ". $ pwd. "& M5 = 1 & LC = 9326B87B234E7235 ";
// Note: the login test cannot be performed at the same time. You must wait until the server determines that QQ is disconnected before testing. Otherwise, the result is untrusted.
/*******
$ Poststring [] = "VER = 1.1 & CMD = Login & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& PS = ". $ pwd. "& M5 = 0 & LC = 9326B87B234E7235 ";
$ Poststring [] = "VER = 1.1 & CMD = Login & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& PS = ". $ pwd. "& M5 = 1 & LC = 9326B87B234E7235 ";
$ Poststring [] = "VER = 1.1 & CMD = Login & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& PS = ". $ pwd. "& M5 = 2 & LC = 9326B87B234E7235 ";
$ Poststring [] = "VER = 1.1 & CMD = Login & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& PS = ". $ pwd. "& M5 = 3 & LC = 9326B87B234E7235 ";
$ Poststring [] = "VER = 1.1 & CMD = Login & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& PS = ". $ pwd. "& M6 = 1 & LC = 9326B87B234E7235 ";
$ Poststring [] = "VER = 1.1 & CMD = Login & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& PS = ". $ pwd. "& M6 = 1 & LC = 1223423545756679 ";
*******/
// Obtain the friend list
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ =". rand (,). "& UIN =". $ uin;
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ =". rand (,). "& UIN =". $ uin. "& TN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ =". rand (160,). "& UIN =". $ uin. "& TN = ";
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ =". rand (,). "& UIN =". $ uin. "& UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& UN = ". rand (1, 10 );
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 0 & UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 160 & UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 160 & UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = ". rand (1,200 ). "& UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = ". rand (1,200 ). "& UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = ". rand (1,200 ). "& UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 0 & UN = ". rand (1, 10 );
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 0 & UN = ". rand (1, 10 );
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 0 & UN = ". rand (1, 10 );
$ Poststring [] = "VER = 1.1 & CMD = List & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 0 & UN = 106814 ";
// Obtain the online list
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ =". rand (,). "& UIN =". $ uin;
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ =". rand (,). "& UIN =". $ uin. "& TN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ =". rand (160,). "& UIN =". $ uin. "& TN = ";
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ =". rand (,). "& UIN =". $ uin. "& UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& UN = ". rand (1, 10 );
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 0 & UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 160 & UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 160 & UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = ". rand (1,200 ). "& UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = ". rand (1,200 ). "& UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = ". rand (1,200 ). "& UN = 0 ";
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 0 & UN = ". rand (1, 10 );
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 0 & UN = ". rand (1, 10 );
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 0 & UN = ". rand (1, 10 );
$ Poststring [] = "VER = 1.1 & CMD = Query_Stat & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& TN = 0 & UN = 106814 ";
// View friend information
$ Poststring [] = "VER = 1.1 & CMD = GetInfo & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& LV = 0 & UN = 106814 ";
$ Poststring [] = "VER = 1.1 & CMD = GetInfo & SEQ = ". rand (1000,9000 ). "& UIN = ". $ uin. "& amp; LV = 1 & amp; UN = 106814 ";