当前位置: 首页 > news >正文

安阳吧百度贴吧/谷歌关键词优化怎么做

安阳吧百度贴吧,谷歌关键词优化怎么做,哪些网站做的好看,个性网站制作Windows版qq数据包格式&#xff1a; android版qq数据包格式&#xff1a; 密钥&#xff1a;16个0 算法&#xff1a;tea_crypt算法 pc版qq 0825数据包解密源码&#xff1a; #include "qq.h" #include "qqcrypt.h" #include <WinSock2.h> #include…

Windows版qq数据包格式:
在这里插入图片描述

android版qq数据包格式:

在这里插入图片描述

密钥:16个0

算法:tea_crypt算法

pc版qq 0825数据包解密源码:

#include "qq.h"
#include "qqcrypt.h"
#include <WinSock2.h>
#include "../public.h"
#include "../ProtocolParser.h"
#include "../ResultFile.h"
#include "../fileOper.h"
#include <windows.h>int QQ::isQQ(const char * data, int len, DATALISTHEADER hdr) {if (hdr.sock.protocol == 0x11 ){if ( hdr.sock.dstport == 8000){int firstsize = hdr.sizelist->size;if (hdr.datalist->data[0] == 0x02 && hdr.datalist->data[firstsize-1] == 0x03 ){return TRUE;}}}return FALSE;
}int QQ::processQQ(LPDATABLOCKLIST list, LPPACKSIZELIST sizelist, DATALISTHEADER hdr) {int ret = 0;char lpbuf [0x1000];int offset = 0;while (list && sizelist){int len = DataBlockList::getNextPacket(list, offset, sizelist, (char*)lpbuf);if (len > 0){QQHEADER * qqhdr = (QQHEADER*)(lpbuf + 1);if (qqhdr->cmd == 0x2508){int pad = sizeof(QQHEADER) ;if (memcmp(lpbuf + 1 + pad, "\x03\x00\x00\x00", 4) == 0)//010101{pad += 15;}else if (memcmp(lpbuf + 1 + pad,"\x00\x00\x00",3) == 0){pad += 15;}char * offset = lpbuf + 1 + pad;int size = len - 1 - pad - 1 ;unsigned char *key = (unsigned char*)offset;int decodelen = size + 1024;unsigned char *decodebuf = new unsigned char[size + 1024];int ret = qq_decrypt((unsigned char*)offset + 16, size - 16, key, decodebuf, &decodelen);if (ret > 0){Public::WriteDataFile("qq.dat", (const char*)decodebuf, decodelen);}delete decodebuf;char szqq[16];sprintf(szqq, "%u", ntohl(qqhdr->qq));ResultFile::writeRecord(hdr, "qq", "on", szqq);}
// 			else if (qqhdr->cmd == 0x3608)
// 			{
// 				char szqq[16];
// 				sprintf(szqq, "%u", ntohl(qqhdr->qq));
// 				ResultFile::writeRecord(hdr, "qq", "on", szqq);
// 			}}else {// 			string fn = ProtocolParser::formatfn(hdr, "qq_error");
// 			ret = ProtocolParser::writeBlocks(list, fn);break;}}return 0;
}/*
POST /qbrowser HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0) QQBrowser/9.0
Host: update.browser.qq.com
Content-Length: 345
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: uin_cookie=2210853762; euin_cookie=53DFE9A7024225C8649F40745723E578AC136F6862ECF843{
"COS": "10.0.17763",
"CSoftID": 22,
"CVer": "1.6.6699.999",
"Cmd": 1,
"ExeVer": "1.0.1118.400",
"GUID": "9308ec3d7b7602d10f39e90f88399236",
"InstallTimeStamp": 1557478990,
"QID": 16785570,
"QQVer": "9.1.3.25332",
"SupplyID": 0,
"TriggerMode": 1,
"UIN": 0,
"bPatch": 0,
"osDigit": 64
}
HTTP/1.1 200
Date: Sun, 11 Aug 2019 03:14:20 GMT
Content-Length: 450
Connection: keep-alive{ "CSoftID": 22, "CommandLine": "", "Desp": "\u0031\u002e\u0030\u002e\u0031\u0031\u0036\u0030\u002e\u0034\u0030", "DownloadUrl": "http://dl_dir.qq.com/invc/tt/minibrowser11.zip", "ErrCode": 0, "File": "minibrowser11.zip", "Flags": 1, "Hash": "b1309eb4312bd83d154a4b2b1b66547b", "InstallType": 0, "NewVer": "1.0.1160.400", "PatchFile": "QBDeltaUpdate.exe", "PatchHash": "b1309eb4312bd83d154a4b2b1b66547b", "Sign": "", "Size": 36003449, "VerType": "" }
*/

Android版qq解密代码:


#include "mobileQQ.h"
#include "winsock2.h"
#include "qqcrypt.h"
#include "../public.h"
#include "../ProtocolParser.h"
#include "../ResultFile.h"
#include "../fileOper.h"
#include "../SearchData.h"int parseHeartbeat(const char * data, int len) {const char * pos = SearchData::getstring("Heartbeat.Alive", lstrlenA("Heartbeat.Alive"), data, len);if (pos){pos = pos - lstrlenA("Heartbeat.Alive") - 2;int len = ntohl(*(short*)pos);pos += len;len = ntohs(*(short*)pos);pos += len;len = ntohs(*(short*)pos);string imei = string(pos + 2, len - 2);pos += len;len = ntohs(*(short*)pos);pos += len;len = ntohs(*(short*)(pos -2));if (*pos == '|'){string imsi = string(pos, len - 2);imsi = imsi.substr(1);int dot = imsi.find("|");if (dot > 0){imsi = imsi.substr(0, dot);}}		}return 0;
}int MobileQQ::parsePacket(const char * data, int &len,int dport,int sport,DATALISTHEADER hdr) {const char * qqdata = data;LPMOBILEQQ_PACK_HDR qqhdr = (LPMOBILEQQ_PACK_HDR)qqdata;int offset = ntohl(qqhdr->offset);if (offset >= 0x80 || offset < 0){offset = 4;}qqdata = qqdata + sizeof(MOBILEQQ_PACK_HDR) + offset;string qqno = "";char qqnolen = *qqdata - sizeof(int);if (qqnolen >= 5 && qqnolen <= 10){qqdata++;qqno = string(qqdata, qqnolen);}else {printf("error qq no len\r\n");return -1;}qqdata += qqnolen;if (qqhdr->cryption == 2){ResultFile::writeRecord(hdr, "mqq", "on", qqno);unsigned char key[16] = { 0 };int cryptlen = len - (qqdata - data);unsigned char *decodebuf = new unsigned char[cryptlen + 4096];int decodelen = cryptlen + 4096;int ret = qq_decrypt((unsigned char*)qqdata, cryptlen, key, decodebuf, &decodelen);if (/*ret && */decodelen > 0){*(decodebuf + decodelen) = 0;printf("succeed decrypted size:%u,encrypted size:%u\r\n", decodelen, cryptlen);Public::WriteDataFile("mobileqq.dat", (const char*)decodebuf, decodelen);//ResultFile::writeRecord(hdr, "mqq", "on", qqno);}else {printf("error:decrypted size:%u,encrypted size:%u\r\n", decodelen, cryptlen);//printf("decrypt mobile qq fix crypt packet error\r\n");}delete decodebuf;}else if(qqhdr->cryption == 0){printf("no cryption mobile qq packet\r\n");}else if (qqhdr->cryption == 1){}else {printf("error qq packet cryption\r\n");return -1;}return 0;
}int MobileQQ::isMobileQQPack(DATALISTHEADER hdr) {int dport = hdr.sock.dstport;char * data = hdr.datalist->data;int len = hdr.sizelist->size;if (hdr.sock.protocol == 6 &&(dport == 8080 || dport == 443 || dport == 80 || dport == 14000)){int packlen = ntohl(*(int*)data);if (len == packlen ){char crypt = *(data + 8);if (crypt == 1 || crypt == 2 || crypt == 0){int ver = *(int*)(data + sizeof(int));//3 = 2010 11 = 2016if (ver == 0x0a000000 || ver == 0x0b000000 || ver == 0x09000000){return TRUE;}}}}return FALSE;
}

tea_crypt算法解密源码:

/**
* The QQ2003C protocol plugin
*
* for gaim
*
* Copyright (C) 2004 Puzzlebird
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
*
* OICQ encryption algorithm
* Convert from ASM code provided by PerlOICQ
*
* Puzzlebird, Nov-Dec 2002
*//*****************************************************************************/
/*Notes: (OICQ uses 0x10 iterations, and modified something...)IN : 64  bits of data in v[0] - v[1].
OUT: 64  bits of data in w[0] - w[1].
KEY: 128 bits of key  in k[0] - k[3].delta is chosen to be the real part of
the golden ratio: Sqrt(5/4) - 1/2 ~ 0.618034 multiplied by 2^32.0x61C88647 is what we can track on the ASM codes.!!
*///#ifndef _WIN32
//#include <arpa/inet.h>
//#else
//#include "win32dep.h"
//#endif
#ifndef _QQ_QQ_CRYPT_C_
#define _QQ_QQ_CRYPT_C_#include <string.h>
#include "qqcrypt.h"
#include <winsock2.h>
#include <stdlib.h>void qq_encipher(unsigned long *const        v,const unsigned long *const  k,unsigned long *const        w);void qq_decipher(unsigned long *const        v,const unsigned long *const  k,unsigned long *const        w);void qq_encrypt(unsigned char*  instr,int             instrlen,unsigned char*  key,unsigned char*  outstr,int*            outstrlen_prt);int qq_decrypt(unsigned char*  instr,int             instrlen,unsigned char*  key,unsigned char*  outstr,int*            outstrlen_ptr);/*****************************************************************************/
void qq_encipher(unsigned long *const        v,const unsigned long *const  k,unsigned long *const        w)
{register unsigned longy = ntohl(v[0]),z = ntohl(v[1]),a = ntohl(k[0]),b = ntohl(k[1]),c = ntohl(k[2]),d = ntohl(k[3]),n = 0x10,sum = 0,delta = 0x9E3779B9; /*  0x9E3779B9 - 0x100000000 = -0x61C88647 */while (n-- > 0) {sum += delta;y += ((z << 4) + a) ^ (z + sum) ^ ((z >> 5) + b);z += ((y << 4) + c) ^ (y + sum) ^ ((y >> 5) + d);}w[0] = htonl(y); w[1] = htonl(z);
}/*****************************************************************************/
void qq_decipher(unsigned long *const        v,const unsigned long *const  k,unsigned long *const        w)
{register unsigned longy = ntohl(v[0]),z = ntohl(v[1]),a = ntohl(k[0]),b = ntohl(k[1]),c = ntohl(k[2]),d = ntohl(k[3]),n = 0x10,sum = 0xE3779B90,/* why this ? must be related with n value*/delta = 0x9E3779B9;/* sum = delta<<5, in general sum = delta * n */while (n-- > 0) {z -= ((y << 4) + c) ^ (y + sum) ^ ((y >> 5) + d);y -= ((z << 4) + a) ^ (z + sum) ^ ((z >> 5) + b);sum -= delta;}w[0] = htonl(y); w[1] = htonl(z);
}/********************************************************************
* encrypt part
*******************************************************************/void qq_encrypt(unsigned char*  instr,int             instrlen,unsigned char*  key,unsigned char*  outstr,int*            outstrlen_prt)
{unsigned charplain[8],         /* plain text buffer*/plain_pre_8[8],   /* plain text buffer, previous 8 bytes*/*crypted,        /* crypted text*/*crypted_pre_8,  /* crypted test, previous 8 bytes*/*inp;            /* current position in instr*/intpos_in_byte = 1,  /* loop in the byte */is_header = 1,      /* header is one byte*/count = 0,          /* number of bytes being crypted*/padding = 0;      /* number of padding stuff*///  int rand(void);//  void encrypt_every_8_byte (void);    //  int rand(void) {    /* it can be the real random seed function*///    return 0xdead; }  /* override with number, convenient for debug*//*** we encrypt every eight byte ***///  void encrypt_every_8_byte (void) {//    for(pos_in_byte=0; pos_in_byte<8; pos_in_byte++) {//      if(is_header) { plain[pos_in_byte] ^= plain_pre_8[pos_in_byte]; }//      else { plain[pos_in_byte] ^= crypted_pre_8[pos_in_byte]; }//    } /* prepare plain text*///    qq_encipher( (unsigned long *) plain,//       		       (unsigned long *) key, //         		     (unsigned long *) crypted);   /* encrypt it*///    //    for(pos_in_byte=0; pos_in_byte<8; pos_in_byte++) {//      crypted[pos_in_byte] ^= plain_pre_8[pos_in_byte]; //    } //    memcpy(plain_pre_8, plain, 8);     /* prepare next*///    //    crypted_pre_8   =   crypted;       /* store position of previous 8 byte*///    crypted         +=  8;             /* prepare next output*///    count           +=  8;             /* outstrlen increase by 8*///    pos_in_byte     =   0;             /* back to start*///    is_header       =   0;             /* and exit header*///  }/* encrypt_every_8_byte*/pos_in_byte = (instrlen + 0x0a) % 8; /* header padding decided by instrlen*/if (pos_in_byte) {pos_in_byte = 8 - pos_in_byte;}plain[0] = (rand() & 0xf8) | pos_in_byte;memset(plain + 1, rand() & 0xff, pos_in_byte++);memset(plain_pre_8, 0x00, sizeof(plain_pre_8));crypted = crypted_pre_8 = outstr;padding = 1; /* pad some stuff in header*/while (padding <= 2) { /* at most two byte */if (pos_in_byte < 8) { plain[pos_in_byte++] = rand() & 0xff; padding++; }if (pos_in_byte == 8) {//encrypt_every_8_byte(); } //void encrypt_every_8_byte (void) {for (pos_in_byte = 0; pos_in_byte<8; pos_in_byte++) {if (is_header) { plain[pos_in_byte] ^= plain_pre_8[pos_in_byte]; }else { plain[pos_in_byte] ^= crypted_pre_8[pos_in_byte]; }} /* prepare plain text*/qq_encipher((unsigned long *)plain,(unsigned long *)key,(unsigned long *)crypted);   /* encrypt it*/for (pos_in_byte = 0; pos_in_byte<8; pos_in_byte++) {crypted[pos_in_byte] ^= plain_pre_8[pos_in_byte];}memcpy(plain_pre_8, plain, 8);     /* prepare next*/crypted_pre_8 = crypted;       /* store position of previous 8 byte*/crypted += 8;             /* prepare next output*/count += 8;             /* outstrlen increase by 8*/pos_in_byte = 0;             /* back to start*/is_header = 0;             /* and exit header*/}/* encrypt_every_8_byte*/}}inp = instr;while (instrlen > 0) {if (pos_in_byte < 8) { plain[pos_in_byte++] = *(inp++); instrlen--; }if (pos_in_byte == 8) {//encrypt_every_8_byte(); }//void encrypt_every_8_byte (void){for (pos_in_byte = 0; pos_in_byte<8; pos_in_byte++) {if (is_header) { plain[pos_in_byte] ^= plain_pre_8[pos_in_byte]; }else { plain[pos_in_byte] ^= crypted_pre_8[pos_in_byte]; }} /* prepare plain text*/qq_encipher((unsigned long *)plain,(unsigned long *)key,(unsigned long *)crypted);   /* encrypt it*/for (pos_in_byte = 0; pos_in_byte<8; pos_in_byte++) {crypted[pos_in_byte] ^= plain_pre_8[pos_in_byte];}memcpy(plain_pre_8, plain, 8);     /* prepare next*/crypted_pre_8 = crypted;       /* store position of previous 8 byte*/crypted += 8;             /* prepare next output*/count += 8;             /* outstrlen increase by 8*/pos_in_byte = 0;             /* back to start*/is_header = 0;             /* and exit header*/}/* encrypt_every_8_byte*/}}padding = 1; /* pad some stuff in tailer*/while (padding <= 7) { /* at most sever byte*/if (pos_in_byte < 8) { plain[pos_in_byte++] = 0x00; padding++; }if (pos_in_byte == 8) {// encrypt_every_8_byte(); //void encrypt_every_8_byte (void){for (pos_in_byte = 0; pos_in_byte<8; pos_in_byte++) {if (is_header) { plain[pos_in_byte] ^= plain_pre_8[pos_in_byte]; }else { plain[pos_in_byte] ^= crypted_pre_8[pos_in_byte]; }} /* prepare plain text*/qq_encipher((unsigned long *)plain,(unsigned long *)key,(unsigned long *)crypted);   /* encrypt it*/for (pos_in_byte = 0; pos_in_byte<8; pos_in_byte++) {crypted[pos_in_byte] ^= plain_pre_8[pos_in_byte];}memcpy(plain_pre_8, plain, 8);     /* prepare next*/crypted_pre_8 = crypted;       /* store position of previous 8 byte*/crypted += 8;             /* prepare next output*/count += 8;             /* outstrlen increase by 8*/pos_in_byte = 0;             /* back to start*/is_header = 0;             /* and exit header*/}/* encrypt_every_8_byte*/}}*outstrlen_prt = count;
}/* qq_encrypt*//********************************************************************* [decrypt part]* return 0 if failed, otherwise return 1********************************************************************/int qq_decrypt(unsigned char*  instr,int             instrlen,unsigned char*  key,unsigned char*  outstr,int*            outstrlen_ptr)
{unsigned chardecrypted[8], m[8],*crypt_buff,*crypt_buff_pre_8,*outp;intcount,context_start,pos_in_byte,padding;//  int decrypt_every_8_byte (void);//  int decrypt_every_8_byte (void) {//    for (pos_in_byte = 0; pos_in_byte < 8; pos_in_byte ++ ) {//        if (context_start + pos_in_byte >= instrlen) return 1;//        decrypted[pos_in_byte] ^= crypt_buff[pos_in_byte];//    }//    qq_decipher( (unsigned long *) decrypted, //       	  	     (unsigned long *) key, //        	  	   (unsigned long *) decrypted);//    //    context_start +=  8;//    crypt_buff    +=  8;//    pos_in_byte   =   0;//    return 1;//  }/* decrypt_every_8_byte*//* at least 16 bytes and %8 == 0*/if ((instrlen % 8) || (instrlen < 16)) return 0;/* get information from header*/qq_decipher((unsigned long *)instr,(unsigned long *)key,(unsigned long *)decrypted);pos_in_byte = decrypted[0] & 0x7;count = instrlen - pos_in_byte - 10; /* this is the plaintext length*//* return if outstr buffer is not large enought or error plaintext length*/if (*outstrlen_ptr < count || count < 0) return 0;memset(m, 0, 8);crypt_buff_pre_8 = m;*outstrlen_ptr = count;   /* everything is ok! set return string length*/crypt_buff = instr + 8;   /* address of real data start */context_start = 8;        /* context is at the second 8 byte*/pos_in_byte++;           /* start of paddng stuffv*/padding = 1;              /* at least one in header*/while (padding <= 2) {    /* there are 2 byte padding stuff in header*/if (pos_in_byte < 8) {  /* bypass the padding stuff, none sense data*/pos_in_byte++; padding++;}if (pos_in_byte == 8) {crypt_buff_pre_8 = instr;//      if (!decrypt_every_8_byte())//		  return 0; //	  int decrypt_every_8_byte (void);//	  int decrypt_every_8_byte (void){for (pos_in_byte = 0; pos_in_byte < 8; pos_in_byte++) {if (context_start + pos_in_byte >= instrlen)return 0;decrypted[pos_in_byte] ^= crypt_buff[pos_in_byte];}qq_decipher((unsigned long *)decrypted,(unsigned long *)key,(unsigned long *)decrypted);context_start += 8;crypt_buff += 8;pos_in_byte = 0;//		  return 0;}/* decrypt_every_8_byte*/}}/* while*/outp = outstr;while (count != 0) {if (pos_in_byte < 8) {*outp = crypt_buff_pre_8[pos_in_byte] ^ decrypted[pos_in_byte];outp++;count--;pos_in_byte++;}if (pos_in_byte == 8) {crypt_buff_pre_8 = crypt_buff - 8;//      if (! decrypt_every_8_byte()) return 0;//	  int decrypt_every_8_byte (void);//	  int decrypt_every_8_byte (void){for (pos_in_byte = 0; pos_in_byte < 8; pos_in_byte++) {if (context_start + pos_in_byte >= instrlen)return 0;decrypted[pos_in_byte] ^= crypt_buff[pos_in_byte];}qq_decipher((unsigned long *)decrypted,(unsigned long *)key,(unsigned long *)decrypted);context_start += 8;crypt_buff += 8;pos_in_byte = 0;//		  return 0;}/* decrypt_every_8_byte*/}}/* while*/for (padding = 1; padding < 8; padding++) {if (pos_in_byte < 8) {if (crypt_buff_pre_8[pos_in_byte] ^ decrypted[pos_in_byte]) return 0;pos_in_byte++;}if (pos_in_byte == 8) {crypt_buff_pre_8 = crypt_buff;//      if (! decrypt_every_8_byte()) return 0;//	  int decrypt_every_8_byte (void);//	  int decrypt_every_8_byte (void){int haveData = 1;for (pos_in_byte = 0; pos_in_byte < 8; pos_in_byte++) {if (context_start + pos_in_byte >= instrlen){haveData = 0;break;}decrypted[pos_in_byte] ^= crypt_buff[pos_in_byte];}if (haveData == 1){qq_decipher((unsigned long *)decrypted,(unsigned long *)key,(unsigned long *)decrypted);context_start += 8;crypt_buff += 8;pos_in_byte = 0;}//		  return 0;}/* decrypt_every_8_byte*/}}/* for*/return 1;
}/* qq_decrypt*//*****************************************************************************//* This is the Public Function *//* return 1 is succeed, otherwise return 0*/
int qq_crypt(unsigned char   flag,unsigned char*  instr,int             instrlen,unsigned char*  key,unsigned char*  outstr,int*            outstrlen_ptr)
{if (flag == DECRYPT)return qq_decrypt(instr, instrlen, key, outstr, outstrlen_ptr);else if (flag == ENCRYPT)qq_encrypt(instr, instrlen, key, outstr, outstrlen_ptr);return 1; /* flag must be DECRYPT or ENCRYPT*/
}/* qq_crypt*//*****************************************************************************//* END OF FILE*/int qq_decrypt2(unsigned char*  instr,int             instrlen,unsigned char*  key,unsigned char*  outstr,int*            outstrlen_ptr)
{unsigned chardecrypted[8], m[8],*crypt_buff,*crypt_buff_pre_8,*outp;intcount,context_start,pos_in_byte,padding;//  int decrypt_every_8_byte (void);//  int decrypt_every_8_byte (void) {//    for (pos_in_byte = 0; pos_in_byte < 8; pos_in_byte ++ ) {//        if (context_start + pos_in_byte >= instrlen) return 1;//        decrypted[pos_in_byte] ^= crypt_buff[pos_in_byte];//    }//    qq_decipher( (unsigned long *) decrypted, //       	  	     (unsigned long *) key, //        	  	   (unsigned long *) decrypted);//    //    context_start +=  8;//    crypt_buff    +=  8;//    pos_in_byte   =   0;//    return 1;//  }/* decrypt_every_8_byte*//* at least 16 bytes and %8 == 0*/if ((instrlen % 8) || (instrlen < 16)) return 0;/* get information from header*/qq_decipher((unsigned long *)instr,(unsigned long *)key,(unsigned long *)decrypted);pos_in_byte = decrypted[0] & 0x7;count = instrlen - pos_in_byte - 10; /* this is the plaintext length*//* return if outstr buffer is not large enought or error plaintext length*/if (*outstrlen_ptr < count || count < 0) return 0;//   if(count!=285 && count!=143)// 	  return 0;memset(m, 0, 8);crypt_buff_pre_8 = m;*outstrlen_ptr = count;   /* everything is ok! set return string length*/crypt_buff = instr + 8;   /* address of real data start */context_start = 8;        /* context is at the second 8 byte*/pos_in_byte++;           /* start of paddng stuffv*/padding = 1;              /* at least one in header*/while (padding <= 2) {    /* there are 2 byte padding stuff in header*/if (pos_in_byte < 8) {  /* bypass the padding stuff, none sense data*/pos_in_byte++; padding++;}if (pos_in_byte == 8) {crypt_buff_pre_8 = instr;//      if (!decrypt_every_8_byte())//		  return 0; //	  int decrypt_every_8_byte (void);//	  int decrypt_every_8_byte (void){for (pos_in_byte = 0; pos_in_byte < 8; pos_in_byte++) {if (context_start + pos_in_byte >= instrlen)return 0;decrypted[pos_in_byte] ^= crypt_buff[pos_in_byte];}qq_decipher((unsigned long *)decrypted,(unsigned long *)key,(unsigned long *)decrypted);context_start += 8;crypt_buff += 8;pos_in_byte = 0;//		  return 0;}/* decrypt_every_8_byte*/}}/* while*/bool bcheck = false;outp = outstr;while (count != 0) {if ((outp - outstr)>4 && false == bcheck){int aat = outstr[0] * 256 + outstr[1];if (*outstrlen_ptr - aat != 4)return 0;if (outstr[2] == 0 && outstr[3] == 0){bcheck = true;}else if (outstr[2] == 1 &&(outstr[3] >= '0' && outstr[3] <= '9') ||(outstr[3] >= 'a' && outstr[3] <= 'z') ||(outstr[3] >= 'A' && outstr[3] <= 'Z')){bcheck = true;}elsereturn 0;// 		  if(memcmp(outstr+2,"\x00\x00",2)==0)// 		  {// 			 // return 1;// 		  }// 		  else// 		  {// 			  return 0;// 		  }}if (pos_in_byte < 8) {*outp = crypt_buff_pre_8[pos_in_byte] ^ decrypted[pos_in_byte];outp++;count--;pos_in_byte++;}if (pos_in_byte == 8) {crypt_buff_pre_8 = crypt_buff - 8;//      if (! decrypt_every_8_byte()) return 0;//	  int decrypt_every_8_byte (void);//	  int decrypt_every_8_byte (void){for (pos_in_byte = 0; pos_in_byte < 8; pos_in_byte++) {if (context_start + pos_in_byte >= instrlen)return 0;decrypted[pos_in_byte] ^= crypt_buff[pos_in_byte];}qq_decipher((unsigned long *)decrypted,(unsigned long *)key,(unsigned long *)decrypted);context_start += 8;crypt_buff += 8;pos_in_byte = 0;//		  return 0;}/* decrypt_every_8_byte*/}}/* while*/for (padding = 1; padding < 8; padding++) {if (pos_in_byte < 8) {if (crypt_buff_pre_8[pos_in_byte] ^ decrypted[pos_in_byte]) return 0;pos_in_byte++;}if (pos_in_byte == 8) {crypt_buff_pre_8 = crypt_buff;//      if (! decrypt_every_8_byte()) return 0;//	  int decrypt_every_8_byte (void);//	  int decrypt_every_8_byte (void){int haveData = 1;for (pos_in_byte = 0; pos_in_byte < 8; pos_in_byte++) {if (context_start + pos_in_byte >= instrlen){haveData = 0;break;}decrypted[pos_in_byte] ^= crypt_buff[pos_in_byte];}if (haveData == 1){qq_decipher((unsigned long *)decrypted,(unsigned long *)key,(unsigned long *)decrypted);context_start += 8;crypt_buff += 8;pos_in_byte = 0;}//		  return 0;}/* decrypt_every_8_byte*/}}/* for*/return 1;
}/* qq_decrypt*/int qq_crypt2(unsigned char   flag,unsigned char*  instr,int             instrlen,unsigned char*  key,unsigned char*  outstr,int*            outstrlen_ptr
)
{if (flag == DECRYPT)return qq_decrypt2(instr, instrlen, key, outstr, outstrlen_ptr);else if (flag == ENCRYPT)qq_encrypt(instr, instrlen, key, outstr, outstrlen_ptr);return 1; /* flag must be DECRYPT or ENCRYPT*/
}/* qq_crypt*/#endif

相关文章:

QQ数据包解密

Windows版qq数据包格式&#xff1a; android版qq数据包格式&#xff1a; 密钥&#xff1a;16个0 算法&#xff1a;tea_crypt算法 pc版qq 0825数据包解密源码&#xff1a; #include "qq.h" #include "qqcrypt.h" #include <WinSock2.h> #include…...

腾讯云上linux系统使用nginx,flask构建个人网站SSL证书过期换证书的操作步骤

ssl证书过期的时候&#xff0c;一般腾讯云提前一段时间给通知&#xff0c;让更换ssl证书&#xff0c;现在一般都可以免费更换&#xff0c;一般是一年期的&#xff0c;审核通过之后&#xff0c;需要下载nginx版本的证书&#xff0c;我的是4个文件&#xff0c;替换到nginx/cert文…...

git-clone的single-branch操作回退

(Owed by: 春夜喜雨 http://blog.csdn.net/chunyexiyu) 最近使用git越来越多&#xff0c;一些git的功能使用也更熟悉了一些。 之前使用了single-branch下载分支&#xff0c;后来想取消掉&#xff0c;但怎么做呢&#xff0c;查了一些资料之后&#xff0c;了解到了怎么做&#x…...

03 SpringBoot实战 -微头条之首页门户模块(跳转某页面自动展示所有信息+根据hid查询文章全文并用乐观锁修改阅读量)

1.1 自动展示所有信息 需求描述: 进入新闻首页portal/findAllType, 自动返回所有栏目名称和id 接口描述 url地址&#xff1a;portal/findAllTypes 请求方式&#xff1a;get 请求参数&#xff1a;无 响应数据&#xff1a; 成功 {"code":"200","mes…...

YOCTO基础 - 创建meta层与bb文件

背景 在当前的嵌入式系统开发项目中&#xff0c;我们面临着构建定制化 Linux 发行版以满足项目需求的挑战。我们需要在目标硬件上运行一个轻量级、高度定制化的 Linux 映像&#xff0c;并确保它包含我们项目中所需的特定软件包和功能。为了实现这一目标&#xff0c;我们选择了…...

网络电视盒子哪个好?博主分享超高性价比网络电视盒子推荐

电视盒子是我们使用最多的数码产品&#xff0c;年货节很多朋友在纠结网络电视盒子哪个好&#xff0c;我这次的测评产品就是电视盒子&#xff0c;按照18款电视盒子的深度测评结果整理了网络电视盒子推荐&#xff0c;想知道网络电视盒子哪个好可以看看下面这五款电视盒子。 一&am…...

leetcode 刷题2

二分查找的绝妙运用&#xff1a; 看到有序数列&#xff0c;算法复杂度 0033. 搜索旋转排序数组 class Solution { public:int search(vector<int>& nums, int target) {int left 0;int right nums.size() - 1;while (left < right) {int mid left (right - …...

2-SAT问题相关理论和算法

前言 SAT 问题简介 SAT是可满足性、适定性(Satisfiability)问题的简称。一般形式为k-适定性问题或k-可满足性问题&#xff0c;简称 k-SAT。 何为布尔可满足性问题&#xff1f;给定一条真值表达式&#xff0c;包含逻辑变量、逻辑与、逻辑或以及非运算符&#xff0c;如&#x…...

【大数据精讲】全量同步与CDC增量同步方案对比

目录 背景 名词解释 问题与挑战 FlinkCDC DataX 工作原理 调度流程 五、DataX 3.0六大核心优势 性能优化 背景 名词解释 CDC CDC又称变更数据捕获&#xff08;Change Data Capture&#xff09;&#xff0c;开启cdc的源表在插入INSERT、更新UPDATE和删除DELETE活动时…...

自定义通用返回对象

目的&#xff1a;给返回对象补充一些信息&#xff0c;告诉前端这个请求在业务层面上是成功还是失败&#xff0c;以及具体的描述信息。 我们需要自定义错误码&#xff08;因为前端的HTTP状态码默认的值比较少&#xff09;和正常错误返回类。 ErrorCode &#xff1a; package …...

从0开始python学习-51.pytest之接口加密封装

目录 MD5加密 base64加密 rsa加密 MD5加密 1. 封装加密方法 def md5_encode(self,data):data str(data).encode("utf-8")md5_data hashlib.md5(data).hexdigest()return md5_data 2. 写入需要使用加密的接口yaml用例 -request:method: posturl: http://192.168.…...

c++的命名空间

命名空间 一.c的关键字二.命名空间2.1 命名空间定义2.1 命名空间的使用2.1.1加命名空间名称及作用域限定符2.1.2使用using将命名空间中某个成员引入 三.标准命名空间std 一.c的关键字 c中一共有63个关键字 关键字11111asmdoifreturntrycontinueautodoubleinlineshorttypedeff…...

阿富汗塔利班兴起时的比赛代码3475:练85.3 删数问题(Noip1994)

【题目描述】 输入一个高精度的正整数n&#xfffd;&#xff0c;去掉其中任意s&#xfffd;个数字后剩下的数字按原左右次序组成一个新的正整数。编程对给定的n&#xfffd;和s&#xfffd;&#xff0c;寻找一种方案使得剩下的数字组成的新数最小。 输出新的正整数。&#xff0…...

大数据平台红蓝对抗 - 磨利刃,淬精兵!

背景 目前大促备战常见备战工作&#xff1a;专项压测&#xff08;全链路压测、内部压测&#xff09;、灾备演练、降级演练、限流、巡检&#xff08;监控、应用健康度&#xff09;、混沌演练&#xff08;红蓝对抗&#xff09;&#xff0c;如下图所示。随着平台业务越来越复杂&a…...

【2024-01-22】某极验3流程分析-滑块验证码

声明&#xff1a;该专栏涉及的所有案例均为学习使用&#xff0c;严禁用于商业用途和非法用途&#xff0c;否则由此产生的一切后果均与作者无关&#xff01;如有侵权&#xff0c;请私信联系本人删帖&#xff01; 文章目录 一、前言二、抓包流程分析1.刷新页面2.点击按钮进行验证…...

Laya2.13.3接入FGUI

下载与复制文件与Laya1.x类似&#xff0c;可以看我上一篇&#xff1a; Laya1.8.4接入FariyGui&#xff0c;以及其中踩的坑-CSDN博客 不同的是&#xff1a; 两个库文件需要在index.js中引入 新建一个脚本将fgui中搭建好的UI包引入&#xff1a; export default class GameApp…...

短视频账号矩阵系统+无人直播系统源码技术开发

短视频账号矩阵系统无人直播系统源码技术开发涉及到多个领域&#xff0c;包括但不限于前端开发、后端开发、数据库设计、网络通信等。 以下是一些基本技术的步骤和注意事项&#xff1a; 1.技术需求分析设计&#xff1a;首先&#xff0c;需要明确开发短视频账号矩阵系统和无人直…...

C语言或C++通过IShellLinkA创建或解析lnk快捷方式(使用char字符数组)

本例程用到的COM接口有IShellLinkA和IPersistFile。 请注意因为函数参数的类型不为BSTR&#xff0c;所以这两个接口可直接传char *或wchar_t *字符串&#xff0c;不需要提前转化为BSTR类型。 C语言的写法&#xff1a; /* 这个程序只能在C编译器下编译成功, 请确保源文件的扩展…...

Spring源码学习-Spring流程概述(一)

Spring启动的流程 public class Test {public static void main(String[] args) {ClassPathXmlApplicationContext context new ClassPathXmlApplicationContext("applicationContext.xml");Student bean context.getBean(Student.class);context.close();} }调用…...

Figma怎么设置中文,Figma有中文版吗?

不是很多人不想用 Figma&#xff0c;真是因为纯英文界面而头疼。这就是为什么有人会到处搜索 Figma 如何设置中文这样的问题。 然后我们直接快刀斩乱麻&#xff0c;Figma 没有中文版&#xff0c;但是我们还有其他的方法&#xff1a;例如&#xff0c; Figma 添加一个插件来解决…...

智慧文旅一机游:科技与文化的完美结合,引领智慧文旅新潮流,智慧旅游未来已来

一、科技与文化的完美结合&#xff1a;智慧文旅一机游的核心理念 智慧文旅一机游&#xff0c;是科技与文化相融合的产物&#xff0c;它不仅代表着旅游行业的创新与发展&#xff0c;更是一种文化与科技完美结合的生活方式。一机游的核心理念在于通过先进的科技手段&#xff0c;提…...

多维时序 | Matlab实现CNN-LSTM-Mutilhead-Attention卷积长短期记忆神经网络融合多头注意力机制多变量时间序列预测

多维时序 | Matlab实现CNN-LSTM-Mutilhead-Attention卷积长短期记忆神经网络融合多头注意力机制多变量时间序列预测 目录 多维时序 | Matlab实现CNN-LSTM-Mutilhead-Attention卷积长短期记忆神经网络融合多头注意力机制多变量时间序列预测效果一览基本介绍程序设计参考资料 效果…...

软件工程实验报告(完整)

博主介绍&#xff1a;✌全网粉丝喜爱、前后端领域优质创作者、本质互联网精神、坚持优质作品共享、掘金/腾讯云/阿里云等平台优质作者、擅长前后端项目开发和毕业项目实战✌有需要可以联系作者我哦&#xff01; &#x1f345;附上相关C语言版源码讲解&#x1f345; &#x1f44…...

Java零基础学习20:集合的练习

编写博客目的&#xff1a;本系列博客均根据B站黑马程序员系列视频学习和编写目的在于记录自己的学习点滴&#xff0c;方便后续回忆和查找相关知识点&#xff0c;不足之处恳请各位有缘的朋友指正。 一、查找id对应的集合索引 package www.itheima;import java.util.ArrayList;…...

【latex】在Overleaf的IEEE会议模板中,快速插入参考文献

【LaTeX】在Overleaf的IEEE会议模板中&#xff0c;快速插入参考文献 写在最前面第一步&#xff1a;在文献检索网站导出引用文献的bib文件第二步&#xff1a;编辑overleaf模版方法二&#xff1a;EduBirdie生成参考文献&#xff08;补充&#xff09;使用LaTeX在Overleaf的IEEE会议…...

java反射之Field用法(获取对象的字段名和属性值)

一、概述 Field是一个类,位于java.lang.reflect包下。在Java反射中Field类描述的是类的属性信息&#xff0c;功能包括&#xff1a; 获取当前对象的成员变量的类型 对成员变量重新设值 二、如何获取Field类对象 getField(String name)&#xff1a; 获取类特定的方法&#xff0c…...

Java Web(三)--CSS

介绍 为什么需要&#xff1a; 在没有 CSS 之前&#xff0c;想要修改 HTML 元素的样式需要为每个 HTML 元素单独定义样式属性&#xff0c;费心费力&#xff1b;CSS 可以让 html 元素(内容) 样式(CSS)分离&#xff0c;提高web 开发的工作效率(针对前端开发)&#xff0c;从而…...

天津大数据培训班推荐,数据分析过程的常见错误

大数据”是近年来IT行业的热词&#xff0c;目前已经广泛应用在各个行业。大数据&#xff0c;又称海量信息&#xff0c;特点是数据量大、种类多、实时性强、数据蕴藏的价值大。大数据是对大量、动态、能持续的数据&#xff0c;通过运用分析、挖掘和整理&#xff0c;实现数据信息…...

【笔记】Helm-3 主题-17 弃用的Kubernetes API

弃用的Kubernetes API Kubernetes是一个API驱动系统&#xff0c;且API会随着时间的推移而变化&#xff0c;以反映对问题理解的不断推移。这是系统及API的普遍做法。API推移的一个重要部分是良好的弃用策略和通知用户更改API是如何实现的。换句话说&#xff0c;您的API使用者需要…...

麒麟系统—— openKylin 安装 java

麒麟系统—— openKylin 安装 java JDK 一、准备工作1. 确保麒麟系统 openKylin 已经安装完毕。2. 了解 java JDK 的版本信息&#xff0c;以便下载合适的安装包。 二、安装 java JDK3. 将下载好的 java JDK 安装包解压到指定目录。4. 配置环境5. 验证安装结果 本文将分享如何在…...