2024年3月24日发(作者:)
QQ源代码
// : implementation of the MyQQ class. //////////////////////////////
//////////////////////////////////////// #include #include
#include "winsock2.h"
#include "MyQQ.h" #include "md5.h"
#ifdef _DEBUG #undef THIS_FILE
static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif
////////////////////////////////////////////////////////////////////// // Constructio
n/Destruction
////////////////////////////////////////////////////////////////////// MyQQ::MyQQ
() {
s = NULL;
LoginToken = NULL; LoginTokenLength = 0; Status = 0; //
线 IsLogin = false; LastID = 0;
下
MessageText = NULL; FriendListHead = NULL; FriendListTail = NULL;
1文档来源为:从网络收集整理.word版本可编辑.
send_seq = random() & 0x0000ffff; LastOnline = time(NULL); UDPServer
Num = 0; //服务器地址
LoginServer = (char *)malloc(16*sizeof(char)); //QQ号 UserID = 0; //密
码
Password = NULL;
//得到初始化密钥,按2004版
InitKey = (unsigned char*)malloc(QQ_KEY_LENGTH);
int i;
for(i = 0; i < 16; i++) InitKey = rand();
SessionKey = (unsigned char*)malloc(QQ_KEY_LENGTH); }
MyQQ::~MyQQ() {
if(LoginServer != NULL) free(LoginServer); if(MyIP != NULL) free(
MyIP);
if(MessageText != NULL) free(MessageText); if(Password != NULL)
free(Password); if(InitKey != NULL) free(InitKey); if(PwdKey != NULL)
free(PwdKey);
2文档来源为:从网络收集整理.word版本可编辑.


发布评论