Lianzhong Upgrade Protocol Analysis 5

xiaoxiao2021-03-06  39

Lianzhong Upgrade Agreement Analysis Continued article (4) Cloud Network (Jimzj@21cn.com)

Second, the licensing order originally analyzed my analysis card, because I started from the card, so the code of the card was only 13, and the color of the card, so when analyzing this command, I can't get the result. However, after a day of bitterness, I finally understood it, huh, huh, I can think of this trick for yourself. J

0x0050 17 20 00 00 04 00 00 00-01 00 00 00 16 20 00 00. ........... .. 0x0060 29 00 00 00 19 00 00 00-FF FF FF FF F4 01 00 00 ) ....... ? .. 0x0070 00 00 00 00 00 00 5d 44 32 0f 12 .... 8j ') ..;] d2 .. 0x0080 5A 58 6A 2E 45 0B 64 24-56 16 3A 3e 05 zxj.ed $ v.:>.

From the above data, the command word is 0x00002016, then one of the command words 0x00002017 is starting a game sign, this is used to sign some states; then look at 0x19 (that is, the decimal 25) huh, I want to figure out our four people. 8 end cards when you play two payments, a total of (54 * 2 - 8) / 4 = 25 just, this location is sent to us the number of cards (because there is a card, the three payment) We look at the data from 38 4A 27 29 29 3B 5D 44 32 0F 12 5A 58 6A 2E 45 0B 64 24-56 16 3A 3e 05 is just 25, this is the server sent to every player, playing this When the game, we saw a card in the client, but in fact, we got all at the beginning, if you explained this agreement, we will know all your own cards at the beginning, not You can know what color can be called, can you be against someone's cards, and how much is the card of every color, isn't it very good ... The data structure we define is as follows: typedef struct _tagshjifadepaiinfo {int ncount; // brand number CHAR CUSER; CHAR CFLAG1; Char Cflag2; Char CFLAG3;

INT nflag1; int NFLAG2;} shjifadepaiinfo, * lpshjifadepaiinfo; unbounded information in the structure, because after moving pointers, you can read the information of the card (each bit byte means a card), as shown below:

Void __fastcall tfrmmain :: RevfadePaiInfo (char * ppackcontent) Pinfo = (shjifadepaiinfo *) PPACKCONTENT;

For (int I = 0; i ncount; i ) {byte btcard = * ((byte *) (Pinfo 1) i * sizeof (byte))); ...... ............}} III. The name of the card will always be a card for each round, so this command will have multiple such commands before the card, but the last command It is the ultimate leader. 0x0000 11 20 00 00 18 00 00 00-01 00 E0 00 01 00 00 00. ........? .... 0x0010 01 00 00 00 01 00 00 00-DE 05 00 00 02 00 00 00 ...........................

The content called the card should include, the user called the card, the color of the card (black peach, red peach, grass flower, square), the number of names (one or a pair), from the above color data to the data It is just the information of these three locations. This may receive more data, and it will be obtained after comparing. I also analyze it after receiving the information called a card: So we define the name of the card The data structure is as follows: typedef struct _tagshjijiaopaiinfo {char cuser; // is called a user number char cflag0; char cflag1; char cflag2; char ccolor; // color (king = 0x35, Xiao Wang = 0x34) char cflag3; char cflag4; CHAR CFLAG5;

CHAR CCOUNT; / / CHAR CFLAG6; char cflag7; char cflag8; char cflag14; char cflag9; char cflag10; char cflag11;

Int nflag12; int nflag13;} shjijiaopaiinfo, * lpshjijiaopaiinfo;

Other data signs in the data structure are temporarily unclear, but just know enough information we want. Here is the information obtained by getting the card:

Void __fastcall tfrmmain :: REVJIAOPAIINFO (Char * PPACKCONTENT) {ShjijiaopaiInfo * PINFO = (shjijiaopaiinfo *) PPackContent;

if (m_eZhuColor = (GAMECARDCOLOR) pInfo-> cColor!) {m_eZhuColor = (GAMECARDCOLOR) pInfo-> cColor; ShowInitImagePic (m_cDaJi, m_eZhuColor); // displayed on screen} SetJiaoPaiPic (pInfo-> cUser, m_eZhuColor, pInfo-> CCOUNT); / / Show that user named}

Get the information of the card, you can display it on your plug-in interface, and you can also distinguish whether the user is handard, and the card is still paying the J four. If you are a damist, the will be a deduction card, otherwise, This instruction sent by the server is not included in this card.

0x0000 03 20 00 00 E4 00 00 00-03 00 00 00 1E 00 00 00. ..? .......... 0x0010 03 00 00 00 05 00 00 00-00 00 00 00 01 00 00 00 .............. 0x0020 00 00 00 00 01 00 00 00 00 00 00 ................

In this directive, there is no data of the base card, I don't know if the Word is doing this command word. So you must calculate the number of the base card, but only two, one pay card and the three payment are 6 in the end, the second payment is 8 in the end, so you can get the information of the base card, In the information of the deduction, it also contains the user's fastener, which is the first time, this information is used to indicate the first user's first card, but if you know who the Man is also the same. Know the first number of the number. The defined data structure is as follows:

Typedef struct _tagshjicaodiflag {char cuser; // First online user (Daiist) Char cflag0; char cflag1; char cflag2;} shjicaodiflag, * lpshjicaodiflag;

Typedef struct _tagshjicaodiinfo {int nposition; // location information

CHAR CCOLOR; / Brand color char cflag0; char cflag1; char cflag2;

Char ccard; // bottom card char cflag3; char cflag4; char cflag5;

Int nflag6; int nflag7; int nflag8; int nflag9;} shjicaodiinfo, * lpshjicaodiinfo;

Because the information in the previous section is only one, the information of each card after the latter is looped, so the number of stems can be obtained from the number of deserts.

Void __fastcall tfrmmain :: RevcaodiInfo (Char * PPACKCONTENT, INT NLEN) {Shjicaodiflag * Pinfo = (shjicaodiflag *) PPackContent;

m_bcancaculate = true; // Start calculation mark

M_zhangjia = ((Pinfo-> Cuser CUSER> POS_BOT)? 0: Pinfo-> Cuser;

IF (nlen == 4) return; // If not include the base card information returns

// Benke information for (int i = 0; i ccolor, pcard-> ccard); showPICONIMAGE (GameCardColor) PCard-> ccolor, pcard-> ccard, paneldipai);} }

The gabycal information can be displayed on the interface, don't have to look at the client's viewing card information button every time, if you are watching others playing cards, he sets it without letting itself, you can also see it directly. His card information, huh, hhe

转载请注明原文地址:https://www.9cbs.com/read-66909.html

New Post(0)