Webqq protocol analysis (4) -- getting friend information (1)

Source: Internet
Author: User

1. Get the list of friends group names

Command: 3C

Send:

1030196367; 3C; 0; 4b2b432f; 1;

The fifth parameter has only two values: 1 and 2. When is 2 unknown, the required data can be obtained with 1 (it may indicate the number of groups to obtain, it can be obtained up to two times, and I cannot test it if I have not created so many groups. ~ _~).

 

Server return:

1030196367; 3C; 0; 02; 1; try; 2; check it out;

The fourth is the number of custom groups. Then I will understand that the custom group sequence number starts from 1. 0 is the default group of "my friends" and 1000 is a "stranger ", 1001 is a "Black List". Apparently, the maximum number of custom groups is 999, which is over 999.

Have you ever thought about it? The data is separated by ";". Can the group name be? The answer is yes. Do not believe it. The data after an excessive number is added is as follows:

1030196367; 3C; 0; 02; 1; % 3B test % 3B; 2; % 3B2% 3B;

See it? The semicolon is changed to % 3B. Additional instructions on special handling are required. Note that the group sequence number is not necessarily continuous and may not have one or more sequence numbers.

In this way, the list of friends group names is obtained. Let's get friends.

 

 

2. Obtain the QQ number of a friend

Command: 58

Send:

1030196367; 58; 0; 4b2b432f; 0;

The fifth indicates which friend's QQ number is obtained. The first request is 0.

 

The server returns the following data (for personal privacy, replace QQ number with XXXX)

1030196367; 58; 0; 0; xxxx; 0; 8; 10; 3; xxxx; 0; 4; 20; 3; xxxx; 0; 0; 10; 3; xxxx; 1; 0; 20; 3;

The fourth is the next time you get the QQ number (which may not be enough at a time). The data in this example clearly means that all the data has been obtained this time.

XXXX is a friend's QQ number. If the second value is smaller than 4, it indicates that each of the five items returned by the server is a friend data. Otherwise, each of the four items is a friend data, 0 indicates the QQ number of a friend, and 1 indicates the group ID (but not the group number ). The third is the ID of the affiliated group (obviously incorrect. The calculation method is (N & 60)> 2, and the result is the ID of the affiliated group). The fourth is the friend status, 10 indicates online, 20 indicates offline, 30 indicates offline, and others are offline for processing; 5 indicates terminationstat indicates the status of the friend who logged out last time.

 

Author: yjh4866

Source Address: http://blog.csdn.net/yjh4866

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.