Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

evadefines.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 by yunfan                                          *
00003  *   yunfan_zg@163.com                                                     *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020  
00021 #ifndef LIBEVADEFINES_H
00022 #define LIBEVADEFINES_H
00023 
00025 typedef unsigned int uint;
00026 
00028 #ifdef WIN32
00029 #pragma warning(disable: 4309 4800)
00030 typedef unsigned char uint8_t;
00031 #include <malloc.h>
00032 #endif
00033 
00037 static const unsigned char login_16_51[]= {
00038                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
00039                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
00040                         0x00, 0x00, 0x00, 0x4c, 0x28, 0xeb, 0xaa, 0xe9, 
00041                         0x7f, 0x2a, 0x7c, 0xf9, 0xa9, 0x0f, 0x84, 0xdd, 
00042                         0xbb, 0xb2, 0x0f, 0x01
00043                         };
00045 static const unsigned char login_53_68 []= {
00046                         0x43, 0xc3, 0x80, 0x19, 0x46, 0x05, 0x3e, 0x4b, 
00047                         0x91, 0x60, 0x5b, 0xf8, 0x17, 0xd7, 0xf3, 0x5b
00048                         };      
00050 static const unsigned char login_94_193 []= {
00051                         0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
00052                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00053                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
00054                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
00055                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
00056                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
00057                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
00058                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
00059                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
00060                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
00061                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
00062                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
00063                         0x00, 0x00, 0x00, 0x00
00064                         };
00065 
00067 static const char QQ_APPLY_FREE_NUMBER_URL[] = "http://freeqq2.qq.com/1.shtml";
00068 
00070 const unsigned short SYSTEM_MESSAGE_NORMAL = 0x0001;
00071 
00073 static const int QQ_LOGIN_UDP = 0;
00075 static const int QQ_LOGIN_TCP = 1;
00076 
00078 const int QQ_UDP_HEADER_LENGTH = 7;
00080 const int QQ_TCP_HEADER_LENGTH = 9;
00082 const int QQ_TAIL_LENGTH = 1;
00083 
00085 const int QQ_ACK_PACKET_SEND_TIME = 4;
00086 
00087 
00089 const int MAX_PACKET_SIZE = 65535;
00091 const int MAX_SEND_IM_SIZE = 400;
00093 const int QQ_KEY_LENGTH = 16;
00095 const int QQ_LOGIN_DATA_LENGTH = 416;
00096 
00098 const short QQ_IM_ENCODING_GB = 0x8602;
00099 
00101 const long QQ_SENDQUEUE_TIMEOUT = 5000;
00103 const int QQ_RESEND_MAX = 5;
00105 const unsigned long QQ_KEEP_ALIVE_INTERVAL = 60000;
00106 
00107 const int QQ_MAX_GROUP_NAME_BYTE = 16;
00108 const int QQ_NAME_LENGTH_MAX = 250;
00109 const int QQ_MSG_IM_MAX = 1500;
00110 const int QQ_CONTACT_FIELDS = 37;
00111 const int QQ_MEMO_FIELDS = 7;
00112 
00114 const short QQ_CLIENT_062E = 0x062E;
00116 const short QQ_CLIENT_072E = 0x072E;
00118 const short QQ_CLIENT_0801 = 0x0801;
00120 const short QQ_CLIENT_0A1D = 0x0A1D;
00122 const short QQ_CLIENT_0B07 = 0x0B07;
00124 const short QQ_CLIENT_0B2F = 0x0B2f;
00126 const short QQ_CLIENT_0B35 = 0x0B35;
00128 const short QQ_CLIENT_0B37 = 0x0B37;
00130 const short QQ_CLIENT_0C0B = 0x0C0B;
00132 const short QQ_CLIENT_0C0D = 0x0C0D;
00134 const short QQ_CLIENT_0C21 = 0x0C21;
00136 const short QQ_CLIENT_0C49 = 0x0C49;
00138 const short QQ_CLIENT_0D05 = 0x0D05;
00140 const short QQ_CLIENT_0D51 = 0x0D51;
00142 const short QQ_CLIENT_0D61 = 0x0D61;
00144 const short QQ_CLIENT_0E1B = 0x0E1B;
00146 const short QQ_CLIENT_05A5 = 0x05A5;
00148 const short QQ_CLIENT_05F1 = 0x0F15;
00149 
00150 
00152 const short QQ_SERVER_0100 = 0x0100;
00154 const short QQ_SERVER_0000 = 0x0000;
00155 
00157 const short QQ_CLIENT_VERSION = 0x0F15;
00159 const unsigned char QQ_PACKET_TAG = 0x02;
00161 const unsigned char QQ_PACKET_TAIL = 0x03;
00162 
00163 const unsigned char QQ_LOGIN_MODE_NORMAL = 0x0A;
00164 const unsigned char QQ_LOGIN_MODE_INVISIBLE = 0x28;
00165 
00166 const unsigned char QQ_FRIEND_GENDER_GG = 0x0;
00167 const unsigned char QQ_FRIEND_GENDER_MM = 0x1;
00168 
00169 const unsigned char QQ_FRIEND_GENDER_UNKNOWN = 0xFF;
00170 
00171 const unsigned char QQ_FRIEND_FLAG_QQ_MEMBER = 0x01;
00172 const unsigned char QQ_FRIEND_FLAG_MOBILE = 0x10;
00173 const unsigned char QQ_FRIEND_FLAG_BIND_MOBILE = 0x20;
00174 
00175 const unsigned char QQ_FRIEND_STATUS_ONLINE = 10;
00176 const unsigned char QQ_FRIEND_STATUS_OFFLINE = 20;
00177 const unsigned char QQ_FRIEND_STATUS_LEAVE = 30;
00178 const unsigned char QQ_FRIEND_STATUS_INVISIBLE = 40;
00179 
00180 const int QQ_MISC_STATUS_HAVING_VIDEO = 0x00000001;
00181 
00182 const unsigned char QQ_REQUEST_LOGIN_TOKEN_REPLY_OK = 0x00;
00183 const unsigned char QQ_LOGIN_REPLY_OK = 0x00;
00184 const unsigned char QQ_LOGIN_REPLY_REDIRECT = 0x01;
00185 const unsigned char QQ_LOGIN_REPLY_PWD_ERROR = 0x05;
00186 const unsigned char QQ_LOGIN_REPLY_MISC_ERROR = 0x06;
00187 
00188 const unsigned char QQ_UPLOAD_GROUP_FRIEND_OK = 0x00;
00189 const unsigned char QQ_UPLOAD_FRIEND_REMARK_OK = 0x00;
00190 const unsigned char QQ_CHANGE_STATUS_REPLY_OK = 0x30;
00191 
00192 const unsigned char QQ_SEND_IM_REPLY_OK = 0x00;
00193 
00194 const unsigned char QQ_ADD_FRIEND_AUTH_REPLY_OK = 0x30;
00195 const unsigned char QQ_DELETE_FRIEND_REPLY_OK = 0x00;
00196 const unsigned char QQ_DELETE_ME_REPLY_OK = 0x00;
00197 
00198 const unsigned char QQ_REQUEST_KEY_REPLY_OK = 0x00;
00199 
00200 const short QQ_FRIEND_LIST_POSITION_START = 0x0000;
00201 const short QQ_FRIEND_LIST_POSITION_END = 0xFFFF;
00202 const char QQ_FRIEND_ONLINE_LIST_POSITION_START = 0x00;
00203 const char QQ_FRIEND_ONLINE_LIST_POSITION_END = 0xFF; 
00204 const unsigned char QQ_FRIEND_LIST_UNSORTED = 0;
00205 const unsigned char QQ_FRIEND_LIST_SORTED = 1;
00206 
00207 
00208 /* QQ commands */
00209 const short QQ_CMD_LOGOUT = 0x0001;
00210 const short QQ_CMD_KEEP_ALIVE = 0x0002;
00211 const short QQ_CMD_MODIFY_INFO = 0x0004;
00212 const short QQ_CMD_SEARCH_USER = 0x0005;
00213 const short QQ_CMD_GET_USER_INFO = 0x0006;
00214 const short QQ_CMD_ADD_FRIEND = 0x0009;
00215 const short QQ_CMD_DELETE_FRIEND = 0x000A;
00216 const short QQ_CMD_ADD_FRIEND_AUTH = 0x000B;
00217 const short QQ_CMD_CHANGE_STATUS = 0x000D;
00218 const short QQ_CMD_ACK_SYS_MSG = 0x0012;
00219 const short QQ_CMD_SEND_IM = 0x0016;
00220 const short QQ_CMD_RECV_IM = 0x0017;
00221 const short QQ_CMD_DELETE_ME = 0x001C;
00222 const short QQ_CMD_REQUEST_KEY = 0x001D;
00223 const short QQ_CMD_CELL_PHONE_1 = 0x0021;
00224 const short QQ_CMD_LOGIN = 0x0022;
00225 const short QQ_CMD_GET_FRIEND_LIST = 0x0026;
00226 const short QQ_CMD_GET_FRIEND_ONLINE = 0x0027;
00227 const short QQ_CMD_CELL_PHONE_2 = 0x0029;
00228 const short QQ_CMD_QUN_CMD = 0x0030;
00229 const short QQ_CMD_TEST = 0x0031;
00230 const short QQ_CMD_GROUP_NAME_OP = 0x003C;
00231 const short QQ_CMD_UPLOAD_GROUP_FRIEND = 0x003D;
00232 const short QQ_CMD_MEMO_OP = 0x003E;
00233 const short QQ_CMD_DOWNLOAD_GROUP_FRIEND = 0x0058;
00234 const short QQ_CMD_GET_LEVEL = 0x005C;
00235 const short QQ_CMD_REQUEST_LOGIN_TOKEN = 0x0062;
00236 const short QQ_CMD_REQUEST_EXTRA_INFORMATION = 0x0065;
00237 const short QQ_CMD_SIGNATURE_OP = 0x0067;
00238 const short QQ_CMD_RECV_MSG_SYS = 0x0080;
00239 const short QQ_CMD_RECV_MSG_FRIEND_CHANGE_STATUS = 0x0081;
00240 
00241 const unsigned char QQ_REQUEST_UNKNOWN_KEY = 0x03;
00242 const unsigned char QQ_REQUEST_FILE_AGENT_KEY = 0x04;
00243 
00244 const unsigned char QQ_IM_NORMAL_REPLY = 0x01;
00245 const unsigned char QQ_IM_AUTO_REPLY = 0x02;
00246 const unsigned char QQ_IM_IMAGE_REPLY = 0x05;
00247 
00249 const unsigned int QQ_EXTAR_INFO_PAL       = 0x0400;  // QQ friends center flag
00250 const unsigned int QQ_EXTAR_INFO_USER_HEAD = 0x1000;  // QQ customized face flag, QQ calls them user head, because all pictures stored in UserHead directory
00251 const unsigned int QQ_EXTAR_INFO_ALBUM     = 0x0001;  // QQ ablum flag
00252 const unsigned int QQ_EXTAR_INFO_TANG      = 0x0008;  // QQ tang flag, is QQ tang a sort of game? not sure what it is.
00253 const unsigned int QQ_EXTAR_INFO_SIGNATURE = 0x0040;  // QQ personal signature flag
00254 
00256 const unsigned char QQ_SIGNATURE_MODIFY = 0x01;
00257 const unsigned char QQ_SIGNATURE_DELETE = 0x02;
00258 const unsigned char QQ_SIGNATURE_REQUEST = 0x03;
00259 
00260 /*  sub-command of Qun */
00261 const unsigned char QQ_QUN_CMD_CREATE_QUN          = 0x01;
00262 const unsigned char QQ_QUN_CMD_MODIFY_MEMBER       = 0x02;
00263 const unsigned char QQ_QUN_CMD_MODIFY_QUN_INFO     = 0x03;
00264 const unsigned char QQ_QUN_CMD_GET_QUN_INFO        = 0x04;
00265 const unsigned char QQ_QUN_CMD_ACTIVATE_QUN        = 0x05;
00266 const unsigned char QQ_QUN_CMD_SEARCH_QUN          = 0x06;
00267 const unsigned char QQ_QUN_CMD_JOIN_QUN            = 0x07;
00268 const unsigned char QQ_QUN_CMD_JOIN_QUN_AUTH       = 0x08;
00269 const unsigned char QQ_QUN_CMD_EXIT_QUN            = 0x09;
00270 const unsigned char QQ_QUN_CMD_SEND_IM             = 0x0A;
00271 const unsigned char QQ_QUN_CMD_GET_ONLINE_MEMBER   = 0x0B;
00272 const unsigned char QQ_QUN_CMD_GET_MEMBER_INFO     = 0x0C;
00273 const unsigned char QQ_QUN_CMD_MODIFY_CARD         = 0x0E;
00274 const unsigned char QQ_QUN_CMD_REQUEST_ALL_REALNAMES = 0x0F;
00275 const unsigned char QQ_QUN_CMD_REQUEST_CARD        = 0x10;
00276 const unsigned char QQ_QUN_CMD_SEND_IM_EX          = 0x1A;
00277 const unsigned char QQ_QUN_CMD_ADMIN               = 0x1B;
00278 const unsigned char QQ_QUN_CMD_TRANSFER            = 0x1C;
00279 const unsigned char QQ_QUN_CMD_CREATE_TEMP_QUN     = 0x30;
00280 const unsigned char QQ_QUN_CMD_MODIFY_TEMP_QUN_MEMBER    = 0x31;
00281 const unsigned char QQ_QUN_CMD_EXIT_TEMP_QUN       = 0x32;
00282 const unsigned char QQ_QUN_CMD_GET_TEMP_QUN_INFO   = 0x33;
00283 const unsigned char QQ_QUN_CMD_SEND_TEMP_QUN_IM    = 0x35;
00284 const unsigned char QQ_QUN_CMD_GET_TEMP_QUN_MEMBERS      = 0x37;
00285 const unsigned char QQ_QUN_CMD_REPLY_OK            = 0x00;
00286 const unsigned char QQ_QUN_CMD_REPLY_NO_SUCH_QUN   = 0x02;
00287 const unsigned char QQ_QUN_CMD_REPLY_TEMP_QUN_REMOVED    = 0x03;
00288 const unsigned char QQ_QUN_CMD_REPLY_NOT_TEMP_QUN_MEMBER = 0x04;
00289 const unsigned char QQ_QUN_CMD_REPLY_NOT_QUN_MEMBER      = 0x0a;
00290 const unsigned char QQ_QUN_TYPE_PERMANENT          = 0x01;
00291 const unsigned char QQ_TEMP_QUN_TYPE_MULTI_TALK    = 0x01;
00292 const unsigned char QQ_TEMP_QUN_TYPE_DISCUSSION_GROUP    = 0x02;
00293 const unsigned char QQ_QUN_MEMBER_ADD              = 0x01;
00294 const unsigned char QQ_QUN_MEMBER_REMOVE           = 0x02;
00295 const unsigned char QQ_QUN_NO_AUTH                 = 0x01;
00296 const unsigned char QQ_QUN_NEED_AUTH               = 0x02;
00297 const unsigned char QQ_QUN_NO_ADD                  = 0x03;
00298 const unsigned char QQ_QUN_AUTH_REQUEST            = 0x01;
00299 const unsigned char QQ_QUN_AUTH_APPROVE            = 0x02;
00300 const unsigned char QQ_QUN_AUTH_REJECT             = 0x03;
00301 const unsigned char QQ_QUN_JOIN_OK                 = 0x01;
00302 const unsigned char QQ_QUN_JOIN_NEED_AUTH          = 0x02;
00303 const unsigned char QQ_QUN_JOIN_DENIED             = 0x03;
00304 const unsigned char QQ_SEARCH_QUN_BY_ID            = 0x01;
00305 const unsigned char QQ_SEARCH_DEMO_QUN             = 0x02;
00306 const unsigned char QQ_QUN_UNSET_ADMIN            = 0x00;
00307 const unsigned char QQ_QUN_SET_ADMIN               = 0x01;
00308 
00309 
00310 /* group operation commands */
00311 const unsigned char QQ_UPLOAD_GROUP_NAME = 0x2;
00312 const unsigned char QQ_DOWNLOAD_GROUP_NAME = 0x1;
00313 
00314 /* remark operation commands */
00315 const unsigned char QQ_UPLOAD_FRIEND_REMARK = 0x1;
00316 const unsigned char QQ_DOWNLOAD_FRIEND_REMARK = 0x3;
00317 
00318 /* used in download grouped friends */
00319 const unsigned char QQ_ID_IS_FRIEND = 0x1;
00320 const unsigned char QQ_ID_IS_QUN = 0x4;
00321 
00323 const short QQ_RECV_IM_TO_BUDDY = 0x0009;
00324 const short QQ_RECV_IM_TO_UNKNOWN = 0x000A;
00326 const short QQ_RECV_IM_QUN_IM_TEMP = 0x001F; // this means another member of a Qun send a message to you only
00327 const short QQ_RECV_IM_UNKNOWN_QUN_IM = 0x0020;
00328 const short QQ_RECV_IM_ADDED_TO_QUN = 0x0021;
00329 const short QQ_RECV_IM_DELETED_FROM_QUN = 0x0022; // kicked out from a Qun
00330 const short QQ_RECV_IM_REQUEST_JOIN_QUN = 0x0023;
00331 const short QQ_RECV_IM_APPROVE_JOIN_QUN = 0x0024;
00332 const short QQ_RECV_IM_REJECT_JOIN_QUN = 0x0025;
00333 const short QQ_RECV_IM_CREATE_QUN = 0x0026;
00334 const short QQ_RECV_IM_TEMP_QUN_IM = 0x002A;
00335 const short QQ_RECV_IM_QUN_IM = 0x002B;
00336 const short QQ_RECV_IM_SYS_MESSAGE = 0x0030;
00337 const short QQ_RECV_IM_SIGNATURE_CHANGED = 0x0041;
00338 
00340 const unsigned char QQ_RECV_IM_KICK_OUT = 0x01;
00341 
00342 /* sub types of QQ_RECV_IM_TO_BUDDY */
00343 const short QQ_IM_NORMAL_TEXT = 0x000B;
00344 const short QQ_IM_TCP_REQUEST = 0x0001;
00345 const short QQ_IM_ACCEPT_TCP_REQUEST = 0x0003;
00346 const short QQ_IM_REJECT_TCP_REQUEST = 0x0005;
00347 const short QQ_IM_UDP_REQUEST = 0x0035;
00348 const short QQ_IM_ACCEPT_UDP_REQUEST = 0x0037;
00349 const short QQ_IM_REJECT_UDP_REQUEST = 0x0039;
00350 const short QQ_IM_NOTIFY_IP = 0x003B;
00351 const short QQ_IM_ARE_YOU_BEHIND_FIREWALL = 0x003F;
00352 const short QQ_IM_ARE_YOU_BEHIND_PROXY = 0x0041;
00353 const short QQ_IM_YES_I_AM_BEHIND_PROXY = 0x0042;
00354 const short QQ_IM_NOTIFY_FILE_AGENT_INFO = 0x004B;
00355 const short QQ_IM_REQUEST_CANCELED = 0x0049;
00356 
00357 const short QQ_IM_EX_UDP_REQUEST = 0x0081;
00358 const short QQ_IM_EX_REQUEST_ACCEPTED = 0x0083;
00359 const short QQ_IM_EX_REQUEST_CANCELLED = 0x0085;
00360 const short QQ_IM_EX_NOTIFY_IP = 0x0087;
00361 
00362 
00364 #define QQ_TRANSFER_FILE                0x65
00365 #define QQ_TRANSFER_IMAGE               0x66
00366 #define QQ_TRANSFER_FACE                0x6B
00367 #define QQ_TRANSFER_CAMERA              0xA1
00368 
00370 #define QQ_TRANSFER_FILE_UDP            0x00
00371 #define QQ_TRANSFER_FILE_DIRECT_UDP     0x01
00372 #define QQ_TRANSFER_FILE_TCP            0x02
00373 #define QQ_TRANSFER_FILE_DIRECT_TCP     0x03
00374 
00376 const unsigned char QUN_TYPE_ADMIN = 1;
00377 const unsigned char QUN_TYEP_SHAREHOLDER = 2;
00378 
00380 const unsigned char QQ_AUTH_NO_AUTH = 0;
00381 const unsigned char QQ_AUTH_NEED_AUTH = 1;
00382 const unsigned char QQ_AUTH_NO_ADD = 2;
00383 
00384 const unsigned char QQ_MY_AUTH_APPROVE = 0x30;
00385 const unsigned char QQ_MY_AUTH_REJECT = 0x31;
00386 const unsigned char QQ_MY_AUTH_REQUEST = 0x32;
00387 
00388 const int QQ_CONTACT_OPEN = 0;
00389 const int QQ_CONTACT_ONLY_FRIENDS = 1;
00390 const int QQ_CONTACT_CLOSE = 2;
00391 
00392 const short QQ_MSG_SYS_BEING_ADDED = 1;
00393 const short QQ_MSG_SYS_ADD_FRIEND_REQUEST = 2;
00394 const short QQ_MSG_SYS_ADD_FRIEND_APPROVED = 3;
00395 const short QQ_MSG_SYS_ADD_FRIEND_REJECTED = 4;
00396 const short QQ_MSG_SYS_UPDATE_HINT = 9;
00397 
00398 const unsigned char QQ_SEARCH_ALL = 0x31;
00399 const unsigned char QQ_SEARCH_CUSTOM = 0x30;
00400 
00402 const unsigned char QQ_MEMO_UPLOAD = 0x01;
00403 const unsigned char QQ_MEMO_REMOVE = 0x02;
00404 const unsigned char QQ_MEMO_DOWNLOAD = 0x03;
00405 
00406 #endif

Generated on Mon May 15 20:48:40 2006 for libeva by  doxygen 1.4.4