From 8ec20efce0d1b1c8238df8f27938d3f946e685cd Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Wed, 2 Feb 2011 11:13:23 +0000 Subject: [PATCH] ICQ: - deleted unused files - Spelling mistake corrected - Added correct build_xx.bat files (altough program itself still needs to be translated) git-svn-id: svn://kolibrios.org@1833 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/network/icq/trunk/build_en.bat | 5 + programs/network/icq/trunk/build_ru.bat | 5 +- programs/network/icq/trunk/config.inc | 1 - programs/network/icq/trunk/ki.asm | 636 ++++++++++++------------ programs/network/icq/trunk/lang.inc | 1 - programs/network/icq/trunk/macros.inc | 502 ------------------- programs/network/icq/trunk/struct.inc | 180 ------- 7 files changed, 327 insertions(+), 1003 deletions(-) create mode 100644 programs/network/icq/trunk/build_en.bat delete mode 100644 programs/network/icq/trunk/config.inc delete mode 100644 programs/network/icq/trunk/lang.inc delete mode 100644 programs/network/icq/trunk/macros.inc delete mode 100644 programs/network/icq/trunk/struct.inc diff --git a/programs/network/icq/trunk/build_en.bat b/programs/network/icq/trunk/build_en.bat new file mode 100644 index 0000000000..4dbfc75028 --- /dev/null +++ b/programs/network/icq/trunk/build_en.bat @@ -0,0 +1,5 @@ +@erase lang.inc +@echo lang fix en >lang.inc +@fasm ki.asm ki +@erase lang.inc +@pause \ No newline at end of file diff --git a/programs/network/icq/trunk/build_ru.bat b/programs/network/icq/trunk/build_ru.bat index 348c888209..3e8ceeff32 100644 --- a/programs/network/icq/trunk/build_ru.bat +++ b/programs/network/icq/trunk/build_ru.bat @@ -1,2 +1,5 @@ +@erase lang.inc +@echo lang fix ru >lang.inc @fasm ki.asm ki - +@erase lang.inc +@pause \ No newline at end of file diff --git a/programs/network/icq/trunk/config.inc b/programs/network/icq/trunk/config.inc deleted file mode 100644 index 4be62cc03b..0000000000 --- a/programs/network/icq/trunk/config.inc +++ /dev/null @@ -1 +0,0 @@ -__CPU_type fix p5 diff --git a/programs/network/icq/trunk/ki.asm b/programs/network/icq/trunk/ki.asm index 83fb5bbf39..6a018ad75a 100644 --- a/programs/network/icq/trunk/ki.asm +++ b/programs/network/icq/trunk/ki.asm @@ -8,7 +8,7 @@ ; <--- include all MeOS stuff ---> include "lang.inc" -include "MACROS.INC" +include "../../../macros.inc" purge mov ;include "ASCL9/ascl.inc" ;include "debug.inc" @@ -78,7 +78,7 @@ CODE mov eax, 2 ; get key code int 0x40 - cmp ah, 0Dh ; Пробел - отправить сообщение + cmp ah, 0Dh ; Пробел - отправить сообщение jz send @@ -92,13 +92,13 @@ CODE int 0x40 cmp ah, 2 - jz connect + jz connect cmp ah, 3 - jz disconnect + jz disconnect cmp ah, 4 - jz send + jz send ; ; Проверяем, не нажата ли кнопка в КЛ @@ -227,7 +227,7 @@ CODE ;cmp al, 20h ;jz sd_use_kl mov al, [inputbuff+3] - cmp al, 20h ; Пробел + cmp al, 20h ; Пробел jz sd_use_kl ; ; Ищем первый пробел, им должен закончиться уин @@ -238,7 +238,7 @@ CODE cmp al, 20h jz sd_space cmp al, 0 - jz wait_event + jz wait_event inc ecx jmp sd_loop @@ -259,7 +259,7 @@ CODE lea eax, [inputbuff+1] mov [inputbuff+3], byte 0 call ascitoint - lea eax, [eax-1] ; Т.к. в КЛ отсчет с 0 + lea eax, [eax-1] ; Т.к. в КЛ отсчет с 0 mov [curruser], al @@ -402,7 +402,7 @@ CODE ; rs_data_end: mov [hrf], 0 - write_debug 'Some data recived' + write_debug 'Some data received' ; ; ; @@ -432,7 +432,7 @@ CODE ; rs_big_flap: - write_debug 'Too BIG FLAP Recived' + write_debug 'Too BIG FLAP Received' mov [hrf], 0 mov ecx, [socket] @@ -465,14 +465,14 @@ CODE ; Соединение с сервером, возвращает в eax - хэндл сокета ; передаем в еах IP адрес сервера ; в ebx - порт - srv_connect: + srv_connect: push ecx push edx push esi push edi push ebx - mov esi, eax ; IP - в esi + mov esi, eax ; IP - в esi ; find free port mov ecx, 1000 ; Определяем локальный порт, начинаем с 1000 @@ -522,7 +522,7 @@ CODE ;cmp eax,-1 ;jnz fin ;delay 100 - write_debug 'CONNECTION FAILED' ;Подключение не удалось + write_debug 'CONNECTION FAILED' ;Подключение не удалось jmp @f ;connrcted: ;CONNECTED @@ -541,7 +541,7 @@ CODE ; --> ecx socket handle ; buff db 1024 dup 0 - lbuff db 8 dup 0 ; Для 1 пакета от сервера + lbuff db 8 dup 0 ; Для 1 пакета от сервера srv_login: pushf push eax @@ -567,7 +567,7 @@ CODE cmp eax, 4 jnz l_len_err mov eax, dword [mbuff] - cmp eax, 01000000h ; 00 00 00 01 + cmp eax, 01000000h ; 00 00 00 01 jnz l_data_err ; ;Формируем пакет для соединения @@ -580,7 +580,7 @@ CODE int 40h mov [seq], ax - mov [flap.wSn], ax ; Sequence number + mov [flap.wSn], ax ; Sequence number ;mov [buff],0 ;mov [buff+1],0 ;mov [buff+2],0 @@ -593,12 +593,12 @@ CODE mov [buff+6], ah mov [buff+7], al ; Length of UIN mov edx, eax - add edx, 7 ; в edx длина заполненного буфера + add edx, 7 ; в edx длина заполненного буфера - mov ecx, eax ;Длина строки + mov ecx, eax ;Длина строки mov eax, UIN - lea ebx, [buff+8] ; + размер данных в буфере + 1 + lea ebx, [buff+8] ; + размер данных в буфере + 1 call strcpy @@ -612,10 +612,10 @@ CODE add edx, 4 mov ebx, buff - add ebx, edx ; назначение - add edx, eax ; Сохраняем в EDX длину заполненного буфнра - mov ecx, eax ; Длина строки - mov eax, PASS ; Источник + add ebx, edx ; назначение + add edx, eax ; Сохраняем в EDX длину заполненного буфнра + mov ecx, eax ; Длина строки + mov eax, PASS ; Источник inc ebx call strcpy @@ -716,7 +716,7 @@ CODE mov ebx, buff call sendflap cmp eax, 0 - jnz l_fin ; Неуспех + jnz l_fin ; Неуспех jmp l_end @@ -735,9 +735,9 @@ CODE uin_loop: xor eax, eax mov ax, word [mbuff+ebx] - cmp ax, 0100h ; 00 01 TLV.Type UIN - jz l_uin_ok ; Теперь сервер передает еще данные при соединении, а потом опять - add ebx, 5 ; тот же TLV 1 + cmp ax, 0100h ; 00 01 TLV.Type UIN + jz l_uin_ok ; Теперь сервер передает еще данные при соединении, а потом опять + add ebx, 5 ; тот же TLV 1 cmp ebx, 5 ja l_tlvt_err jmp uin_loop @@ -749,8 +749,8 @@ CODE l_uin_ok: mov eax, ebx xor ebx, ebx - mov bl, [mbuff+eax+3] ; - mov bh, [mbuff+eax+2] ; Длина данных + mov bl, [mbuff+eax+3] ; + mov bh, [mbuff+eax+2] ; Длина данных ; ; UIN Пока не проверяется ; @@ -758,9 +758,9 @@ CODE lea ebx, [ebx+eax+4] mov ax, word [mbuff+ebx] - cmp ax, 0500h ; 00 05 Bos address + cmp ax, 0500h ; 00 05 Bos address jz l_all_ok - cmp ax, 0400h ; UIN incorrect + cmp ax, 0400h ; UIN incorrect jz l_uin_err cmp ax, 0800h jz l_pass_err @@ -771,8 +771,8 @@ CODE l_all_ok: xor ecx, ecx - mov cl, [mbuff+ebx+3] ;length - mov ch, [mbuff+ebx+2] ; + mov cl, [mbuff+ebx+3] ;length + mov ch, [mbuff+ebx+2] ; lea eax, [mbuff+ebx+4] push ebx @@ -780,7 +780,7 @@ CODE call strcpy pop ebx add ebx, ecx - lea ebx, [ebx+4] ; Размер заголовка + lea ebx, [ebx+4] ; Размер заголовка ; ; cookie ; @@ -788,17 +788,17 @@ CODE xor eax, eax mov ax, word [mbuff+ebx] - cmp ax, 0600h ; TLV.Type cookie + cmp ax, 0600h ; TLV.Type cookie jnz l_tlvt_err - mov cl, [mbuff+ebx+3] ; - mov ch, [mbuff+ebx+2] ; Length + mov cl, [mbuff+ebx+3] ; + mov ch, [mbuff+ebx+2] ; Length mov [cookie_len], cx lea eax, [mbuff+ebx+4] push ebx mov ebx, srv_cookie call strcpy pop ebx - + ; ; Соединяемся с BOS ; @@ -814,19 +814,19 @@ CODE - + mov eax, bos_address call ip_parser call htonl data_debug 'BOS Address: ', eax data_debug 'BOS Port: ', ebx - mov [bos_ip], eax + mov [bos_ip], eax mov [bos_port], ebx call srv_connect - mov [login], 1 ; Соединение с основным сервером установлено + mov [login], 1 ; Соединение с основным сервером установлено ;mov [socket], eax - + jmp l_end @@ -846,7 +846,7 @@ CODE jmp l_fin l_len_err: - write_debug 'RECIVED DATA LENGTH MISMATCH' + write_debug 'RECEIVED DATA LENGTH MISMATCH' jmp l_fin l_tlvt_err: @@ -858,7 +858,7 @@ CODE jmp l_fin l_flap_err: - write_debug 'FLAP ID MISMATCH / RECIVE ERROR' + write_debug 'FLAP ID MISMATCH / RECEIVE ERROR' l_fin: @@ -872,8 +872,8 @@ CODE ;pop ecx pop ebx pop eax - popf - ret + popf + ret ; ; Length of string @@ -890,7 +890,7 @@ CODE loop_s: mov cl, [eax+ebx] cmp ecx,0 - jz nl + jz nl inc ebx jmp loop_s @@ -916,7 +916,7 @@ CODE loop_r: mov bl, [eax+ecx] ;Символ из массива пароля - cmp bl, 0 ;Конец строки + cmp bl, 0 ;Конец строки jz r_fin xor bl, [ROASTING_ARRAY+ecx] @@ -1005,55 +1005,55 @@ CODE xor edx, edx - mov dl, [eax] ; ID byte + mov dl, [eax] ; ID byte mov [sbuff], dl - mov dl, [eax+1] ; FLAP channel + mov dl, [eax+1] ; FLAP channel mov [sbuff+1], dl - mov dl, [eax+2] ; FLAP datagramm seq number - mov [sbuff+3], dl ; меняем местами байты для передачи по сети + mov dl, [eax+2] ; FLAP datagramm seq number + mov [sbuff+3], dl ; меняем местами байты для передачи по сети mov dl, [eax+3] mov [sbuff+2], dl - mov dl, [eax+4] ; FLAP data size + mov dl, [eax+4] ; FLAP data size mov [sbuff+5], dl mov dl, [eax+5] mov [sbuff+4], dl mov dx, word [eax+4] - xchg ecx, edx ; ecx - size edx - handle - mov eax, ebx ; data - mov ebx, sbuff ; dest - add ebx, 6 ; + header size + xchg ecx, edx ; ecx - size edx - handle + mov eax, ebx ; data + mov ebx, sbuff ; dest + add ebx, 6 ; + header size call strcpy - xchg ecx, edx ; ecx - handle, edx - data size + xchg ecx, edx ; ecx - handle, edx - data size s_wait: - mov eax, 53 ; Проверяем состояние сокета. Если соедиение - mov ebx, 6 ; установлено - посылаем буфер, если сокет закрыт, уходим + mov eax, 53 ; Проверяем состояние сокета. Если соедиение + mov ebx, 6 ; установлено - посылаем буфер, если сокет закрыт, уходим int 40h cmp eax, TCB_ESTABLISHED ; установлено jz s_est cmp eax, TCB_CLOSED jz s_fin - cmp eax, 12 ; У меня такое было, когда соединение устанавливалось с пустотой :-) - jnc s_fin ; + cmp eax, 12 ; У меня такое было, когда соединение устанавливалось с пустотой :-) + jnc s_fin ; mov eax, 5 mov ebx, 1 - int 40h ; Ждем + int 40h ; Ждем jmp s_wait s_est: mov eax, 53 - mov ebx, 7 ; писать в сокет + mov ebx, 7 ; писать в сокет ;xchg ecx, edx ; ecx - handle, edx - data length - add edx, 6 ; + size of header - mov esi, sbuff ; data + add edx, 6 ; + size of header + mov esi, sbuff ; data int 40h s_fin: @@ -1273,7 +1273,7 @@ CODE push eax push ebx mov [flap.bId], FLAP_ID - mov [flap.bCh], 4 ;Disconnect + mov [flap.bCh], 4 ;Disconnect xor eax, eax mov ax, [seq] mov [flap.wSn], ax @@ -1339,34 +1339,34 @@ par_buff db 9 dup 0 ;data_debug 'Debug eax: ', eax - cmp ecx, 0 ; Не может начинаться с точки + cmp ecx, 0 ; Не может начинаться с точки jz ip_err - shl esi, 8 ; Сдвигаем предыдущий байт + shl esi, 8 ; Сдвигаем предыдущий байт add esi, eax inc ecx xor edx, edx ; Счетчик буфера = 0 jmp ip_loop - ip_colon: ; : В строке адреса - inc edi ; Было : + ip_colon: ; : В строке адреса + inc edi ; Было : jmp ip_dot ip_end_str: cmp edi, 1 jz @f - ; : Не было + ; : Не было mov [par_buff+edx], 0 ; Конец строки mov eax, par_buff call ascitoint - shl esi, 8 ; Сдвигаем предыдущий байт + shl esi, 8 ; Сдвигаем предыдущий байт add esi, eax ;mov eax, esi ; IP в 16 ричной форме ;xor ebx, ebx ; Номера порта нет jmp ip_end - @@: ; Было : - mov [par_buff+edx], 0 + @@: ; Было : + mov [par_buff+edx], 0 mov eax, par_buff call ascitoint mov ebx, eax @@ -1405,10 +1405,10 @@ par_buff db 9 dup 0 ati_loop: mov bl, [eax+ecx] - cmp bl, 0 ; Конец строки + cmp bl, 0 ; Конец строки jz ati_str_end cmp bl, 39h - ja ati_err ; Не цифра + ja ati_err ; Не цифра cmp bl, 30h jb ati_err @@ -1424,7 +1424,7 @@ par_buff db 9 dup 0 cmp edx, ecx jz ati_all push eax - sub eax, edx ; Вычесть счетчик + sub eax, edx ; Вычесть счетчик movzx ebx, byte [eax] ; В bl символ ;pop eax sub bl, 30h ; Вычисляем 10тичную цифру @@ -1492,50 +1492,50 @@ snac_buff db 1024 dup 0 push ebx push edx ;xor ebx, ebx - mov esi, ecx ; хендл сокета - mov edi, ebx ; Указатель на данные + mov esi, ecx ; хендл сокета + mov edi, ebx ; Указатель на данные xor ebx, ebx - mov bl, [eax] ; + mov bl, [eax] ; mov [snac_buff+1], bl ; Family ID - mov bl, [eax+1] ; Конвертируется в BigEndian + mov bl, [eax+1] ; Конвертируется в BigEndian mov [snac_buff], bl ; - mov bl, [eax+2] ; + mov bl, [eax+2] ; mov [snac_buff+3], bl ; Subtype ID - mov bl, [eax+3] ; + mov bl, [eax+3] ; mov [snac_buff+2], bl ; - mov bl, [eax+4] ; + mov bl, [eax+4] ; mov [snac_buff+5], bl ; - mov bl, [eax+5] ; Flags + mov bl, [eax+5] ; Flags mov [snac_buff+4], bl ; - mov bl, [eax+6] ; + mov bl, [eax+6] ; mov [snac_buff+9], bl ; - mov bl, [eax+7] ; + mov bl, [eax+7] ; mov [snac_buff+8], bl ; - mov bl, [eax+8] ; Reqest ID + mov bl, [eax+8] ; Reqest ID mov [snac_buff+7], bl ; - mov bl, [eax+9] ; + mov bl, [eax+9] ; mov [snac_buff+6], bl ; - lea ebx, [snac_buff+10] + lea ebx, [snac_buff+10] - mov eax, edi ; Указатель на данные + mov eax, edi ; Указатель на данные ;add ebx, 10 ; + размер заголовка SNAC - mov ecx, edx ; размер данных + mov ecx, edx ; размер данных call strcpy - mov ecx, esi ; Хендл сокета + mov ecx, esi ; Хендл сокета mov [flap.bId], FLAP_ID - mov [flap.bCh], 2 ; Канал для посылки SNAC + mov [flap.bCh], 2 ; Канал для посылки SNAC xor ebx, ebx - inc [seq] ; seq Увеличивается на 1 при каждой посылке + inc [seq] ; seq Увеличивается на 1 при каждой посылке mov bx, [seq] mov [flap.wSn], bx - add edx, 10 ; размер данных + размер заголовка SNAC + add edx, 10 ; размер данных + размер заголовка SNAC mov [flap.wDs], dx mov eax, flap mov ebx, snac_buff @@ -1594,21 +1594,21 @@ snac_buff db 1024 dup 0 ; xor ebx, ebx mov bl, [rflap.bCh] - cmp bl, 1 ; Установка соединения - jz m_login + cmp bl, 1 ; Установка соединения + jz m_login cmp bl, 2 - jz m_snac ; Получен SNAC + jz m_snac ; Получен SNAC cmp bl, 3 - jz m_flap_err ; FLAP-level error + jz m_flap_err ; FLAP-level error cmp bl, 4 - jz m_close_conn ; Закрытие соединения + jz m_close_conn ; Закрытие соединения cmp bl, 5 - jz m_keep_alive ; + jz m_keep_alive ; ; ; Обработка рассоединения ; m_close_conn: - write_debug 'Another Computer Use YOUR UIN!' + write_debug 'Another Computer is Useing YOUR UIN!' call srv_disconnect call closesocket jmp m_fin @@ -1622,7 +1622,7 @@ snac_buff db 1024 dup 0 xor eax, eax mov al, [mbuff+3] cmp eax, 1 - jnz m_login_other ; Не подходит + jnz m_login_other ; Не подходит ; @@ -1640,23 +1640,23 @@ snac_buff db 1024 dup 0 mov [flap.wSn], ax xor eax, eax mov ax, [cookie_len] - add eax, 8 ; TLV len + protocol version len + add eax, 8 ; TLV len + protocol version len mov [flap.wDs], ax mov dword [buff], 01000000h ; 00 00 00 01 Номер протокола - mov word [buff+4], 0600h ; 00 06 TLV.Type + mov word [buff+4], 0600h ; 00 06 TLV.Type mov ax, [cookie_len] - mov [buff+6], ah ; - mov [buff+7], al ; TLV.Length + mov [buff+6], ah ; + mov [buff+7], al ; TLV.Length - mov edx, ecx ; edx <-- socket handle + mov edx, ecx ; edx <-- socket handle - mov ecx, eax ; ecx <-- cookie len - mov eax, srv_cookie ; Src + mov ecx, eax ; ecx <-- cookie len + mov eax, srv_cookie ; Src lea ebx, [buff+8] call strcpy - mov ecx, edx ; ecx <-- socket handle + mov ecx, edx ; ecx <-- socket handle mov eax, flap mov ebx, buff call sendflap @@ -1692,19 +1692,19 @@ snac_buff db 1024 dup 0 mov dx, [rsnac.wSid] cmp bx, 1 - jz m_snac_1 ;Generic service controls + jz m_snac_1 ;Generic service controls cmp bx, 2 - jz m_snac_2 ;Location services + jz m_snac_2 ;Location services cmp bx, 3 - jz m_snac_3 ;Buddy List management service + jz m_snac_3 ;Buddy List management service cmp bx, 4 - jz m_snac_4 ;ICBM (messages) service + jz m_snac_4 ;ICBM (messages) service cmp bx, 9 - jz m_snac_9 ;Privacy management service + jz m_snac_9 ;Privacy management service cmp bx, 015h - jz m_snac_15 ;ICQ specific extensions service + jz m_snac_15 ;ICQ specific extensions service cmp bx, 013h - jz m_snac_13 ;Server Side Information (SSI) service + jz m_snac_13 ;Server Side Information (SSI) service jmp m_other_snac ; @@ -1727,7 +1727,7 @@ snac_buff db 1024 dup 0 ; ; Rate limits information response ; - m_snac_1_7: ; Отвечаем + m_snac_1_7: ; Отвечаем mov [ssnac.wFid], 1 ; Family mov [ssnac.wSid], 8 ; Subtype mov [ssnac.dRi], 8 @@ -1738,7 +1738,7 @@ snac_buff db 1024 dup 0 mov word [buff+8], 0500h ; 0005 mov eax, ssnac mov ebx, buff - mov edx, 10 ; Размер данных + mov edx, 10 ; Размер данных call sendsnac ; ; Client ask server location service limitations @@ -1762,7 +1762,7 @@ snac_buff db 1024 dup 0 ; ; - ; SNAC(01,17) + ; SNAC(01,17) ; Client ask for services version numbers ; mov [ssnac.wFid], 1 ; Family @@ -1771,9 +1771,9 @@ snac_buff db 1024 dup 0 ; ; Список сервисов, которые нам нужны ; - ; xx xx word family number #1 - ; xx xx word family version - ; ... ... ... + ; xx xx word family number #1 + ; xx xx word family version + ; ... ... ... ; ; @@ -1881,7 +1881,7 @@ snac_buff db 1024 dup 0 m_snac_1_other: - data_debug 'Unknown SNAC Family 1 recived, type ', edx + data_debug 'Unknown SNAC Family 1 received, type ', edx jmp m_fin @@ -1934,7 +1934,7 @@ snac_buff db 1024 dup 0 mov eax, ssnac mov ebx, buff - mov edx, C_LEN+4 ; Длина данных+размер заголовка TLV + mov edx, C_LEN+4 ; Длина данных+размер заголовка TLV call sendsnac ; @@ -1982,7 +1982,7 @@ snac_buff db 1024 dup 0 ; mov [ssnac.wFid], 4 ; Family mov [ssnac.wSid], 4 ; Subtype - mov [ssnac.dRi], 4 ; request-id + mov [ssnac.dRi], 4 ; request-id mov eax, ssnac mov ebx, buff xor edx, edx @@ -1999,18 +1999,18 @@ snac_buff db 1024 dup 0 ; ; Из всей информации пока нужен только статус ; - xor edx, edx ; Счетчик + xor edx, edx ; Счетчик xor ecx, ecx xor eax, eax - cld ; В направлении увеличения адресов + cld ; В направлении увеличения адресов dec edx m_snac_3_b_loop: inc edx cmp edx, UINS - jnc m_snac_3_b_end ;>= + jnc m_snac_3_b_end ;>= - mov cl, [mbuff+10] ; Длина УИН + mov cl, [mbuff+10] ; Длина УИН mov eax, ecx mov edi, UIN_LEN imul edi ,edx @@ -2023,11 +2023,11 @@ snac_buff db 1024 dup 0 ; UIN Определен ; - lea ecx, [eax+10+11] ; +sizeof SNAC_head + offset #2 TLV - mov ax, word [mbuff+ecx] ;#2 TLV.Type - cmp ax, 0C00h ;dc info (optional) + lea ecx, [eax+10+11] ; +sizeof SNAC_head + offset #2 TLV + mov ax, word [mbuff+ecx] ;#2 TLV.Type + cmp ax, 0C00h ;dc info (optional) jz m_snac_3_b_dc - cmp ax, 0A00h ;external ip address + cmp ax, 0A00h ;external ip address jz m_snac_3_b_extip jmp m_snac_3_b_bad_tlv @@ -2042,7 +2042,7 @@ snac_buff db 1024 dup 0 ; И этот :-) lea ecx, [ecx+8] mov ax, word [mbuff+ecx] - cmp ax, 0600h ;TLV.Type(0x0A) - external ip address + cmp ax, 0600h ;TLV.Type(0x0A) - external ip address jz m_snac_3_b_status jmp m_snac_3_b_bad_tlv @@ -2085,9 +2085,9 @@ snac_buff db 1024 dup 0 m_snac_3_c_loop: inc edx cmp edx, UINS - jnc m_snac_3_b_end ;>= + jnc m_snac_3_b_end ;>= - mov cl, [mbuff+10] ; Длина УИН + mov cl, [mbuff+10] ; Длина УИН mov edi, UIN_LEN imul edi ,edx lea edi, [uins+edi] @@ -2115,7 +2115,7 @@ snac_buff db 1024 dup 0 m_snac_3_other: - write_debug 'Unknown SNAC Family 3 Recived' + write_debug 'Unknown SNAC Family 3 Received' jmp m_fin @@ -2142,7 +2142,7 @@ snac_buff db 1024 dup 0 ; mov [ssnac.wFid], 4 ; Family mov [ssnac.wSid], 2 ; Subtype - mov [ssnac.dRi], 2 ; request-id + mov [ssnac.dRi], 2 ; request-id mov eax, ICBM_PARAMS mov ebx, buff @@ -2161,7 +2161,7 @@ snac_buff db 1024 dup 0 ; mov [ssnac.wFid], 9 ; Family mov [ssnac.wSid], 2 ; Subtype - mov [ssnac.dRi], 2 ; request-id + mov [ssnac.dRi], 2 ; request-id mov eax, ssnac mov ebx, buff xor edx, edx @@ -2178,9 +2178,9 @@ snac_buff db 1024 dup 0 ; Определяем тип сообщения по полю message channel ; xor eax, eax - mov ax, word [mbuff+10+8] ; +10 - размер SNAC - ; +8 смещение до message channel - cmp ax, 0100h ; 00 01 + mov ax, word [mbuff+10+8] ; +10 - размер SNAC + ; +8 смещение до message channel + cmp ax, 0100h ; 00 01 jz m_snac_ch1 cmp ax, 0200h jz m_snac_ch2 @@ -2195,42 +2195,42 @@ snac_buff db 1024 dup 0 ; Т.к в очередной раз описание протокола не совпадает с реальностью ; разбираем все TLV по порядку - mov eax, dword [mbuff+10] ; cookie + mov eax, dword [mbuff+10] ; cookie mov [msg_cookie1], eax mov eax, dword [mbuff+10+4] - mov [msg_cookie2], eax ; Используются для потверждения приема сообщений + mov [msg_cookie2], eax ; Используются для потверждения приема сообщений - mov al, [mbuff+10+10] ; Sender UIN length + mov al, [mbuff+10+10] ; Sender UIN length mov [ui.bUinLength], al push ecx movzx ecx, al - lea eax, [mbuff+10+11] ; UIN string - lea ebx, [ui.bUin] ; Dest + lea eax, [mbuff+10+11] ; UIN string + lea ebx, [ui.bUin] ; Dest call strcpy - lea ecx, [ecx+10+15] ; первый TLV + lea ecx, [ecx+10+15] ; первый TLV m_snac_ch1_loop: movzx eax, word [mbuff+ecx] - cmp eax, 0100h ;TLV.Type(0x01) - user class + cmp eax, 0100h ;TLV.Type(0x01) - user class jz m_snac_ch1_1 - cmp eax, 0600h ;TLV.Type(0x06) - user status + cmp eax, 0600h ;TLV.Type(0x06) - user status jz m_snac_ch1_6 - cmp eax, 0800h ; Unknown type + cmp eax, 0800h ; Unknown type jz m_snac_ch1_8 - cmp eax, 0500h ; Unknown type + cmp eax, 0500h ; Unknown type jz m_snac_ch1_5 - cmp eax, 0F00h ; TLV.Type(0x0f) - user idle time + cmp eax, 0F00h ; TLV.Type(0x0f) - user idle time jz m_snac_ch1_f - cmp eax, 0300h ; TLV.Type(0x03) - account creation time + cmp eax, 0300h ; TLV.Type(0x03) - account creation time jz m_snac_ch1_3 - cmp eax, 0400h ; TLV.Type(0x04) - automated response flag + cmp eax, 0400h ; TLV.Type(0x04) - automated response flag jz m_snac_ch1_4 - cmp eax, 0200h ; TLV.Type(0x02) - message data + cmp eax, 0200h ; TLV.Type(0x02) - message data jz m_snac_ch1_mess jmp m_snac_msg_tlv_err @@ -2239,19 +2239,19 @@ snac_buff db 1024 dup 0 ; но пока нет m_snac_ch1_1: - movzx eax, word [mbuff+ecx+2] ; TLV.Length + movzx eax, word [mbuff+ecx+2] ; TLV.Length call ntohs lea ecx, [eax+ecx+4] jmp m_snac_ch1_loop m_snac_ch1_6: - mov eax, dword [mbuff+ecx+4] ; User status + mov eax, dword [mbuff+ecx+4] ; User status call ntohl mov [ui.dUserStatus], eax - movzx eax, word [mbuff+ecx+2] ; TLV.Length + movzx eax, word [mbuff+ecx+2] ; TLV.Length call ntohs lea ecx, [eax+ecx+4] ; @@ -2261,25 +2261,25 @@ snac_buff db 1024 dup 0 jmp m_snac_ch1_loop m_snac_ch1_8: - movzx eax, word [mbuff+ecx+2] ; TLV.Length + movzx eax, word [mbuff+ecx+2] ; TLV.Length call ntohs lea ecx, [eax+ecx+4] jmp m_snac_ch1_loop m_snac_ch1_5: - movzx eax, word [mbuff+ecx+2] ; TLV.Length + movzx eax, word [mbuff+ecx+2] ; TLV.Length call ntohs lea ecx, [eax+ecx+4] jmp m_snac_ch1_loop m_snac_ch1_f: - movzx eax, word [mbuff+ecx+2] ; TLV.Length + movzx eax, word [mbuff+ecx+2] ; TLV.Length call ntohs lea ecx, [eax+ecx+4] jmp m_snac_ch1_loop m_snac_ch1_3: - movzx eax, word [mbuff+ecx+2] ; TLV.Length + movzx eax, word [mbuff+ecx+2] ; TLV.Length call ntohs lea ecx, [eax+ecx+4] jmp m_snac_ch1_loop @@ -2296,24 +2296,24 @@ snac_buff db 1024 dup 0 ; ; movzx eax, word [mbuff+ecx+4] ; - cmp eax, 0105h ; 05 fragment identifier (array of required capabilities) - jnz m_snac_ch1_fr_err ; 01 fragment version + cmp eax, 0105h ; 05 fragment identifier (array of required capabilities) + jnz m_snac_ch1_fr_err ; 01 fragment version movzx eax, word [mbuff+ecx+6] ; Length call ntohs - lea ecx, [ecx+eax+8] ; Пропускаем byte array of required capabilities (1 - text) + lea ecx, [ecx+eax+8] ; Пропускаем byte array of required capabilities (1 - text) - movzx eax, word [mbuff+ecx] ; fragment identifier (message text) - cmp eax, 0101h ; fragment version + movzx eax, word [mbuff+ecx] ; fragment identifier (message text) + cmp eax, 0101h ; fragment version jnz m_snac_ch1_fr_err movzx eax, word [mbuff+ecx+2] ; TLV Length call ntohs xchg eax, ecx - lea eax, [eax+8] ; Начало текстового сообщения - lea ecx, [ecx-4] ; - sizeof Message charset number, Message charset subset + lea eax, [eax+8] ; Начало текстового сообщения + lea ecx, [ecx-4] ; - sizeof Message charset number, Message charset subset push eax push ecx @@ -2394,14 +2394,14 @@ snac_buff db 1024 dup 0 mov eax, dword [mbuff+10+4] mov [msg_cookie2], eax - mov al, [mbuff+10+10] ; Sender UIN length + mov al, [mbuff+10+10] ; Sender UIN length mov [ui.bUinLength], al push ecx movzx ecx, al - lea eax, [mbuff+10+11] ; UIN string - lea ebx, [ui.bUin] ; Dest + lea eax, [mbuff+10+11] ; UIN string + lea ebx, [ui.bUin] ; Dest call strcpy @@ -2413,7 +2413,7 @@ snac_buff db 1024 dup 0 mov dword [buff], eax mov eax, [msg_cookie2] mov dword [buff+4], eax - mov word [buff+8], 0200h ; Channel 2 + mov word [buff+8], 0200h ; Channel 2 mov al, [ui.bUinLength] mov [buff+10], al @@ -2422,7 +2422,7 @@ snac_buff db 1024 dup 0 call strcpy lea ecx, [ecx+11] - mov word [buff+ecx], 0100h ; reason code (1 - unsupported channel, 2 - busted payload, 3 - channel specific) + mov word [buff+ecx], 0100h ; reason code (1 - unsupported channel, 2 - busted payload, 3 - channel specific) mov edx, ecx pop ecx @@ -2447,7 +2447,7 @@ snac_buff db 1024 dup 0 m_snac_4_other: - write_debug 'Unknown SNAC Family 4 recived' + write_debug 'Unknown SNAC Family 4 received' jmp m_fin @@ -2496,7 +2496,7 @@ snac_buff db 1024 dup 0 mov eax, ssnac mov ebx, buff - xor edx, edx ; TLV head len + xor edx, edx ; TLV head len call sendsnac @@ -2507,10 +2507,10 @@ snac_buff db 1024 dup 0 mov [ssnac.wSid], 1Eh ; Subtype mov [ssnac.dRi], 1Eh ; request-id - mov [buff], 0 ; TLV type 06 - mov [buff+1], 6h ; - mov [buff+2], 0 ; TLV data length - mov [buff+3], 4 ; + mov [buff], 0 ; TLV type 06 + mov [buff+1], 6h ; + mov [buff+2], 0 ; TLV data length + mov [buff+3], 4 ; ; ; mov ax, STATUS_DCDISABLED ; DC disabled @@ -2522,7 +2522,7 @@ snac_buff db 1024 dup 0 mov eax, ssnac mov ebx, buff - mov edx, 8 ; TLV head len+ data len + mov edx, 8 ; TLV head len+ data len call sendsnac @@ -2562,12 +2562,12 @@ snac_buff db 1024 dup 0 call ascitoint mov dword [buff+6], eax - mov word [buff+12], 0102h ; request sequence number (incrementing) - mov word [buff+14], 0424h ; META_SET_PERMS_USERINFO - mov [buff+16], 1 ; authorization (1-required, 0-not required) - mov [buff+17], byte 0 ; webaware (0-no, 1-yes) - mov [buff+18], 1 ; dc_perms (0-any, 1-contact, 2-authorization) - mov [buff+19], 0 ;unknown + mov word [buff+12], 0102h ; request sequence number (incrementing) + mov word [buff+14], 0424h ; META_SET_PERMS_USERINFO + mov [buff+16], 1 ; authorization (1-required, 0-not required) + mov [buff+17], byte 0 ; webaware (0-no, 1-yes) + mov [buff+18], 1 ; dc_perms (0-any, 1-contact, 2-authorization) + mov [buff+19], 0 ;unknown mov eax, ssnac mov ebx, buff @@ -2579,7 +2579,7 @@ snac_buff db 1024 dup 0 ; mov [ssnac.wFid], 1 ; Family mov [ssnac.wSid], 2 ; Subtype - mov [ssnac.dRi], 2 ; request-id + mov [ssnac.dRi], 2 ; request-id mov eax, FAMILY_ARR mov ebx, buff @@ -2599,11 +2599,11 @@ snac_buff db 1024 dup 0 ; mov [ssnac.wFid], 15h ; Family mov [ssnac.wSid], 2 ; Subtype - mov [ssnac.dRi], 2 ; request-id + mov [ssnac.dRi], 2 ; request-id - mov word [buff], 0100h ; TLV type 01 - mov word [buff+2], 0A00h ; 00 0a Длина - mov word [buff+4], 0008h ; 08 00 + mov word [buff], 0100h ; TLV type 01 + mov word [buff+2], 0A00h ; 00 0a Длина + mov word [buff+4], 0008h ; 08 00 mov eax, UIN call ascitoint mov dword [buff+6], eax @@ -2631,7 +2631,7 @@ snac_buff db 1024 dup 0 jmp m_fin m_snac_9_other: - write_debug 'Unknown SNAC Family 9 Recived' + write_debug 'Unknown SNAC Family 9 Received' jmp m_fin @@ -2655,20 +2655,20 @@ snac_buff db 1024 dup 0 ; ; - ; SNAC(13,05) Client check if its local SSI copy is up-to-date + ; SNAC(13,05) Client check if its local SSI copy is up-to-date ; mov [ssnac.wFid], 13h ; Family mov [ssnac.wSid], 5 ; Subtype - mov [ssnac.dRi], 5 ; request-id + mov [ssnac.dRi], 5 ; request-id mov eax, ssnac ; 3D E7 48 17 - mov [buff], 03Dh ; - mov [buff+1], 0E7h ; modification date/time of client local SSI copy - mov [buff+2], 48h ; - mov [buff+3], 17h ; + mov [buff], 03Dh ; + mov [buff+1], 0E7h ; modification date/time of client local SSI copy + mov [buff+2], 48h ; + mov [buff+3], 17h ; ; 00 10 - mov [buff+4], 00 ; - mov [buff+5], 10h ; number of items in client local SSI copy + mov [buff+4], 00 ; + mov [buff+5], 10h ; number of items in client local SSI copy mov ebx, buff mov edx, 5 @@ -2689,7 +2689,7 @@ snac_buff db 1024 dup 0 ; mov [ssnac.wFid], 13h ; Family mov [ssnac.wSid], 7 ; Subtype - mov [ssnac.dRi], 7 ; request-id + mov [ssnac.dRi], 7 ; request-id mov eax, ssnac mov ebx, buff xor edx, edx @@ -2706,10 +2706,10 @@ snac_buff db 1024 dup 0 mov [ssnac.wSid], 1Eh ; Subtype mov [ssnac.dRi], 1Eh ; request-id - mov [buff], 0 ; TLV type 06 - mov [buff+1], 6h ; - mov [buff+2], 0 ; TLV data length - mov [buff+3], 4 ; + mov [buff], 0 ; TLV type 06 + mov [buff+1], 6h ; + mov [buff+2], 0 ; TLV data length + mov [buff+3], 4 ; ; ; mov ax, STATUS_DCDISABLED ; DC disabled @@ -2721,7 +2721,7 @@ snac_buff db 1024 dup 0 mov eax, ssnac mov ebx, buff - mov edx, 8 ; TLV head len+ data len + mov edx, 8 ; TLV head len+ data len call sendsnac ; @@ -2729,7 +2729,7 @@ snac_buff db 1024 dup 0 ; mov [ssnac.wFid], 1 ; Family mov [ssnac.wSid], 2 ; Subtype - mov [ssnac.dRi], 2 ; request-id + mov [ssnac.dRi], 2 ; request-id mov eax, FAMILY_ARR mov ebx, buff @@ -2749,11 +2749,11 @@ snac_buff db 1024 dup 0 ; mov [ssnac.wFid], 15h ; Family mov [ssnac.wSid], 2 ; Subtype - mov [ssnac.dRi], 2 ; request-id + mov [ssnac.dRi], 2 ; request-id - mov word [buff], 0100h ; TLV type 01 - mov word [buff+2], 0A00h ; 00 0a Длина - mov word [buff+4], 0008h ; 08 00 + mov word [buff], 0100h ; TLV type 01 + mov word [buff+2], 0A00h ; 00 0a Длина + mov word [buff+4], 0008h ; 08 00 mov eax, UIN call ascitoint mov dword [buff+6], eax @@ -2772,7 +2772,7 @@ snac_buff db 1024 dup 0 jmp m_fin m_snac_13_other: - write_debug 'Unknown SNAC Family 13 Recived' + write_debug 'Unknown SNAC Family 13 Received' jmp m_fin @@ -2802,13 +2802,13 @@ snac_buff db 1024 dup 0 xor eax, eax mov ax, word [mbuff+10] ; + SNAC.head size - cmp ax, 0100h ; 00 01 TLV type + cmp ax, 0100h ; 00 01 TLV type jnz m_snac_tlv_err mov ax, word [mbuff+10+10] - cmp ax, 0041h ; Offline Message + cmp ax, 0041h ; Offline Message jz m_snac_offline_mes - cmp ax, 0042h ; End messages + cmp ax, 0042h ; End messages jz m_snac_offline_end cmp ax, 07DAh jz m_snac_meta_data @@ -2818,24 +2818,24 @@ snac_buff db 1024 dup 0 jmp m_fin m_snac_offline_mes: - mov eax, MESS ; - call strlen ; Выводим строку с сообщением о отправителе и времени отправки - push ecx ; - mov ecx, eax ; + mov eax, MESS ; + call strlen ; Выводим строку с сообщением о отправителе и времени отправки + push ecx ; + mov ecx, eax ; mov eax, MESS mov ebx, buff call strcpy - mov eax, dword [mbuff+14+10] ; Sender UIN - lea ebx, [buff+ecx] ; После строчки о сообщении + mov eax, dword [mbuff+14+10] ; Sender UIN + lea ebx, [buff+ecx] ; После строчки о сообщении call int2strd lea ebx, [ebx+eax] mov [ebx], byte ' ' inc ebx - ; + Длина UIN - movzx eax, byte [mbuff+21+10] ; Day + ; + Длина UIN + movzx eax, byte [mbuff+21+10] ; Day call int2strd lea ebx, [ebx+eax] @@ -2843,34 +2843,34 @@ snac_buff db 1024 dup 0 inc ebx - movzx eax, byte [mbuff+20+10] ;Mounth + movzx eax, byte [mbuff+20+10] ;Mounth call int2strd lea ebx, [ebx+eax] mov [ebx], byte ' ' inc ebx - movzx eax, [mbuff+22+10] ; Hour + movzx eax, [mbuff+22+10] ; Hour call int2strd lea ebx, [ebx+eax] mov [ebx], byte ':' inc ebx - movzx eax, [mbuff+23+10] ; Minute + movzx eax, [mbuff+23+10] ; Minute call int2strd lea ebx, [ebx+eax] ;mov [ebx], byte ' ' ;inc ebx - mov [ebx], byte 0 ; Str end + mov [ebx], byte 0 ; Str end mov eax, buff xor ebx, ebx call writemsg - movzx ecx, word [mbuff+26+10] ; Длина соообщения + movzx ecx, word [mbuff+26+10] ; Длина соообщения lea eax, [mbuff+28+10] mov ebx, buff call strcpy @@ -2878,9 +2878,9 @@ snac_buff db 1024 dup 0 mov [ebx+ecx], byte 0 mov eax, buff - call win2dos ;перекодируем + call win2dos ;перекодируем - mov ebx, 00FF0000h ;Цвет + mov ebx, 00FF0000h ;Цвет call writemsg @@ -2898,16 +2898,16 @@ snac_buff db 1024 dup 0 mov [ssnac.wSid], 2 ; Subtype mov [ssnac.dRi], 0602h ; request-id - mov word [buff], 0100h ; 00 01 TLV.Type(1) - encapsulated META_DATA1 - mov word [buff+2], 0A00h ; 00 0A TLV.Length - mov word [buff+4], 0008h ; 08 00 data chunk size (TLV.Length-2) + mov word [buff], 0100h ; 00 01 TLV.Type(1) - encapsulated META_DATA1 + mov word [buff+2], 0A00h ; 00 0A TLV.Length + mov word [buff+4], 0008h ; 08 00 data chunk size (TLV.Length-2) mov eax, UIN call ascitoint mov dword [buff+6], eax ; xx xx xx xx (LE) client uin - mov word [buff+10], 003Eh ; 3E 00 (LE) data type: delete offline msgs request cmd - mov word [buff+12], 0007h ; xx xx (LE) request sequence number + mov word [buff+10], 003Eh ; 3E 00 (LE) data type: delete offline msgs request cmd + mov word [buff+12], 0007h ; xx xx (LE) request sequence number - mov edx, 14 ; Размер данных + mov edx, 14 ; Размер данных mov eax, ssnac mov ebx, buff call sendsnac @@ -2924,10 +2924,10 @@ snac_buff db 1024 dup 0 ; Определяем очередной подтип :-) ; mov ax, word [mbuff+10+14] - cmp ax, 0104h ;data subtype: META_SHORT_USERINFO + cmp ax, 0104h ;data subtype: META_SHORT_USERINFO jz m_snac_short_userinfo cmp ax, 00C8h - jz m_snac_basic_userinfo ;data subtype: META_BASIC_USERINFO + jz m_snac_basic_userinfo ;data subtype: META_BASIC_USERINFO write_debug 'Unknown META DATA subtype' jmp m_fin @@ -2938,13 +2938,13 @@ snac_buff db 1024 dup 0 ; Из всей информации пока нужен только ник ; mov al, [mbuff+10+16] - cmp al, 0Ah ;success byte + cmp al, 0Ah ;success byte jnz m_fin movzx eax, word [mbuff+10+12] ;request sequence number ; ; В запросе я использовал порядковый номер юзера в КЛ - lea ebx, [mbuff+10+19] ;nickname string + lea ebx, [mbuff+10+19] ;nickname string ; Длина строки не нужна, т.к. строка Null-Terminated ;Определяем статус mov ecx, 4 @@ -2963,13 +2963,13 @@ snac_buff db 1024 dup 0 ; m_snac_basic_userinfo: mov al, [mbuff+10+16] - cmp al, 0Ah ;success byte + cmp al, 0Ah ;success byte jnz m_fin movzx eax, word [mbuff+10+12] ;request sequence number ; ; В запросе я использовал порядковый номер юзера в КЛ - lea ebx, [mbuff+10+19] ;nickname string + lea ebx, [mbuff+10+19] ;nickname string ; Длина строки не нужна, т.к. строка Null-Terminated ;Определяем статус mov ecx, 4 @@ -2990,13 +2990,13 @@ snac_buff db 1024 dup 0 m_snac_15_other: - write_debug 'Unknown SNAC Family 15 Recived' + write_debug 'Unknown SNAC Family 15 Received' jmp m_fin m_other_snac: - write_debug 'Unknown SNAC recived' + write_debug 'Unknown SNAC received' jmp m_fin @@ -3069,26 +3069,26 @@ snac_buff db 1024 dup 0 push ecx ;push edx - mov cl, [ebx+1] ; Family (service) id number младший байт - mov ch, [ebx] ; старший + mov cl, [ebx+1] ; Family (service) id number младший байт + mov ch, [ebx] ; старший mov word [eax], cx - mov cl, [ebx+3] ; Family subtype id number - mov ch, [ebx+2] ; + mov cl, [ebx+3] ; Family subtype id number + mov ch, [ebx+2] ; mov word [eax+2], cx - mov cl, [ebx+5] ; SNAC flags - mov ch, [ebx+4] ; + mov cl, [ebx+5] ; SNAC flags + mov ch, [ebx+4] ; mov word [eax+4], cx ; - - mov cl, [ebx+7] ; - mov ch, [ebx+6] ; + + mov cl, [ebx+7] ; + mov ch, [ebx+6] ; mov word [eax+8], cx ; SNAC request id - mov cl, [ebx+8] ; - mov ch, [ebx+7] ; + mov cl, [ebx+8] ; + mov ch, [ebx+7] ; mov word [eax+6], cx ; - add ebx, 10 ;Размер заголовка + add ebx, 10 ;Размер заголовка mov eax, ebx @@ -3151,58 +3151,58 @@ snac_buff db 1024 dup 0 call strcpy lea ecx, [ecx+11] - mov word [buff+ecx], 0200h ; TLV.Type(0x02) - message data + mov word [buff+ecx], 0200h ; TLV.Type(0x02) - message data ;push ecx ; - ; TLV.Length + ; TLV.Length - mov word [buff+ecx+4], 0105h ; 05 01 01 - fragment version, 05 - fragment identifier + mov word [buff+ecx+4], 0105h ; 05 01 01 - fragment version, 05 - fragment identifier - mov word [buff+ecx+6], 0100h ; data length + mov word [buff+ecx+6], 0100h ; data length - mov [buff+ecx+8], 01 ; byte array of required capabilities (1 - text) + mov [buff+ecx+8], 01 ; byte array of required capabilities (1 - text) - mov [buff+ecx+9], 01 ; fragment identifier (text message) - mov [buff+ecx+10], 01 ; fragment version + mov [buff+ecx+9], 01 ; fragment identifier (text message) + mov [buff+ecx+10], 01 ; fragment version pop ebx mov eax, ebx call strlen mov edx, eax - lea eax, [eax+4] ; Длина сообщения + Message charset number+ Message language number + lea eax, [eax+4] ; Длина сообщения + Message charset number+ Message language number call htons mov word [buff+ecx+11], ax mov eax, edx - lea eax, [eax+13] ; + длина служебных данных + lea eax, [eax+13] ; + длина служебных данных call htons mov word [buff+ecx+2], ax - mov word [buff+ecx+13], 0700h ; Message charset number - mov word [buff+ecx+15], 0300h ; Message language number + mov word [buff+ecx+13], 0700h ; Message charset number + mov word [buff+ecx+15], 0300h ; Message language number mov eax, ecx - mov ecx, edx ; Len + mov ecx, edx ; Len lea edx, [eax+17] - mov eax, ebx ;Source + mov eax, ebx ;Source - lea ebx, [buff+edx] ;Dest + lea ebx, [buff+edx] ;Dest call strcpy - lea ecx, [ecx+edx] ; +String length + lea ecx, [ecx+edx] ; +String length mov [buff+ecx], byte 0 mov eax, ebx call dos2win - mov word [buff+ecx], 0600h ; TLV.Type(0x06) - store message if recipient offline - mov word [buff+ecx+2], 0 ; TLV.Length + mov word [buff+ecx], 0600h ; TLV.Type(0x06) - store message if recipient offline + mov word [buff+ecx+2], 0 ; TLV.Length - lea edx, [ecx+4] ; +TLV_head length + lea edx, [ecx+4] ; +TLV_head length mov eax, ssnac mov ebx, buff mov ecx, [socket] @@ -3228,30 +3228,30 @@ snac_buff db 1024 dup 0 mov [ssnac.wSid], 2 ; Subtype mov [ssnac.dRi], 702h ; request-id - mov word [buff], 0100h ;TLV.Type(1) - encapsulated META_DATA - mov word [buff+2], 1000h ; 00 10 TLV.Length - mov word [buff+4], 000Eh ; (LE) data chunk size (TLV.Length-2) + mov word [buff], 0100h ;TLV.Type(1) - encapsulated META_DATA + mov word [buff+2], 1000h ; 00 10 TLV.Length + mov word [buff+4], 000Eh ; (LE) data chunk size (TLV.Length-2) mov eax, UIN call ascitoint - mov dword [buff+6], eax ;(LE) request owner uin - mov word [buff+10], 07D0h ;data type: META_DATA_REQ + mov dword [buff+6], eax ;(LE) request owner uin + mov word [buff+10], 07D0h ;data type: META_DATA_REQ ;mov word [buff+12], 0008h ; request sequence number <<<-- Может меняться FIXIT - mov word [buff+14], 04BAh ; data subtype: META_SHORTINFO_REQUEST + mov word [buff+14], 04BAh ; data subtype: META_SHORTINFO_REQUEST mov ecx, [socket] mov edx, 20 - xor esi, esi ; Счетчик + xor esi, esi ; Счетчик xor eax, eax gi_loop: mov ebx, esi - mov word [buff+12], bx ; request sequence number + mov word [buff+12], bx ; request sequence number mov ebx, UIN_LEN imul ebx, esi mov al, [uins+ebx] cmp al, 0 - jz gi_end + jz gi_end lea eax, [uins+ebx] call ascitoint @@ -3287,10 +3287,10 @@ snac_buff db 1024 dup 0 ; mov [ssnac.wFid], 3 ; Family mov [ssnac.wSid], 4 ; Subtype - mov [ssnac.dRi], 4 ; request-id + mov [ssnac.dRi], 4 ; request-id - xor esi, esi ; Счетчик - xor edx, edx ; Заполнено байт + xor esi, esi ; Счетчик + xor edx, edx ; Заполнено байт ukk_loop: mov ebx, UIN_LEN @@ -3337,11 +3337,11 @@ snac_buff db 1024 dup 0 cmp [login], 2 jnz @f mov ax, [timer] - cmp ax, 300 ;60 c + cmp ax, 300 ;60 c jb @f mov [timer], 0 mov [flap.bId], FLAP_ID - mov [flap.bCh], 5 ;Keep alive + mov [flap.bCh], 5 ;Keep alive mov [flap.wDs], 0 inc [seq] mov ax, [seq] @@ -3363,7 +3363,7 @@ snac_buff db 1024 dup 0 ; <--- initialised data ---> DATA lsz header,\ - ru, "KI",\ + ru, "KI",\ en, "KI",\ fr, "KI" @@ -3383,7 +3383,7 @@ rflap FLAP_head ssnac SNAC_head ; для передачи SNAC rsnac SNAC_head ; для принятого SNAC ; -ui UI_head ; User info +ui UI_head ; User info ; procinfo process_information ; @@ -3392,9 +3392,9 @@ PASS db 'coolpass',0 ID_STRING db 'ICQ Inc. - Product of ICQ (TM).2000b.4.65.1.3281.85',0 ;ID_STRING db 'ICQ Inc. - Product of ICQ (TM).2001b.5.17.1.3642.85',0 CAPABILITIES db 053h, 054h, 0, 0, 097h, 0B1h, 027h, 051h, 024h, 03Ch, 043h, 034h, 0ADh, 022h, 0D6h, 0ABh,\ - 0F7h, 03Fh, 014h, 092h, 02Eh, 07Ah, 064h, 075h, 0FAh, 0DFh, 04Dh, 0C8h, 088h, 06Fh, 0EAh, 035h,\ - 095h, 0FDh, 0B6h, 0DFh, 09h, 046h, 013h, 044h, 04Ch, 07Fh, 011h, 0D1h, 082h, 022h, 044h, 045h,\ - 053h, 054h, 0, 0 + 0F7h, 03Fh, 014h, 092h, 02Eh, 07Ah, 064h, 075h, 0FAh, 0DFh, 04Dh, 0C8h, 088h, 06Fh, 0EAh, 035h,\ + 095h, 0FDh, 0B6h, 0DFh, 09h, 046h, 013h, 044h, 04Ch, 07Fh, 011h, 0D1h, 082h, 022h, 044h, 045h,\ + 053h, 054h, 0, 0 ; ; From &RQ ; @@ -3410,17 +3410,17 @@ CAPABILITIES db 053h, 054h, 0, 0, 097h, 0B1h, 027h, 051h, 024h, 03Ch, 043h, 034h C_LEN = 40h ;C_LEN = 80 ICBM_PARAMS db 0, 0, 0, 0, 0, 0Bh, 01Fh, 040h, 3, 0E7h, 3, 0E7h, 0, 0, 0, 0 -ICBMP_LEN = 16 ; ^^^ from &RQ +ICBMP_LEN = 16 ; ^^^ from &RQ ; ; from &rq ; -FAMILY_ARR db 0x00, 0x01, 0x00, 0x03, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x13, 0x00, 0x02, 0x01, 0x10, 0x04, 0x7B,\ - 0x00, 0x02, 0x00, 0x01, 0x01, 0x01, 0x04, 0x7B, 0x00, 0x03, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B,\ - 0x00, 0x15, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x04, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B,\ - 0x00, 0x06, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x09, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B,\ - 0x00, 0x0A, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x10, 0x00, 0x01, 0x00, 0x10, 0x06, 0x6A +FAMILY_ARR db 0x00, 0x01, 0x00, 0x03, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x13, 0x00, 0x02, 0x01, 0x10, 0x04, 0x7B,\ + 0x00, 0x02, 0x00, 0x01, 0x01, 0x01, 0x04, 0x7B, 0x00, 0x03, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B,\ + 0x00, 0x15, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x04, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B,\ + 0x00, 0x06, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x09, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B,\ + 0x00, 0x0A, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x10, 0x00, 0x01, 0x00, 0x10, 0x06, 0x6A @@ -3445,32 +3445,32 @@ CL_LANG db 'en',0 CL_COUNTRY db 'us',0 -sbuff db 1024 dup 0 ; Буфер для передачи используется внутри sendflap +sbuff db 1024 dup 0 ; Буфер для передачи используется внутри sendflap -rbuff db 1024 dup 0 ; Приемный буфер -tbuff db 512 dup 0 ; Для TLV +rbuff db 1024 dup 0 ; Приемный буфер +tbuff db 512 dup 0 ; Для TLV srv_cookie db 512 dup 0 ; Куки для авторизации bos_address db 128 dup 0 ; Адрес BOS сервера -cookie_len dw 0 ; Длина куки -seq dw 0 ; Sequence number +cookie_len dw 0 ; Длина куки +seq dw 0 ; Sequence number bos_ip dd 0 bos_port dd 0 -status dw 0 ; status +status dw 0 ; status -mbuff db 2048 dup 0 ; Для приема -MBUFF_SIZE = 2048 +mbuff db 2048 dup 0 ; Для приема +MBUFF_SIZE = 2048 -hrf db 0 ; Флаг приема заголовка +hrf db 0 ; Флаг приема заголовка mouse_flag dd 0 socket dd 0 login db 0 -msg_cookie1 dd 0 ; Используются для потверждения приема сообщений -msg_cookie2 dd 0 ; +msg_cookie1 dd 0 ; Используются для потверждения приема сообщений +msg_cookie2 dd 0 ; -curruser db 0 ; текущий пользователь, которому будут отправляться сообщения - ; - Номер в КЛ по порядку +curruser db 0 ; текущий пользователь, которому будут отправляться сообщения + ; - Номер в КЛ по порядку timer dw 0 diff --git a/programs/network/icq/trunk/lang.inc b/programs/network/icq/trunk/lang.inc deleted file mode 100644 index 30c0149bd9..0000000000 --- a/programs/network/icq/trunk/lang.inc +++ /dev/null @@ -1 +0,0 @@ -lang fix ru \ No newline at end of file diff --git a/programs/network/icq/trunk/macros.inc b/programs/network/icq/trunk/macros.inc deleted file mode 100644 index bcf2e9fda5..0000000000 --- a/programs/network/icq/trunk/macros.inc +++ /dev/null @@ -1,502 +0,0 @@ -@^ fix macro comment { -^@ fix } - - -macro m2m dest,src { - push src - pop dest -} - - -macro iglobal { - IGlobals equ IGlobals, - macro __IGlobalBlock { } - -macro uglobal { - UGlobals equ UGlobals, - macro __UGlobalBlock { } - -endg fix } ; Use endg for ending iglobal and uglobal blocks. - - -macro IncludeIGlobals{ - macro IGlobals dummy,[n] \{ __IGlobalBlock - purge __IGlobalBlock \} - match I, IGlobals \{ I \} } - -macro IncludeUGlobals{ - macro UGlobals dummy,[n] \{ - \common - \local begin, size - begin = $ - virtual at $ - \forward - __UGlobalBlock - purge __UGlobalBlock - \common - size = $ - begin - end virtual - rb size - \} - match U, UGlobals \{ U \} } - -uglobal -endg - -iglobal -endg - - -; new application structure -macro meos_app_start - { - use32 - org 0x0 - - db 'MENUET01' - dd 0x01 - dd __start - dd __end - dd __memory - dd __stack - - if used __params & ~defined __params - dd __params - else - dd 0x0 - end if - - dd 0x0 - } -MEOS_APP_START fix meos_app_start - -macro code - { - __start: - } -CODE fix code - -macro data - { - __data: - IncludeIGlobals - } -DATA fix data - -macro udata - { - if used __params & ~defined __params - __params: - db 0 - __end: - rb 255 - else - __end: - end if - __udata: - IncludeUGlobals - } -UDATA fix udata - -macro meos_app_end - { - align 32 - rb 2048 - __stack: - __memory: - } -MEOS_APP_END fix meos_app_end - - -; macro for defining multiline text data -struc mstr [sstring] - { - forward - local ssize - virtual at 0 - db sstring - ssize = $ - end virtual - dd ssize - db sstring - common - dd -1 - } - -; macro for defining multiline text data -struc mls [sstring] - { - forward - local ssize - virtual at 0 - db sstring ; mod - ssize = $ - end virtual - db ssize - db sstring - common - db -1 ; mod - } - - - -; strings -macro sz name,[data] { ; from MFAR [mike.dld] - common - if used name - name db data - .size = $-name - end if -} - -macro lsz name,[lng,data] { ; from MFAR [mike.dld] - common - if used name - label name - forward - if lang eq lng - db data - end if - common - .size = $-name - end if -} - -macro szc name,elsz,[data] { ; from MFAR [mike.dld] - common - local s,m - m = 0 - if used name - label name - forward - virtual at 0 - db data - s = $ - end virtual - d#elsz s - if m < s - m = s - end if - db data - common - .size = $-name - .maxl = m - end if -} - -macro lszc name,elsz,[lng,data] { ; from MFAR [mike.dld] - common - local s,m,c - m = 0 - c = 0 - if used name - label name - forward - if lang eq lng - virtual at 0 - db data - s = $ - end virtual - d#elsz s - if m < s - m = s - end if - db data - c = c+1 - end if - common - .size = $-name - .maxl = m - .count = c - end if -} - - -; easy system call macro -macro mpack dest, hsrc, lsrc -{ - if (hsrc eqtype 0) & (lsrc eqtype 0) - mov dest, (hsrc) shl 16 + lsrc - else - if (hsrc eqtype 0) & (~lsrc eqtype 0) - mov dest, (hsrc) shl 16 - add dest, lsrc - else - mov dest, hsrc - shl dest, 16 - add dest, lsrc - end if - end if -} - -macro __mov reg,a,b { ; mike.dld - if (~a eq)&(~b eq) - mpack reg,a,b - else if (~a eq)&(b eq) - mov reg,a - end if -} - - -include 'config.inc' -;__CPU_type equ p5 -SYSENTER_VAR equ 0 - -macro mcall a,b,c,d,e,f { ; mike.dld, updated by Ghost for Fast System Calls - local ..ret_point - __mov eax,a - __mov ebx,b - __mov ecx,c - __mov edx,d - __mov esi,e - __mov edi,f - - if __CPU_type eq p5 - int 0x40 - else - if __CPU_type eq p6 - push ebp - mov ebp, esp - push ..ret_point ; it may be 2 or 5 byte - sysenter - ..ret_point: - pop edx - pop ecx - - else - if __CPU_type eq k6 - push ecx - syscall - pop ecx - else - display 'ERROR : unknown CPU type (set to p5)', 10, 13 - __CPU_type equ p5 - int 0x40 - end if - end if - end if -} - - -; ------------------------- -macro header a,[b] { - common - use32 - org 0 - db 'MENUET',a - forward - if b eq - dd 0 - else - dd b - end if } -macro section name { align 16 - label name } -macro func name { - if ~used name - display 'FUNC NOT USED: ',`name,13,10 - else - align 4 - name: - ;diff16 `name,0,name -;pushad -;pushfd -;dps `name -;newline -;mcall 5,1 -;popfd -;popad -} -macro endf { end if } - -macro diff16 title,l1,l2 - { - local s,d - s = l2-l1 - display title,': 0x' - repeat 8 - d = '0' + s shr ((8-%) shl 2) and $0F - if d > '9' - d = d + 'A'-'9'-1 - end if - display d - end repeat - display 13,10 - } - -macro diff10 title,l1,l2 - { - local s,d,z,m - s = l2-l1 - z = 0 - m = 1000000000 - display title,': ' - repeat 10 - d = '0' + s / m - s = s - (s/m)*m - m = m / 10 - if d <> '0' - z = 1 - end if - if z <> 0 - display d - end if - end repeat - display 13,10 - } - -; optimize the code for size -__regs fix - -macro add arg1,arg2 - { - if (arg2 eqtype 0) - if (arg2) = 1 - inc arg1 - else - add arg1,arg2 - end if - else - add arg1,arg2 - end if - } - -macro sub arg1,arg2 - { - if (arg2 eqtype 0) - if (arg2) = 1 - dec arg1 - else - sub arg1,arg2 - end if - else - sub arg1,arg2 - end if - } - -macro mov arg1,arg2 - { - if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0')) - if (arg2) = 0 - xor arg1,arg1 - else if (arg2) = 1 - xor arg1,arg1 - inc arg1 - else if (arg2) = -1 - or arg1,-1 - else if (arg2) > -128 & (arg2) < 128 - push arg2 - pop arg1 - else - mov arg1,arg2 - end if - else - mov arg1,arg2 - end if - } - - -macro RGB [a] { - common - match (r=,g=,b),a \{ - \dd ((r) shl 16) or ((g) shl 8) or (b) - \} -} - - -struc POINT _t,_dx,_dy { - .x _t _dx - .y _t _dy -} - -; structure definition helper -include 'struct.inc' - -struct RECT - left dd ? - top dd ? - right dd ? - bottom dd ? -ends - -struct BOX - left dd ? - top dd ? - width dd ? - height dd ? -ends - -; structures used in MeOS -struct process_information - cpu_usage dd ? ; +0 - window_stack_position dw ? ; +4 - window_stack_value dw ? ; +6 - dw ? ; +8 - process_name rb 12 ; +10 - memory_start dd ? ; +22 - used_memory dd ? ; +26 - PID dd ? ; +30 - box BOX ; +34 - slot_state dw ? ; +50 - dw ? ; +52 - client_box BOX ; +54 - wnd_state db ? ; +70 - rb (1024-71) -ends - -struct system_colors - frame dd ? - grab dd ? - grab_button dd ? - grab_button_text dd ? - grab_text dd ? - work dd ? - work_button dd ? - work_button_text dd ? - work_text dd ? - work_graph dd ? -ends - -struct FILEDATE - Second db ? - Minute db ? - Hour db ? - db ? - Day db ? - Month db ? - Year dw ? -ends - -struct FILEINFO - Attributes dd ? - IsUnicode db ? - db 3 dup(?) - DateCreate FILEDATE - DateAccess FILEDATE - DateModify FILEDATE - Size dq ? -ends - -; constants - -; events -EV_IDLE = 0 -EV_TIMER = 0 -EV_REDRAW = 1 -EV_KEY = 2 -EV_BUTTON = 3 -EV_EXIT = 4 -EV_BACKGROUND = 5 -EV_MOUSE = 6 -EV_IPC = 7 -EV_STACK = 8 - -; event mask bits for function 40 -EVM_REDRAW = 1b -EVM_KEY = 10b -EVM_BUTTON = 100b -EVM_EXIT = 1000b -EVM_BACKGROUND = 10000b -EVM_MOUSE = 100000b -EVM_IPC = 1000000b -EVM_STACK = 10000000b \ No newline at end of file diff --git a/programs/network/icq/trunk/struct.inc b/programs/network/icq/trunk/struct.inc deleted file mode 100644 index 947a84e89a..0000000000 --- a/programs/network/icq/trunk/struct.inc +++ /dev/null @@ -1,180 +0,0 @@ - -; Macroinstructions for defining data structures - -macro struct name - { fields@struct equ name - match child parent, name \{ fields@struct equ child,fields@\#parent \} - sub@struct equ - struc db [val] \{ \common fields@struct equ fields@struct,.,db, \} - struc dw [val] \{ \common fields@struct equ fields@struct,.,dw, \} - struc du [val] \{ \common fields@struct equ fields@struct,.,du, \} - struc dd [val] \{ \common fields@struct equ fields@struct,.,dd, \} - struc dp [val] \{ \common fields@struct equ fields@struct,.,dp, \} - struc dq [val] \{ \common fields@struct equ fields@struct,.,dq, \} - struc dt [val] \{ \common fields@struct equ fields@struct,.,dt, \} - struc rb count \{ fields@struct equ fields@struct,.,db,count dup (?) \} - struc rw count \{ fields@struct equ fields@struct,.,dw,count dup (?) \} - struc rd count \{ fields@struct equ fields@struct,.,dd,count dup (?) \} - struc rp count \{ fields@struct equ fields@struct,.,dp,count dup (?) \} - struc rq count \{ fields@struct equ fields@struct,.,dq,count dup (?) \} - struc rt count \{ fields@struct equ fields@struct,.,dt,count dup (?) \} - macro db [val] \{ \common \local anonymous - fields@struct equ fields@struct,anonymous,db, \} - macro dw [val] \{ \common \local anonymous - fields@struct equ fields@struct,anonymous,dw, \} - macro du [val] \{ \common \local anonymous - fields@struct equ fields@struct,anonymous,du, \} - macro dd [val] \{ \common \local anonymous - fields@struct equ fields@struct,anonymous,dd, \} - macro dp [val] \{ \common \local anonymous - fields@struct equ fields@struct,anonymous,dp, \} - macro dq [val] \{ \common \local anonymous - fields@struct equ fields@struct,anonymous,dq, \} - macro dt [val] \{ \common \local anonymous - fields@struct equ fields@struct,anonymous,dt, \} - macro rb count \{ \local anonymous - fields@struct equ fields@struct,anonymous,db,count dup (?) \} - macro rw count \{ \local anonymous - fields@struct equ fields@struct,anonymous,dw,count dup (?) \} - macro rd count \{ \local anonymous - fields@struct equ fields@struct,anonymous,dd,count dup (?) \} - macro rp count \{ \local anonymous - fields@struct equ fields@struct,anonymous,dp,count dup (?) \} - macro rq count \{ \local anonymous - fields@struct equ fields@struct,anonymous,dq,count dup (?) \} - macro rt count \{ \local anonymous - fields@struct equ fields@struct,anonymous,dt,count dup (?) \} - macro union \{ fields@struct equ fields@struct,,union,< - sub@struct equ union \} - macro struct \{ fields@struct equ fields@struct,,substruct,< - sub@struct equ substruct \} - virtual at 0 } - -macro ends - { match , sub@struct \{ restruc db,dw,du,dd,dp,dq,dt - restruc rb,rw,rd,rp,rq,rt - purge db,dw,du,dd,dp,dq,dt - purge rb,rw,rd,rp,rq,rt - purge union,struct - match name=,fields,fields@struct \\{ fields@struct equ - make@struct name,fields - fields@\\#name equ fields \\} - end virtual \} - match any, sub@struct \{ fields@struct equ fields@struct> \} - restore sub@struct } - -macro make@struct name,[field,type,def] - { common - if $ - display 'Error: definition of ',`name,' contains illegal instructions.',0Dh,0Ah - err - end if - local define - define equ name - forward - local sub - match , field \{ make@substruct type,name,sub def - define equ define,.,sub, \} - match any, field \{ define equ define,.#field,type, \} - common - match fields, define \{ define@struct fields \} } - -macro define@struct name,[field,type,def] - { common - local list - list equ - forward - if ~ field eq . - name#field type def - sizeof.#name#field = $ - name#field - else - rb sizeof.#type - end if - local value - match any, list \{ list equ list, \} - list equ list - common - sizeof.#name = $ - restruc name - match values, list \{ - struc name value \\{ - match any, fields@struct \\\{ fields@struct equ fields@struct,.,name, \\\} - match , fields@struct \\\{ label . - forward - match , value \\\\{ field type def \\\\} - match any, value \\\\{ field type value - if ~ field eq . - rb sizeof.#name#field - ($-field) - end if \\\\} - common \\\} \\} \} } - -macro enable@substruct - { macro make@substruct substruct,parent,name,[field,type,def] - \{ \common - \local define - define equ parent,name - \forward - \local sub - match , field \\{ match any, type \\\{ enable@substruct - make@substruct type,name,sub def - purge make@substruct - define equ define,.,sub, \\\} \\} - match any, field \\{ define equ define,.\#field,type, \\} - \common - match fields, define \\{ define@\#substruct fields \\} \} } - -enable@substruct - -macro define@union parent,name,[field,type,def] - { common - virtual at 0 - forward - if ~ field eq . - virtual at 0 - parent#field type def - sizeof.#parent#field = $ - parent#field - end virtual - if sizeof.#parent#field > $ - rb sizeof.#parent#field - $ - end if - else if sizeof.#type > $ - rb sizeof.#type - $ - end if - common - sizeof.#name = $ - end virtual - struc name [value] \{ \common - label .\#name - last@union equ - forward - match any, last@union \\{ virtual at .\#name - field type def - end virtual \\} - match , last@union \\{ match , value \\\{ field type def \\\} - match any, value \\\{ field type value \\\} \\} - last@union equ field - common rb sizeof.#name - ($ - .\#name) \} } - -macro define@substruct parent,name,[field,type,def] - { common - virtual at 0 - forward - if ~ field eq . - parent#field type def - sizeof.#parent#field = $ - parent#field - else - rb sizeof.#type - end if - local value - common - sizeof.#name = $ - end virtual - struc name value \{ - label .\#name - forward - match , value \\{ field type def \\} - match any, value \\{ field type value - if ~ field eq . - rb sizeof.#parent#field - ($-field) - end if \\} - common \} }