當前位置:首頁 » 操作系統 » qq秒源碼

qq秒源碼

發布時間: 2024-10-07 23:41:37

Ⅰ 如何用c語言編寫QQ聊天程序(源代碼)

1、首先,我們編寫C語言的頭文件#include <stdio.h>。

Ⅱ 怎麼獲得QQ源代碼

</b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b>return
(unsigned
char
*)
send_im_tail;
}

//
處理普通的
QQ
消息

void
MyQQ::qq_process_recv_normal_im(unsigned
char
*
data,
unsigned
char
**
cur
sor,
int
len)
{
int
bytes;
qq_recv_normal_im_common
*common;
qq_recv_normal_im_unprocessed
*im_unprocessed;

if
(*cursor
>=
(data
+
len
-
1))
{
return;
}
else
common
=
(qq_recv_normal_im_common
*)malloc(sizeof(qq_recv_normal_im_commo
n));

bytes
=
qq_normal_im_common_read(data,
cursor,
len,
common);
if
(bytes
<
0)
{
return;
}

switch
(common->normal_im_type)
{
case
QQ_NORMAL_IM_TEXT:
qq_process_recv_normal_im_text
(data,
cursor,
len,
common);
break;
case
QQ_NORMAL_IM_FILE_REJECT_UDP:
//qq_process_recv_file_reject
(data,
cursor,
len,
</b></b>//
common->sender_uid,
gc);
break;
case
QQ_NORMAL_IM_FILE_APPROVE_UDP:
//qq_process_recv_file_accept
(data,
cursor,
len,
//
common->sender_uid,
gc);
break;
case
QQ_NORMAL_IM_FILE_REQUEST:
//qq_process_recv_file_request
(data,
cursor,
len,
//
common->sender_uid,
gc);
break;
case
QQ_NORMAL_IM_FILE_CANCEL:
//qq_process_recv_file_cancel
(data,
cursor,
len,
//
common->sender_uid,
gc);
break;
case
QQ_NORMAL_IM_FILE_NOTIFY:
//qq_process_recv_file_notify
(data,
cursor,
len,
//
common->sender_uid,
gc);
break;
default:
return;
}
//
normal_im_type

g_free
(common->session_md5);
}

void
MyQQ::qq_process_recv_normal_im_text(unsigned
char
*
data,
unsigned
char
**

cursor,
int
len,
qq_recv_normal_im_common
*
common)
{
short
gaim_msg_type;
</b></b>char
*name;
char
*msg_with_gaim_smiley;
char
*msg_utf8_encoded;
qq_recv_normal_im_text
*im_text;

if
(*cursor
>=
(data
+
len
-
1))
{
return;
}
else
im_text
=
(qq_recv_normal_im_text
*)malloc(sizeof(qq_recv_normal_im_text));

im_text->common
=
common;

read_packet_w(data,
cursor,
len,
&(im_text->msg_seq));
read_packet_dw(data,
cursor,
len,
&(im_text->send_time));
read_packet_b(data,
cursor,
len,
&(im_text->unknown1));
read_packet_b(data,
cursor,
len,
&(im_text->sender_icon));
read_packet_data(data,
cursor,
len,
(unsigned
char
*)
&
(im_text->unknown2),
3);
read_packet_b(data,
cursor,
len,
&(im_text->is_there_font_attr));
read_packet_data(data,
cursor,
len,
(unsigned
char
*)
&
(im_text->unknown3),
4);
read_packet_b(data,
cursor,
len,
&(im_text->msg_type));

if
(im_text->msg_type
==
QQ_IM_AUTO_REPLY)
{
im_text->is_there_font_attr
=
0x00;

im_text->msg
=
(unsigned
char
*)malloc(1024);
memcpy(im_text->msg,*cursor,
data
+
len
-
*cursor);
}
else
{
if
(im_text->is_there_font_attr)
{
im_text->msg
=
(unsigned
char
*)malloc(1500);
memcpy(im_text->msg,*cursor,
strlen((const
char
*)*cursor));
</b></b>im_text->msg[strlen((const
char
*)*cursor)]
=
0;

}
else
{
im_text->msg
=
(unsigned
char
*)malloc(1024);
memcpy(im_text->msg,*cursor,
data
+
len
-
*cursor);
im_text->msg[data
+
len
-
*cursor]
=
0;
}
}

MessageText
=
im_text->msg;
//
如果需要自動回復

if(Status
==
3)
{
//I_QQAutoReply()
函數獲取預先設置的自動回復消息內容,需自己實現

char*
MText
=
I_QQAutoReply();
QQSendTextMessage(common->sender_uid,MText,0x01);
}

//
在主界面中顯示消息

//I_QQReceiveMessage((char
*)MessageText,common->sender_uid);
}

int
MyQQ::qq_normal_im_common_read(unsigned
char
*
data,
unsigned
char
**
curs
or,
int
len,
qq_recv_normal_im_common
*
common)
{
int
bytes;

bytes
=
0;
</b></b>
bytes
+=
read_packet_w(data,
cursor,
len,
&(common->sender_ver));
bytes
+=
read_packet_dw(data,
cursor,
len,
&(common->sender_uid));
bytes
+=
read_packet_dw(data,
cursor,
len,
&(common->receiver_uid));

common->session_md5
=
(unsigned
char
*)malloc(QQ_KEY_LENGTH);
memcpy(common->session_md5,*cursor,
QQ_KEY_LENGTH);
bytes
+=
QQ_KEY_LENGTH;
*cursor
+=
QQ_KEY_LENGTH;

bytes
+=
read_packet_w(data,
cursor,
len,
&(common->normal_im_type));

if
(bytes
!=
28)
{

return
-1;
}

return
bytes;
}

Ⅲ 怎麼樣獲取qq源代碼

進入要慎爛毀查看的代碼網站,在有空位的地方點擊寬備滑鼠右鍵,然後點擊查看源代碼歷粗。點擊查看源代碼後,就會顯示出這個網站的代碼。

熱點內容
linux是實時系統嗎 發布:2024-11-24 07:23:17 瀏覽:142
java數據挖掘演算法 發布:2024-11-24 07:18:59 瀏覽:853
我的世界伺服器怎麼重開指令 發布:2024-11-24 07:14:13 瀏覽:155
python刪除dataframe 發布:2024-11-24 07:05:38 瀏覽:734
安卓機藍牙怎麼傳東西 發布:2024-11-24 06:58:34 瀏覽:108
android疊效果 發布:2024-11-24 06:58:33 瀏覽:991
富士通電腦伺服器設置u盤啟動 發布:2024-11-24 06:56:21 瀏覽:716
delphipython 發布:2024-11-24 06:51:24 瀏覽:866
安卓手機如何添加文字 發布:2024-11-24 06:50:54 瀏覽:567
小米存儲位置設置 發布:2024-11-24 06:45:10 瀏覽:207