2011-02-02 12:52:07 +03:00
|
|
|
|
; compiler: FASM 1.67.21
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; name: ICQ client for Kolibri
|
|
|
|
|
; version: 0.1.30
|
2011-02-02 12:52:07 +03:00
|
|
|
|
; written by: LV
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; e-mail: lv4evil@yandex.ru
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include "lang.inc"
|
2011-10-19 02:58:49 +04:00
|
|
|
|
include "MACROS.INC"
|
|
|
|
|
;purge mov
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;include "ASCL9/ascl.inc"
|
|
|
|
|
;include "debug.inc"
|
2011-10-19 02:58:49 +04:00
|
|
|
|
include "editbox.inc"
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
MEOS_APP_START
|
|
|
|
|
|
|
|
|
|
;include "debug.inc"
|
|
|
|
|
include "2000.inc"
|
|
|
|
|
include "comp.inc"
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;include "fsio.inc"
|
|
|
|
|
include "dos2win.inc"
|
|
|
|
|
include "parser.inc"
|
|
|
|
|
include "ssi.inc"
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
use_edit_box procinfo,22,5
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;
|
|
|
|
|
; <20> == 0, <20><><EFBFBD> <20><><EFBFBD> <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⠪<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <20><> <20><>ࢥ<EFBFBD><E0A2A5> <20><> <20><>ᥬ<EFBFBD><E1A5AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
USE_SSI = 1
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
CODE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;mov eax, 40
|
|
|
|
|
;mov ebx, 47h
|
|
|
|
|
;int 40h
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20><><EFBFBD>䨣<EFBFBD><E4A8A3>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
mov eax, fname
|
|
|
|
|
call parseconf
|
|
|
|
|
;
|
|
|
|
|
; <20>뢮<EFBFBD> <20><><EFBFBD><EFBFBD>㦥<EFBFBD><E3A6A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ଠ樨
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
mov eax, cfg_message
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
call writemsg
|
|
|
|
|
|
|
|
|
|
call showcfg
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;call loaduin
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call draw_window ; at first create and draw the window
|
|
|
|
|
|
|
|
|
|
;call buttonbox
|
|
|
|
|
|
|
|
|
|
wait_event: ; main cycle
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 23
|
|
|
|
|
;mov ebx, 20
|
|
|
|
|
;int 0x40
|
|
|
|
|
mcall 23,20
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
cmp eax, 1 ; if event == 1
|
|
|
|
|
je redraw ; jump to redraw handler
|
|
|
|
|
cmp eax, 2 ; else if event == 2
|
|
|
|
|
je key ; jump to key handler
|
|
|
|
|
cmp eax, 3 ; else if event == 3
|
|
|
|
|
je button ; jump to button handler
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
|
|
|
|
mcall 53,2,[socket]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp eax, 0
|
|
|
|
|
jnz read_socket
|
|
|
|
|
|
|
|
|
|
mouse_edit_box inputbox
|
|
|
|
|
;
|
|
|
|
|
; <20> <20><><EFBFBD><EFBFBD> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>ࢥ, <20><><EFBFBD>뫠<EFBFBD><EBABA0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD>⢥<EFBFBD><E2A2A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 60 <20>
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; <20><> <20>ॡ<EFBFBD><E0A5A1><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; call sendkeep
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
jmp wait_event ; else return to the start of main cycle
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
redraw: ; redraw event handler
|
|
|
|
|
call draw_window
|
|
|
|
|
jmp wait_event
|
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
key: ; get key code
|
|
|
|
|
|
|
|
|
|
mcall 2
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp ah, 0Dh ; <20><EFBFBD><E0AEA1> - <20><><EFBFBD>ࠢ<EFBFBD><E0A0A2><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz send
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
key_edit_box inputbox
|
|
|
|
|
|
|
|
|
|
jmp wait_event
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
button: ; button event handler
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 17 ; get button identifier
|
|
|
|
|
;int 0x40
|
|
|
|
|
mcall 17
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
cmp ah, 2
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz connect
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
cmp ah, 3
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz disconnect
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
cmp ah, 4
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz send
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><EFBFBD><E0AEA2>塞, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>
|
|
|
|
|
; 100 <ID <= 100+UINS
|
|
|
|
|
cmp ah, UINS+100
|
|
|
|
|
jnc @f
|
|
|
|
|
cmp ah, 100
|
|
|
|
|
jc @f
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
sub ah, 100
|
|
|
|
|
mov [curruser], ah
|
|
|
|
|
;
|
|
|
|
|
; <20>뢮<EFBFBD><EBA2AE><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
shr eax, 8
|
|
|
|
|
and eax, 000000FFh
|
|
|
|
|
push eax
|
|
|
|
|
mov eax, CUSER
|
|
|
|
|
call strlen
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
mov eax, CUSER
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
call strcpy
|
|
|
|
|
pop eax
|
|
|
|
|
mov ebx, NAME_LEN
|
|
|
|
|
imul ebx, eax
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea eax, [names + ebx]
|
|
|
|
|
mov [buff + ecx], ' ' ; <20><EFBFBD><E0AEA1>
|
|
|
|
|
lea ebx, [buff + ecx + 1]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov ecx, NAME_LEN
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;debug
|
|
|
|
|
push ebx
|
|
|
|
|
mov ebx, NAME_LEN
|
|
|
|
|
call print_mem
|
|
|
|
|
pop ebx
|
|
|
|
|
;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call strcpy
|
|
|
|
|
mov eax, buff
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
call writemsg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah, 1
|
|
|
|
|
jne wait_event ; return if button id != 1
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; exit application
|
|
|
|
|
mcall -1
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draw_window:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; start drawing
|
|
|
|
|
mcall 12,1
|
|
|
|
|
|
|
|
|
|
mcall 0,(100*65536+700),(100*65536+500),0x14ffffff,0,head
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
draw_edit_box inputbox
|
|
|
|
|
|
|
|
|
|
rect 10, 30, 500, 450, 0
|
|
|
|
|
|
|
|
|
|
draw_button 600, 460, 60, 15, 2, 'CONNECT'
|
|
|
|
|
;draw_button 600, 460, 60, 15, 3, 'Disconnect'
|
|
|
|
|
draw_button 530, 460, 60, 15, 4, 'SEND'
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
call printbuff
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call buttonbox
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Image
|
|
|
|
|
;
|
|
|
|
|
;mov eax, 7
|
|
|
|
|
;mov ebx, redicq
|
|
|
|
|
;mov ecx, 15*65536+15
|
|
|
|
|
;mov edx, 100*65536+100
|
|
|
|
|
;int 40h
|
|
|
|
|
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; finish drawing
|
|
|
|
|
mcall 12,2
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
connect:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea eax, [vtable + vartable.icqip]
|
|
|
|
|
call ip_parser
|
|
|
|
|
call htonl
|
|
|
|
|
data_debug 'IP:', eax
|
|
|
|
|
|
|
|
|
|
;mov eax, ICQ_IP
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov ebx, ICQ_PORT
|
|
|
|
|
call srv_connect
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp wait_event
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
disconnect:
|
|
|
|
|
mov ecx, [socket]
|
|
|
|
|
call closesocket
|
|
|
|
|
|
|
|
|
|
jmp wait_event
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
send:
|
|
|
|
|
;
|
|
|
|
|
; <20><>।<EFBFBD><E0A5A4>塞, <20><> ᬥ<><E1ACA5><EFBFBD> <20><> ⥪<>騩 <20><><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD> ᬥ<><E1ACA5> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> / <20> <20><>砫<EFBFBD> <20><>ப<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> 㨭<>
|
|
|
|
|
; <20><> <20><><EFBFBD>浪<EFBFBD>. <20> <20><><EFBFBD><EFBFBD><EFBFBD> > 2 ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>⠥<EFBFBD><E2A0A5><EFBFBD>, <20><><EFBFBD> <20><>।<EFBFBD><E0A5A4>
|
|
|
|
|
; ᠬ 㨭 - <20><><EFBFBD> <20><><EFBFBD>ࠢ<EFBFBD><E0A0A2> ᮮ<>饭<EFBFBD><E9A5AD> ࠬ, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><>
|
|
|
|
|
;
|
|
|
|
|
mov al, [inputbuff]
|
|
|
|
|
cmp al, '/'
|
|
|
|
|
jnz sd_message
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD> 㨭<>
|
|
|
|
|
;mov al, [inputbuff+2]
|
|
|
|
|
;cmp al, 20h
|
|
|
|
|
;jz sd_use_kl
|
|
|
|
|
mov al, [inputbuff+3]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp al, 20h ; <20><EFBFBD><E0AEA1>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz sd_use_kl
|
|
|
|
|
;
|
|
|
|
|
; <20>饬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA1>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㨭
|
|
|
|
|
;
|
|
|
|
|
xor ecx, ecx
|
|
|
|
|
sd_loop:
|
|
|
|
|
mov al, [inputbuff+ecx]
|
|
|
|
|
cmp al, 20h
|
|
|
|
|
jz sd_space
|
|
|
|
|
cmp al, 0
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz wait_event
|
2011-02-02 12:52:07 +03:00
|
|
|
|
inc ecx
|
|
|
|
|
jmp sd_loop
|
|
|
|
|
|
|
|
|
|
sd_space:
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>塞 <20><EFBFBD><E0AEA1> <20><> 0, <20><><EFBFBD>뫠<EFBFBD><EBABA0> ᮮ<>饭<EFBFBD><E9A5AD>
|
|
|
|
|
mov [inputbuff+ecx], byte 0
|
|
|
|
|
lea ebx, [inputbuff+1]
|
|
|
|
|
lea eax, [inputbuff+ecx+1]
|
|
|
|
|
call sendmsg
|
|
|
|
|
mov ebx, 0000FFh
|
|
|
|
|
call writemsg
|
|
|
|
|
jmp wait_event
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_use_kl:
|
|
|
|
|
lea eax, [inputbuff+1]
|
|
|
|
|
mov [inputbuff+3], byte 0
|
|
|
|
|
call ascitoint
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea eax, [eax-1] ; <20>.<2E>. <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 0
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [curruser], al
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_message:
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>饭<EFBFBD><E9A5AD>
|
|
|
|
|
movzx eax, [curruser]
|
|
|
|
|
mov ebx, UIN_LEN
|
|
|
|
|
imul ebx, eax
|
|
|
|
|
lea ebx, [uins+ebx]
|
|
|
|
|
mov al, [inputbuff]
|
|
|
|
|
cmp al, '/'
|
|
|
|
|
jz @f
|
|
|
|
|
mov eax, inputbuff
|
|
|
|
|
jmp sd_send
|
|
|
|
|
@@:
|
|
|
|
|
;mov al, [inputbuff+2]
|
|
|
|
|
;cmp al, ' '
|
|
|
|
|
;jz @f
|
|
|
|
|
lea eax, [inputbuff+4]
|
|
|
|
|
;jmp sd_send
|
|
|
|
|
;@@: lea eax, [inputbuff+3]
|
|
|
|
|
|
|
|
|
|
sd_send:
|
|
|
|
|
call sendmsg
|
|
|
|
|
mov ebx, 0000FFh
|
|
|
|
|
call writemsg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp wait_event
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD> <20>ਭ<EFBFBD><E0A8AD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
read_socket:
|
|
|
|
|
pushf
|
|
|
|
|
pushad
|
|
|
|
|
;write_debug 'Some data in socket'
|
|
|
|
|
;
|
|
|
|
|
; <20><EFBFBD><E0AEA2>塞, <20><> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>祭 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⤥<EFBFBD>쭮 <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <20> <20>।<EFBFBD><E0A5A4><EFBFBD>饬 横<><E6A8AA>
|
|
|
|
|
;
|
|
|
|
|
cmp [hrf], 1
|
|
|
|
|
jz rs_head_recived
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
rs_check_sock:
|
|
|
|
|
;mov eax, 53
|
|
|
|
|
;mov ebx, 2
|
|
|
|
|
;mov ecx, [socket]
|
|
|
|
|
;int 40h
|
|
|
|
|
mcall 53,2,[socket]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp eax, 6 ; Flap head size
|
|
|
|
|
jc r_end
|
|
|
|
|
;
|
|
|
|
|
; <20>ਭ<EFBFBD><E0A8AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
xor edx, edx
|
|
|
|
|
|
|
|
|
|
;mov ecx, [socket]
|
|
|
|
|
rs_loop:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 53
|
|
|
|
|
;mov ebx, 3
|
|
|
|
|
;int 40h
|
|
|
|
|
mcall 53,3,[socket]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov [mbuff+edx], bl
|
|
|
|
|
inc edx
|
|
|
|
|
cmp edx, 6
|
|
|
|
|
|
|
|
|
|
jnz rs_loop
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
;xor eax, eax
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਭ<EFBFBD><E0A8AD>!
|
|
|
|
|
;
|
|
|
|
|
mov [hrf], 1
|
|
|
|
|
|
|
|
|
|
mov bl, [mbuff]
|
|
|
|
|
mov [rflap.bId], bl
|
|
|
|
|
|
|
|
|
|
mov bl, [mbuff+1]
|
|
|
|
|
mov [rflap.bCh], bl
|
|
|
|
|
|
|
|
|
|
mov bh, [mbuff+2]
|
|
|
|
|
mov bl, [mbuff+3]
|
|
|
|
|
mov [rflap.wSn], bx
|
|
|
|
|
|
|
|
|
|
mov bh, [mbuff+4]
|
|
|
|
|
mov bl, [mbuff+5]
|
|
|
|
|
mov [rflap.wDs], bx
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20>ਭ<EFBFBD><E0A8AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
;xor edx, edx
|
|
|
|
|
cmp [rflap.bId], 2Ah
|
|
|
|
|
jnz rs_flap_error
|
|
|
|
|
;
|
|
|
|
|
; <20><EFBFBD><E0AEA2>塞, <20><><EFBFBD><EFBFBD>祭<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
rs_head_recived:
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 53
|
|
|
|
|
;mov ebx, 2
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;mov ecx, [socket]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;int 40h
|
|
|
|
|
mcall 53,2,[socket]
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp ax, [rflap.wDs] ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jc r_end
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
mov ax, [rflap.wDs]
|
|
|
|
|
;
|
|
|
|
|
; <20><EFBFBD><E0AEA2>塞 ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
cmp ax, MBUFF_SIZE+1
|
|
|
|
|
jnc rs_big_flap
|
|
|
|
|
|
|
|
|
|
xor esi, esi
|
|
|
|
|
mov esi, eax
|
|
|
|
|
xor edx, edx
|
|
|
|
|
|
|
|
|
|
;mov ecx, [socket]
|
|
|
|
|
|
|
|
|
|
rs_data_loop:
|
|
|
|
|
cmp edx, esi
|
|
|
|
|
jz rs_data_end
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 53
|
|
|
|
|
;mov ebx, 3
|
|
|
|
|
;int 40h
|
|
|
|
|
mcall 53,3,[socket]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [mbuff+edx], bl
|
|
|
|
|
inc edx
|
|
|
|
|
jmp rs_data_loop
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਭ<EFBFBD><E0A8AD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
rs_data_end:
|
|
|
|
|
mov [hrf], 0
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;write_debug 'Some data recived'
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
cmp [login], 0
|
|
|
|
|
jz rs_login
|
|
|
|
|
call main_loop
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> ᮪<><E1AEAA> <20><> <20><><EFBFBD><EFBFBD>稥 <><E1ABA5><EFBFBD>饣<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
;jmp r_end
|
|
|
|
|
jmp rs_check_sock
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rs_login:
|
|
|
|
|
call srv_login
|
|
|
|
|
;write_debug 'Exited srv_login'
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;jmp r_end
|
|
|
|
|
jmp rs_check_sock
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
rs_flap_error:
|
|
|
|
|
write_debug 'Invalid Flap'
|
|
|
|
|
;
|
|
|
|
|
; FLAP.id <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>㦭<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮪<><E1AEAA>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
mov ecx, [socket]
|
|
|
|
|
;call closesocket
|
|
|
|
|
jmp r_end
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD>誮<EFBFBD> <20><><EFBFBD><EFBFBD>让 <20><><EFBFBD><EFBFBD><EFBFBD>!
|
|
|
|
|
;
|
|
|
|
|
rs_big_flap:
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
write_debug 'Too BIG FLAP Recived'
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [hrf], 0
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov ecx, [socket]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov ax, [rflap.wDs]
|
|
|
|
|
xor esi, esi
|
|
|
|
|
mov esi, eax
|
|
|
|
|
xor edx, edx
|
|
|
|
|
|
|
|
|
|
rs_data_loop2:
|
|
|
|
|
cmp edx, esi
|
|
|
|
|
jz r_end
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 53
|
|
|
|
|
;mov ebx, 3
|
|
|
|
|
;int 40h
|
|
|
|
|
mcall 53,3,[socket]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;mov [mbuff+edx], bl
|
|
|
|
|
inc edx
|
|
|
|
|
jmp rs_data_loop2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r_end:
|
|
|
|
|
|
|
|
|
|
popad
|
|
|
|
|
popf
|
|
|
|
|
jmp wait_event
|
|
|
|
|
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>ࢥ, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>頥<EFBFBD> <20> eax - <20><><EFBFBD><EFBFBD><EFBFBD> ᮪<><E1AEAA><EFBFBD>
|
|
|
|
|
; <20><>।<EFBFBD><E0A5A4><EFBFBD> <20> <20><><EFBFBD> IP <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ࢥ<EFBFBD><E0A2A5>
|
|
|
|
|
; <20> ebx - <20><><EFBFBD><EFBFBD>
|
2011-10-19 02:58:49 +04:00
|
|
|
|
srv_connect:
|
2011-02-02 12:52:07 +03:00
|
|
|
|
push ecx
|
|
|
|
|
push edx
|
|
|
|
|
push esi
|
|
|
|
|
push edi
|
|
|
|
|
push ebx
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov esi, eax ; IP - <20> esi
|
2011-02-02 12:52:07 +03:00
|
|
|
|
; find free port
|
|
|
|
|
mov ecx, 1000 ; <20><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><>稭<EFBFBD><E7A8AD><EFBFBD> <20> 1000
|
|
|
|
|
|
|
|
|
|
getlp:
|
|
|
|
|
inc ecx
|
|
|
|
|
push ecx
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 53
|
|
|
|
|
;mov ebx, 9
|
|
|
|
|
;int 0x40
|
|
|
|
|
mcall 53,9,ecx
|
2011-02-02 12:52:07 +03:00
|
|
|
|
pop ecx
|
|
|
|
|
cmp eax, 0 ; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|
|
|
|
jz getlp ; <20><> - <20>த<EFBFBD><E0AEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ॡ<EFBFBD><E0A5A1><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;OK ecx = port number
|
|
|
|
|
;Open Socket
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 53
|
|
|
|
|
;mov ebx, 5
|
2011-02-02 12:52:07 +03:00
|
|
|
|
xor edx, edx
|
|
|
|
|
;mov dx, ICQ_PORT
|
|
|
|
|
pop edx
|
|
|
|
|
;mov esi,ICQ_IP
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov edi, 1;SOCKET_ACTIVE
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;int 40h
|
|
|
|
|
mcall 53, 5, ecx, edx, esi, 1
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
mov [socket], eax
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD> <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
srv_loop:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
|
|
|
|
;mov eax, 5
|
|
|
|
|
;mov ebx, 50
|
|
|
|
|
;int 40h
|
|
|
|
|
mcall 5, 50
|
|
|
|
|
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 53
|
|
|
|
|
;mov ebx, 6
|
|
|
|
|
;int 40h
|
|
|
|
|
mcall 53, 6, ecx
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp eax, TCB_ESTABLISHED
|
|
|
|
|
jz fin
|
|
|
|
|
cmp eax, 11
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jae c_end
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
|
|
|
|
;inc [timer]
|
|
|
|
|
;cmp [timer], 50
|
|
|
|
|
;jz srv_err
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jmp srv_loop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;srv_err:
|
|
|
|
|
;mov [timer], word 0
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;cmp eax,-1
|
|
|
|
|
;jnz fin
|
|
|
|
|
;delay 100
|
2011-10-19 02:58:49 +04:00
|
|
|
|
write_debug 'CONNECTION FAILED' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD> <20><> 㤠<><E3A4A0><EFBFBD><EFBFBD>
|
|
|
|
|
jmp c_end
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;connrcted:
|
|
|
|
|
;CONNECTED
|
|
|
|
|
|
|
|
|
|
fin:
|
|
|
|
|
write_debug 'Connected!!!!'
|
2011-10-19 02:58:49 +04:00
|
|
|
|
c_end:
|
2011-02-02 12:52:07 +03:00
|
|
|
|
pop edi
|
|
|
|
|
pop esi
|
|
|
|
|
pop edx
|
|
|
|
|
pop ecx
|
|
|
|
|
;pop ebx
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; --> ecx socket handle
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
srv_login:
|
|
|
|
|
pushf
|
|
|
|
|
push eax
|
|
|
|
|
push ebx
|
|
|
|
|
;push ecx
|
|
|
|
|
push edx
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><>।<EFBFBD><E0A5A4>塞 ⨯ <20><><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
movzx eax, [rflap.bCh]
|
|
|
|
|
cmp eax, 01
|
|
|
|
|
jz s_new_connection
|
|
|
|
|
cmp eax, 04
|
|
|
|
|
jz s_cookie ; cookie
|
|
|
|
|
jmp l_flap_err
|
|
|
|
|
|
|
|
|
|
s_new_connection:
|
|
|
|
|
;
|
|
|
|
|
; <20><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
movzx eax, [rflap.wDs]
|
|
|
|
|
cmp eax, 4
|
|
|
|
|
jnz l_len_err
|
|
|
|
|
mov eax, dword [mbuff]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp eax, 01000000h ; 00 00 00 01
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jnz l_data_err
|
|
|
|
|
;
|
|
|
|
|
;<3B><>ନ<EFBFBD>㥬 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
;mov [flap.bId], FLAP_ID
|
|
|
|
|
mov [flap.bCh], NEW_CONNECTION
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 26
|
|
|
|
|
;mov ebx, 9
|
|
|
|
|
;int 40h
|
|
|
|
|
mcall 26, 9
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [seq], ax
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [flap.wSn], ax ; Sequence number
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;mov [buff],0
|
|
|
|
|
;mov [buff+1],0
|
|
|
|
|
;mov [buff+2],0
|
|
|
|
|
mov dword [buff], 0x01000000 ;login Protokol version 00 00 00 01
|
|
|
|
|
;mov[buff+4],0
|
|
|
|
|
mov word [buff+4], 0x0100; TLV.TYPE = UIN 00 01
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea eax, [vtable + vartable.uin]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call strlen
|
|
|
|
|
mov [buff+6], ah
|
|
|
|
|
mov [buff+7], al ; Length of UIN
|
|
|
|
|
mov edx, eax
|
2011-10-19 02:58:49 +04:00
|
|
|
|
add edx, 7 ; <20> edx <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ecx, eax ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea eax, [vtable + vartable.uin]
|
|
|
|
|
lea ebx, [buff+8] ; + ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> + 1
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
call strcpy
|
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea eax, [vtable + vartable.pass]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call roast
|
|
|
|
|
|
|
|
|
|
mov [buff+edx+2], 2 ; TLV.TYPE - rosted password
|
|
|
|
|
call strlen
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [buff+edx+4], al
|
|
|
|
|
mov [buff+edx+3], ah ; Length of pass
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
add edx, 4
|
|
|
|
|
mov ebx, buff
|
2011-10-19 02:58:49 +04:00
|
|
|
|
add ebx, edx ; <20><><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD>
|
|
|
|
|
add edx, eax ; <20><><EFBFBD>࠭塞 <20> EDX <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ecx, eax ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|
|
|
|
lea eax, [vtable + vartable.pass] ; <20><><EFBFBD><EFBFBD>筨<EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
inc ebx
|
|
|
|
|
call strcpy
|
|
|
|
|
|
|
|
|
|
mov [buff+edx+2], 3 ; TLV.TYPE - client id string
|
|
|
|
|
mov eax, ID_STRING
|
|
|
|
|
call strlen
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [buff+edx+4], al
|
|
|
|
|
mov [buff+edx+3], ah
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
add edx, 4
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
add ebx, edx
|
|
|
|
|
add edx, eax
|
|
|
|
|
inc ebx
|
|
|
|
|
mov eax, ID_STRING
|
|
|
|
|
call strcpy
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
xor eax, eax
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [buff+edx+2], 016h ; TLV.TYPE - Client id
|
|
|
|
|
mov [buff+edx+4], 2
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ax, ID_NUM
|
|
|
|
|
call htons
|
|
|
|
|
mov word [buff+edx+5], ax
|
2011-02-02 12:52:07 +03:00
|
|
|
|
add edx, 6
|
|
|
|
|
|
|
|
|
|
mov [buff+edx+2], 017h ; Client major version
|
|
|
|
|
mov [buff+edx+4], 2
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ax, MAJOR
|
|
|
|
|
call htons
|
|
|
|
|
mov word [buff+edx+5], ax
|
2011-02-02 12:52:07 +03:00
|
|
|
|
add edx, 6
|
|
|
|
|
|
|
|
|
|
mov [buff+edx+2], 018h ; Client minor version
|
|
|
|
|
mov [buff+edx+4], 2
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ax, MINOR
|
|
|
|
|
call htons
|
|
|
|
|
mov word [buff+edx+5], ax
|
2011-02-02 12:52:07 +03:00
|
|
|
|
add edx, 6
|
|
|
|
|
|
|
|
|
|
mov [buff+edx+2], 019h ; Client lesser version
|
|
|
|
|
mov [buff+edx+4], 2
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ax, LESSER
|
|
|
|
|
call htons
|
|
|
|
|
mov word [buff+edx+5], ax
|
2011-02-02 12:52:07 +03:00
|
|
|
|
add edx, 6
|
|
|
|
|
|
|
|
|
|
mov [buff+edx+2], 01Ah ; Client build number
|
|
|
|
|
mov [buff+edx+4], 2
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ax, BUILD
|
|
|
|
|
call htons
|
|
|
|
|
mov word [buff+edx+5], ax
|
2011-02-02 12:52:07 +03:00
|
|
|
|
add edx, 6
|
|
|
|
|
|
|
|
|
|
mov [buff+edx+2], 014h ; Client distribution number
|
|
|
|
|
mov [buff+edx+4], 4
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov eax, DISTR
|
|
|
|
|
call htonl
|
|
|
|
|
mov dword [buff+edx+5], eax
|
2011-02-02 12:52:07 +03:00
|
|
|
|
add edx, 8
|
|
|
|
|
|
|
|
|
|
mov [buff+edx+2], 0Fh ; Client language
|
|
|
|
|
mov eax, CL_LANG
|
|
|
|
|
call strlen
|
|
|
|
|
mov word [buff+edx+4], ax
|
|
|
|
|
add edx, 4
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
add ebx, edx
|
|
|
|
|
inc ebx
|
|
|
|
|
add edx, eax
|
|
|
|
|
mov eax, CL_LANG
|
|
|
|
|
call strcpy
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [buff+edx+2], 0Eh ; Client country
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, CL_COUNTRY
|
|
|
|
|
call strlen
|
|
|
|
|
mov word [buff+edx+4], ax
|
|
|
|
|
add edx, 4
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
add ebx, edx
|
|
|
|
|
inc ebx
|
|
|
|
|
add edx, eax
|
|
|
|
|
mov eax, CL_COUNTRY
|
|
|
|
|
call strcpy
|
|
|
|
|
|
|
|
|
|
;write_debug 'Connect attemption'
|
|
|
|
|
; mov eax, ICQ_IP
|
|
|
|
|
; call srv_connect
|
|
|
|
|
; cmp eax, -1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD> <20><> 㤠<><E3A4A0><EFBFBD><EFBFBD>
|
|
|
|
|
; jz l_fin
|
|
|
|
|
|
|
|
|
|
; mov ecx, eax
|
|
|
|
|
; mov eax, rflap
|
|
|
|
|
; mov ebx, lbuff
|
|
|
|
|
; call recvflap
|
|
|
|
|
|
|
|
|
|
; cmp eax, -1
|
|
|
|
|
; jz l_flap_err
|
|
|
|
|
; cmp [rflap.bCh], 01 ; AUTH channel
|
|
|
|
|
; jnz l_ch_err
|
|
|
|
|
; cmp eax, 4
|
|
|
|
|
; jnz l_len_err
|
|
|
|
|
; cmp dword [lbuff+3], dword 1
|
|
|
|
|
; jnz l_data_err
|
|
|
|
|
|
|
|
|
|
mov ecx, [socket]
|
|
|
|
|
inc dx
|
|
|
|
|
mov [flap.wDs], dx ; Data size
|
|
|
|
|
mov eax, flap
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
call sendflap
|
|
|
|
|
cmp eax, 0
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jnz l_fin ; <20><><EFBFBD>ᯥ<EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jmp l_end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
s_cookie:
|
|
|
|
|
;mov eax, rflap
|
|
|
|
|
;mov ebx, buff
|
|
|
|
|
;call recvflap
|
|
|
|
|
;cmp eax, -1
|
|
|
|
|
;jz l_flap_err
|
|
|
|
|
;cmp [rflap.bCh], 4
|
|
|
|
|
;jnz l_ch_err
|
|
|
|
|
|
|
|
|
|
;write_debug 'UIN'
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
|
|
|
|
|
uin_loop:
|
|
|
|
|
xor eax, eax
|
|
|
|
|
mov ax, word [mbuff+ebx]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp ax, 0100h ; 00 01 TLV.Type UIN
|
|
|
|
|
jz l_uin_ok ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ࢥ<EFBFBD> <20><>।<EFBFBD><E0A5A4><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><>⮬ <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
add ebx, 5 ; <20><><EFBFBD> <20><> TLV 1 (<28><><EFBFBD><EFBFBD><EFBFBD> <20><>ଠ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp ebx, 5
|
|
|
|
|
ja l_tlvt_err
|
|
|
|
|
jmp uin_loop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
l_uin_ok:
|
|
|
|
|
mov eax, ebx
|
|
|
|
|
xor ebx, ebx
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov bl, [mbuff+eax+3] ;
|
|
|
|
|
mov bh, [mbuff+eax+2] ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
; UIN <20><><EFBFBD><EFBFBD> <20><> <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lea ebx, [ebx+eax+4]
|
|
|
|
|
mov ax, word [mbuff+ebx]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp ax, 0500h ; 00 05 Bos address
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz l_all_ok
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp ax, 0400h ; UIN incorrect
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz l_uin_err
|
|
|
|
|
cmp ax, 0800h
|
|
|
|
|
jz l_pass_err
|
|
|
|
|
jmp l_tlvt_err
|
|
|
|
|
;
|
|
|
|
|
; <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> UIN/ <20><><EFBFBD>, <20><><EFBFBD><EFBFBD>砥<EFBFBD> TLV.TYPE 4/8
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
l_all_ok:
|
|
|
|
|
xor ecx, ecx
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov cl, [mbuff+ebx+3] ;length
|
|
|
|
|
mov ch, [mbuff+ebx+2] ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
lea eax, [mbuff+ebx+4]
|
|
|
|
|
push ebx
|
|
|
|
|
mov ebx, bos_address
|
|
|
|
|
call strcpy
|
|
|
|
|
pop ebx
|
|
|
|
|
add ebx, ecx
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea ebx, [ebx+4] ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
; cookie
|
|
|
|
|
;
|
|
|
|
|
;write_debug 'Login Cookie'
|
|
|
|
|
|
|
|
|
|
xor eax, eax
|
|
|
|
|
mov ax, word [mbuff+ebx]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp ax, 0600h ; TLV.Type cookie
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jnz l_tlvt_err
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov cl, [mbuff+ebx+3] ;
|
|
|
|
|
mov ch, [mbuff+ebx+2] ; Length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [cookie_len], cx
|
|
|
|
|
lea eax, [mbuff+ebx+4]
|
|
|
|
|
push ebx
|
|
|
|
|
mov ebx, srv_cookie
|
|
|
|
|
call strcpy
|
|
|
|
|
pop ebx
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞<EFBFBD><EFA5AC> <20> BOS
|
|
|
|
|
;
|
|
|
|
|
;call srv_disconnect
|
|
|
|
|
mov ecx, [socket]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
write_debug 'Closing socket'
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;call closesocket
|
|
|
|
|
;
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;
|
|
|
|
|
;FIXME!!!
|
|
|
|
|
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD> <20><>-<2D><> <20><EFBFBD><E0AEA1><EFBFBD><EFBFBD> <20> <20><>⥢<EFBFBD><E2A5A2> <20>⥪<EFBFBD><E2A5AA>
|
|
|
|
|
;<3B><><EFBFBD><EFBFBD><EFBFBD>⨥ ᮪<><E1AEAA><EFBFBD> <20><><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> <20><><EFBFBD>⥬<EFBFBD>
|
|
|
|
|
;mcall 53, 8, ecx
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, bos_address
|
|
|
|
|
call ip_parser
|
|
|
|
|
|
|
|
|
|
call htonl
|
|
|
|
|
data_debug 'BOS Address: ', eax
|
|
|
|
|
data_debug 'BOS Port: ', ebx
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [bos_ip], eax
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [bos_port], ebx
|
|
|
|
|
call srv_connect
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [login], 1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>᭮<EFBFBD><E1ADAE><EFBFBD><EFBFBD> <20><>ࢥ <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;mov [socket], eax
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp l_end
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
l_pass_err:
|
|
|
|
|
write_debug 'PASSWORD INVALID'
|
|
|
|
|
jmp l_fin
|
|
|
|
|
|
|
|
|
|
l_uin_err:
|
|
|
|
|
write_debug 'UIN INVALID'
|
|
|
|
|
jmp l_fin
|
|
|
|
|
|
|
|
|
|
l_data_err:
|
|
|
|
|
write_debug 'LOGIN DATA MISMATCH'
|
|
|
|
|
jmp l_fin
|
|
|
|
|
|
|
|
|
|
l_len_err:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
write_debug 'RECIVED DATA LENGTH MISMATCH'
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jmp l_fin
|
|
|
|
|
|
|
|
|
|
l_tlvt_err:
|
|
|
|
|
write_debug 'TLV TYPE MISMATCH'
|
|
|
|
|
jmp l_fin
|
|
|
|
|
|
|
|
|
|
l_ch_err:
|
|
|
|
|
write_debug 'FLAP CHANNEL MISMATCH'
|
|
|
|
|
jmp l_fin
|
|
|
|
|
|
|
|
|
|
l_flap_err:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
write_debug 'FLAP ID MISMATCH / RECIVE ERROR'
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
l_fin:
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮪<><E1AEAA>
|
|
|
|
|
;
|
|
|
|
|
;call srv_disconnect
|
2011-10-19 02:58:49 +04:00
|
|
|
|
call closesocket
|
2011-02-02 12:52:07 +03:00
|
|
|
|
l_end:
|
|
|
|
|
pop edx
|
|
|
|
|
;pop ecx
|
|
|
|
|
pop ebx
|
|
|
|
|
pop eax
|
2011-10-19 02:58:49 +04:00
|
|
|
|
popf
|
|
|
|
|
ret
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Length of string
|
|
|
|
|
; input eax = offset string
|
|
|
|
|
; output eax = strlen
|
|
|
|
|
;
|
|
|
|
|
strlen:
|
|
|
|
|
push ebx
|
|
|
|
|
push ecx
|
|
|
|
|
pushf
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
xor ecx, ecx
|
|
|
|
|
|
|
|
|
|
loop_s:
|
|
|
|
|
mov cl, [eax+ebx]
|
|
|
|
|
cmp ecx,0
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz nl
|
2011-02-02 12:52:07 +03:00
|
|
|
|
inc ebx
|
|
|
|
|
jmp loop_s
|
|
|
|
|
|
|
|
|
|
nl:
|
|
|
|
|
mov eax, ebx
|
|
|
|
|
popf
|
|
|
|
|
pop ecx
|
|
|
|
|
pop ebx
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Roasting password
|
|
|
|
|
; EAX = offset password
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
roast:
|
|
|
|
|
pushf
|
|
|
|
|
push ecx
|
|
|
|
|
push ebx
|
|
|
|
|
|
|
|
|
|
xor ecx, ecx
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
|
|
|
|
|
loop_r:
|
|
|
|
|
mov bl, [eax+ecx] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>ᨢ<EFBFBD> <20><><EFBFBD>
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp bl, 0 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz r_fin
|
|
|
|
|
|
|
|
|
|
xor bl, [ROASTING_ARRAY+ecx]
|
|
|
|
|
mov [eax+ecx], bl
|
|
|
|
|
inc ecx
|
|
|
|
|
jmp loop_r
|
|
|
|
|
|
|
|
|
|
r_fin:
|
|
|
|
|
pop ebx
|
|
|
|
|
pop ecx
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
;Copy string of bytes
|
|
|
|
|
;<3B> EAX = <20><><EFBFBD><EFBFBD><EFBFBD> <20><>室<EFBFBD><E5AEA4><EFBFBD> <20><>ப<EFBFBD>
|
|
|
|
|
;<3B> EBX = <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD>
|
|
|
|
|
;<3B> ECX = <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
strcpy:
|
|
|
|
|
pushf
|
|
|
|
|
push esi
|
|
|
|
|
push edi
|
|
|
|
|
push ecx
|
|
|
|
|
|
|
|
|
|
cld ;<3B><>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0> <20><>ப<EFBFBD> <20><> <20><>砫<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov esi, eax
|
|
|
|
|
mov edi, ebx
|
|
|
|
|
|
|
|
|
|
rep movsb
|
|
|
|
|
|
|
|
|
|
pop ecx
|
|
|
|
|
pop edi
|
|
|
|
|
pop esi
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD> <20><>ப
|
|
|
|
|
;
|
|
|
|
|
macro strcmp first, second, len
|
|
|
|
|
{
|
|
|
|
|
push ecx
|
|
|
|
|
push esi
|
|
|
|
|
push edi
|
|
|
|
|
|
|
|
|
|
mov ecx, len
|
|
|
|
|
mov esi, first
|
|
|
|
|
mov edi, second
|
|
|
|
|
repe cmpsb
|
|
|
|
|
|
|
|
|
|
pop edi
|
|
|
|
|
pop esi
|
|
|
|
|
pop ecx
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ebx
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>묨, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> eax, <20>
|
|
|
|
|
; cx - <20><><EFBFBD> TLV
|
|
|
|
|
; dx - <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
tlvstr:
|
|
|
|
|
;pushf
|
|
|
|
|
push edx
|
|
|
|
|
push ecx
|
|
|
|
|
push ebx
|
|
|
|
|
|
|
|
|
|
mov [ebx], ch ; Type
|
|
|
|
|
mov [ebx+1], cl
|
|
|
|
|
|
|
|
|
|
mov [ebx+2], dh ; Length
|
|
|
|
|
mov [ebx+3], dl
|
|
|
|
|
|
|
|
|
|
lea ebx, [ebx+4]
|
|
|
|
|
; EBX = offset of destination
|
|
|
|
|
mov ecx, edx
|
|
|
|
|
|
|
|
|
|
call strcpy
|
|
|
|
|
|
|
|
|
|
pop ebx
|
|
|
|
|
pop ecx
|
|
|
|
|
pop edx
|
|
|
|
|
;popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; eax - 㪠<><E3AAA0>⥫<EFBFBD> <20><> FLAP_head
|
|
|
|
|
; ebx - 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD>ᨢ, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>묨
|
|
|
|
|
; ecx - 奭<><E5A5AD> ᮪<><E1AEAA><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
; <20> eax <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>頥<EFBFBD> १<><E0A5A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ᮪<><E1AEAA>
|
|
|
|
|
;
|
|
|
|
|
sendflap:
|
|
|
|
|
pushf
|
|
|
|
|
push edx
|
|
|
|
|
;push ecx
|
|
|
|
|
push esi
|
|
|
|
|
push ebx
|
|
|
|
|
push ecx
|
|
|
|
|
|
|
|
|
|
xor edx, edx
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov dl, [eax] ; ID byte
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [sbuff], dl
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov dl, [eax+1] ; FLAP channel
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [sbuff+1], dl
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov dl, [eax+2] ; FLAP datagramm seq number
|
|
|
|
|
mov [sbuff+3], dl ; <20><><EFBFBD>塞 <20><><EFBFBD>⠬<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>।<EFBFBD><E0A5A4><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov dl, [eax+3]
|
|
|
|
|
mov [sbuff+2], dl
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov dl, [eax+4] ; FLAP data size
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [sbuff+5], dl
|
|
|
|
|
mov dl, [eax+5]
|
|
|
|
|
mov [sbuff+4], dl
|
|
|
|
|
mov dx, word [eax+4]
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
xchg ecx, edx ; ecx - size edx - handle
|
|
|
|
|
mov eax, ebx ; data
|
|
|
|
|
mov ebx, sbuff ; dest
|
|
|
|
|
add ebx, 6 ; + header size
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call strcpy
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
xchg ecx, edx ; ecx - handle, edx - data size
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
s_wait:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 53 ; <20><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> ᮪<><E1AEAA><EFBFBD>. <20> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;mov ebx, 6 ; <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD>뫠<EFBFBD><EBABA0> <20><><EFBFBD><EFBFBD><EFBFBD>, <20> ᮪<><E1AEAA> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>室<EFBFBD><E5AEA4>
|
|
|
|
|
;int 40h
|
|
|
|
|
mcall 53, 6, ecx
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp eax, TCB_ESTABLISHED ; <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jz s_est
|
|
|
|
|
cmp eax, TCB_CLOSED
|
|
|
|
|
jz s_fin
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp eax, 12 ; <20> <20><><EFBFBD><EFBFBD> ⠪<><E2A0AA> <20>뫮, <20><><EFBFBD><EFBFBD><EFBFBD> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>⮩ :-)
|
|
|
|
|
jnc s_fin ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 5
|
|
|
|
|
;mov ebx, 1
|
|
|
|
|
;int 40h ; <20><><EFBFBD><EFBFBD>
|
|
|
|
|
mcall 5, 1
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jmp s_wait
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
s_est:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 53
|
|
|
|
|
;mov ebx, 7 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ᮪<><E1AEAA>
|
|
|
|
|
|
|
|
|
|
add edx, 6 ; + size of header
|
|
|
|
|
;mov esi, sbuff ; data
|
|
|
|
|
;int 40h
|
|
|
|
|
mcall 53, 7, ecx, edx, sbuff
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
s_fin:
|
|
|
|
|
pop ecx
|
|
|
|
|
pop ebx
|
|
|
|
|
pop esi
|
|
|
|
|
;pop ecx
|
|
|
|
|
pop edx
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; eax - 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; ebx - <20><><EFBFBD>祭<EFBFBD><E7A5AD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4><EFBFBD> <20><>⮫<EFBFBD><E2AEAB><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⮫쪮 bl
|
|
|
|
|
; ecx - ࠧ<><E0A0A7><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
memset:
|
|
|
|
|
pushf
|
|
|
|
|
push edi
|
|
|
|
|
push eax
|
|
|
|
|
push ebx
|
|
|
|
|
push ecx
|
|
|
|
|
|
|
|
|
|
cld
|
|
|
|
|
mov edi, eax
|
|
|
|
|
mov eax, ebx
|
|
|
|
|
rep stosb
|
|
|
|
|
|
|
|
|
|
pop ecx
|
|
|
|
|
pop ebx
|
|
|
|
|
pop eax
|
|
|
|
|
pop edi
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD>ᨬ TLV
|
|
|
|
|
; <-- <20> eax <20><><EFBFBD><EFBFBD><EFBFBD> TLV
|
|
|
|
|
; <-- <20> ebx <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㦭<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; --> <20> ebx <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; --> <20> eax ⨯ TLV
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
tlvpar:
|
|
|
|
|
pushf
|
|
|
|
|
;push esi
|
|
|
|
|
;push edi
|
|
|
|
|
push ecx
|
|
|
|
|
xor ecx, ecx
|
|
|
|
|
|
|
|
|
|
mov cl, [eax+3] ;TLV.Length
|
|
|
|
|
mov ch, [eax+2]
|
|
|
|
|
call strcpy
|
|
|
|
|
|
|
|
|
|
xor eax, eax
|
|
|
|
|
mov al, [ebx+1] ;TLV.Type
|
|
|
|
|
mov ah, [ebx]
|
|
|
|
|
mov ebx, ecx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pop ecx
|
|
|
|
|
;pop edi
|
|
|
|
|
;pop esi
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <-- ECX - 奭<><E5A5AD> ᮪<><E1AEAA><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㦭<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; --> ECX - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
;
|
|
|
|
|
closesocket:
|
|
|
|
|
push eax
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;push ebx
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 53
|
|
|
|
|
;mov ebx, 8
|
|
|
|
|
;int 40h
|
|
|
|
|
mcall 53, 8, ecx
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;pop ebx
|
2011-02-02 12:52:07 +03:00
|
|
|
|
pop eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; ecx <-- 奭<><E5A5AD> ᮪<><E1AEAA><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
srv_disconnect:
|
|
|
|
|
pushf
|
|
|
|
|
push eax
|
|
|
|
|
push ebx
|
|
|
|
|
mov [flap.bId], FLAP_ID
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [flap.bCh], 4 ;Disconnect
|
2011-02-02 12:52:07 +03:00
|
|
|
|
xor eax, eax
|
|
|
|
|
mov ax, [seq]
|
|
|
|
|
mov [flap.wSn], ax
|
|
|
|
|
mov [flap.wDs], 0
|
|
|
|
|
mov eax, flap
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
call sendflap
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pop ebx
|
|
|
|
|
pop eax
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <-- eax [bos_address]
|
|
|
|
|
; --> eax = IP ADDRESS
|
|
|
|
|
; --> ebx = port number
|
|
|
|
|
;
|
|
|
|
|
par_buff db 9 dup 0
|
|
|
|
|
|
|
|
|
|
ip_parser:
|
|
|
|
|
pushf
|
|
|
|
|
push ecx
|
|
|
|
|
push edx
|
|
|
|
|
push esi
|
|
|
|
|
push edi
|
|
|
|
|
|
|
|
|
|
xor ecx, ecx
|
|
|
|
|
;xor eax, eax
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ebx, eax
|
2011-02-02 12:52:07 +03:00
|
|
|
|
xor edx, edx
|
|
|
|
|
xor esi, esi
|
|
|
|
|
xor edi, edi
|
|
|
|
|
|
|
|
|
|
ip_loop:
|
|
|
|
|
xor eax, eax
|
|
|
|
|
;xor edx, edx
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov al, [ebx+ecx]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp al, '.'
|
|
|
|
|
jz ip_dot
|
|
|
|
|
|
|
|
|
|
cmp al, 0
|
|
|
|
|
jz ip_end_str
|
|
|
|
|
|
|
|
|
|
cmp al, ':'
|
|
|
|
|
jz ip_colon
|
|
|
|
|
|
|
|
|
|
;sub al, 30h
|
|
|
|
|
;cmp al, 9
|
|
|
|
|
;ja ip_err ; <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
mov [par_buff+edx], al
|
|
|
|
|
inc ecx
|
|
|
|
|
inc edx
|
|
|
|
|
jmp ip_loop
|
|
|
|
|
|
|
|
|
|
ip_dot:
|
|
|
|
|
;xor eax, eax
|
|
|
|
|
mov [par_buff+edx], 0 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|
|
|
|
mov eax, par_buff
|
|
|
|
|
call ascitoint
|
|
|
|
|
|
|
|
|
|
;data_debug 'Debug eax: ', eax
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp ecx, 0 ; <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>稭<EFBFBD><E7A8AD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>窨
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz ip_err
|
2011-10-19 02:58:49 +04:00
|
|
|
|
shl esi, 8 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>।<EFBFBD><E0A5A4><EFBFBD>騩 <20><><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
add esi, eax
|
|
|
|
|
inc ecx
|
|
|
|
|
xor edx, edx ; <20><><EFBFBD><EFBFBD>稪 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = 0
|
|
|
|
|
jmp ip_loop
|
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
ip_colon: ; : <20> <20><>ப<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
inc edi ; <20>뫮 :
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jmp ip_dot
|
|
|
|
|
|
|
|
|
|
ip_end_str:
|
|
|
|
|
cmp edi, 1
|
|
|
|
|
jz @f
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; : <20><> <20>뫮
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [par_buff+edx], 0 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|
|
|
|
mov eax, par_buff
|
|
|
|
|
call ascitoint
|
2011-10-19 02:58:49 +04:00
|
|
|
|
shl esi, 8 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>।<EFBFBD><E0A5A4><EFBFBD>騩 <20><><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
add esi, eax
|
|
|
|
|
;mov eax, esi ; IP <20> 16 <20><>筮<EFBFBD> <20><>ଥ
|
2011-10-19 02:58:49 +04:00
|
|
|
|
xor ebx, ebx ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jmp ip_end
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
@@: ; <20>뫮 :
|
|
|
|
|
mov [par_buff+edx], 0
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, par_buff
|
|
|
|
|
call ascitoint
|
|
|
|
|
mov ebx, eax
|
|
|
|
|
jmp ip_end
|
|
|
|
|
|
|
|
|
|
ip_err:
|
|
|
|
|
xor esi, esi
|
|
|
|
|
|
|
|
|
|
ip_end:
|
|
|
|
|
mov eax, esi
|
|
|
|
|
|
|
|
|
|
pop edi
|
|
|
|
|
pop esi
|
|
|
|
|
pop edx
|
|
|
|
|
pop ecx
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <-- eax 㪠<><E3AAA0>⥫<EFBFBD> <20><> asci
|
|
|
|
|
; --> eax int
|
|
|
|
|
;
|
|
|
|
|
ascitoint:
|
|
|
|
|
pushf
|
|
|
|
|
push ebx
|
|
|
|
|
push ecx
|
|
|
|
|
push edx
|
|
|
|
|
push esi
|
|
|
|
|
push edi
|
|
|
|
|
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
xor ecx, ecx
|
|
|
|
|
xor edx, edx
|
|
|
|
|
;xor esi, esi
|
|
|
|
|
xor edi, edi
|
|
|
|
|
|
|
|
|
|
ati_loop:
|
|
|
|
|
mov bl, [eax+ecx]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp bl, 0 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz ati_str_end
|
|
|
|
|
cmp bl, 39h
|
2011-10-19 02:58:49 +04:00
|
|
|
|
ja ati_err ; <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp bl, 30h
|
|
|
|
|
jb ati_err
|
|
|
|
|
|
|
|
|
|
inc ecx
|
|
|
|
|
jmp ati_loop
|
|
|
|
|
|
|
|
|
|
ati_str_end: ; <20> ecx <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|
|
|
|
;dec ecx ; <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD>
|
|
|
|
|
add eax, ecx ; <20><><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD> <20><> <20><>ப<EFBFBD> + <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|
|
|
|
dec eax
|
|
|
|
|
|
|
|
|
|
ati_loop2:
|
|
|
|
|
cmp edx, ecx
|
|
|
|
|
jz ati_all
|
|
|
|
|
push eax
|
2011-10-19 02:58:49 +04:00
|
|
|
|
sub eax, edx ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>稪
|
2011-02-02 12:52:07 +03:00
|
|
|
|
movzx ebx, byte [eax] ; <20> bl ᨬ<><E1A8AC><EFBFBD>
|
|
|
|
|
;pop eax
|
|
|
|
|
sub bl, 30h ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 10<31><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
;push eax
|
|
|
|
|
mov eax, ebx ; <20> eax - <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ebx, 10 ; <20><><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD>
|
|
|
|
|
|
|
|
|
|
xor esi, esi
|
|
|
|
|
|
|
|
|
|
ati_mul:
|
|
|
|
|
|
|
|
|
|
cmp esi, edx ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 10 n ࠧ
|
|
|
|
|
jz ati_mul_end
|
|
|
|
|
;push eax
|
|
|
|
|
;mov eax, ebx
|
|
|
|
|
imul eax, ebx
|
|
|
|
|
;mov ebx, eax
|
|
|
|
|
;pop eax
|
|
|
|
|
inc esi
|
|
|
|
|
jmp ati_mul
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ati_mul_end:
|
|
|
|
|
mov ebx, eax ; <20> ebx <20><><EFBFBD><EFBFBD><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20><>
|
|
|
|
|
pop eax
|
|
|
|
|
|
|
|
|
|
add edi, ebx
|
|
|
|
|
inc edx
|
|
|
|
|
jmp ati_loop2
|
|
|
|
|
|
|
|
|
|
ati_all:
|
|
|
|
|
mov eax, edi
|
|
|
|
|
jmp ati_end
|
|
|
|
|
|
|
|
|
|
ati_err:
|
|
|
|
|
|
|
|
|
|
;ati_str_end:
|
|
|
|
|
xor eax, eax
|
|
|
|
|
|
|
|
|
|
ati_end:
|
|
|
|
|
pop edi
|
|
|
|
|
pop esi
|
|
|
|
|
pop edx
|
|
|
|
|
pop ecx
|
|
|
|
|
pop ebx
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
; <-- ecx 奭<><E5A5AD> ᮪<><E1AEAA><EFBFBD>
|
|
|
|
|
; <-- eax 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SNAC_head
|
|
|
|
|
; <-- ebx 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <-- edx ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; --> eax १<><E0A5A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ᮪<><E1AEAA>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
snac_buff db 1024 dup 0
|
|
|
|
|
|
|
|
|
|
sendsnac:
|
|
|
|
|
pushf
|
|
|
|
|
push esi
|
|
|
|
|
push edi
|
|
|
|
|
push ebx
|
|
|
|
|
push edx
|
|
|
|
|
;xor ebx, ebx
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov esi, ecx ; 奭<><E5A5AD> ᮪<><E1AEAA><EFBFBD>
|
|
|
|
|
mov edi, ebx ; <20><><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
xor ebx, ebx
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov bl, [eax] ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [snac_buff+1], bl ; Family ID
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov bl, [eax+1] ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> BigEndian
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [snac_buff], bl ;
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov bl, [eax+2] ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [snac_buff+3], bl ; Subtype ID
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov bl, [eax+3] ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [snac_buff+2], bl ;
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov bl, [eax+4] ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [snac_buff+5], bl ;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov bl, [eax+5] ; Flags
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [snac_buff+4], bl ;
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov bl, [eax+6] ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [snac_buff+9], bl ;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov bl, [eax+7] ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [snac_buff+8], bl ;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov bl, [eax+8] ; Reqest ID
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [snac_buff+7], bl ;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov bl, [eax+9] ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [snac_buff+6], bl ;
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea ebx, [snac_buff+10]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov eax, edi ; <20><><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;add ebx, 10 ; + ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SNAC
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ecx, edx ; ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call strcpy
|
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ecx, esi ; <20><><EFBFBD><EFBFBD><EFBFBD> ᮪<><E1AEAA><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [flap.bId], FLAP_ID
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [flap.bCh], 2 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>뫪<EFBFBD> SNAC
|
2011-02-02 12:52:07 +03:00
|
|
|
|
xor ebx, ebx
|
2011-10-19 02:58:49 +04:00
|
|
|
|
inc [seq] ; seq <20><><EFBFBD><EFBFBD><EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD><EFBFBD><EFBFBD> <20><> 1 <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>뫪<EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov bx, [seq]
|
|
|
|
|
mov [flap.wSn], bx
|
2011-10-19 02:58:49 +04:00
|
|
|
|
add edx, 10 ; ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> + ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SNAC
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [flap.wDs], dx
|
|
|
|
|
mov eax, flap
|
|
|
|
|
mov ebx, snac_buff
|
|
|
|
|
call sendflap
|
|
|
|
|
|
|
|
|
|
pop edx
|
|
|
|
|
pop ebx
|
|
|
|
|
pop edi
|
|
|
|
|
pop esi
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; <20><>ࠡ<EFBFBD>⪠ <20><><EFBFBD><EFBFBD> <20><><EFBFBD>⮢, <20><><EFBFBD>室<EFBFBD><E5AEA4><EFBFBD><EFBFBD> <20><> <20><>ࢥ<EFBFBD><E0A2A5>
|
|
|
|
|
; ECX <-- <20><><EFBFBD><EFBFBD><EFBFBD> ᮪<><E1AEAA><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
main_loop:
|
|
|
|
|
pushf
|
|
|
|
|
;push eax
|
|
|
|
|
;push ebx
|
|
|
|
|
;push edx
|
|
|
|
|
pushad
|
|
|
|
|
|
|
|
|
|
mov ecx, [socket]
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
;m_loop:
|
|
|
|
|
;mov eax, 53
|
|
|
|
|
;mov ebx, 2
|
|
|
|
|
;int 40h
|
|
|
|
|
;cmp eax, 6 ; ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FLAP
|
|
|
|
|
;jnc recived ; >=
|
|
|
|
|
;
|
|
|
|
|
; <20>室<EFBFBD><E5AEA4>
|
|
|
|
|
;
|
|
|
|
|
;jmp m_fin
|
|
|
|
|
;mov eax, 5
|
|
|
|
|
;mov ebx, 5
|
|
|
|
|
;int 40h
|
|
|
|
|
;jmp m_loop
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
;recived:
|
|
|
|
|
;mov eax, rflap
|
|
|
|
|
;mov ebx, rbuff
|
|
|
|
|
;call recvflap
|
|
|
|
|
;
|
|
|
|
|
; <20><>।<EFBFBD><E0A5A4>塞 ⨯ <20>ਭ<EFBFBD>⮣<EFBFBD> FLAP
|
|
|
|
|
;
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
mov bl, [rflap.bCh]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp bl, 1 ; <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jz m_login
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp bl, 2
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz m_snac ; <20><><EFBFBD><EFBFBD>祭 SNAC
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp bl, 3
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz m_flap_err ; FLAP-level error
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp bl, 4
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz m_close_conn ; <20><><EFBFBD><EFBFBD><EFBFBD>⨥ ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp bl, 5
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz m_keep_alive ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
; <20><>ࠡ<EFBFBD>⪠ <20><><EFBFBD>ᮥ<EFBFBD><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
m_close_conn:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
write_debug 'Another Computer Use YOUR UIN!'
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call srv_disconnect
|
|
|
|
|
call closesocket
|
|
|
|
|
jmp m_fin
|
|
|
|
|
;
|
|
|
|
|
; <20><>ࠡ<EFBFBD>⪠ ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
m_login:
|
|
|
|
|
;
|
|
|
|
|
; <20><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⮪<EFBFBD><E2AEAA><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
xor eax, eax
|
|
|
|
|
mov al, [mbuff+3]
|
|
|
|
|
cmp eax, 1
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jnz m_login_other ; <20><> <20><><EFBFBD>室<EFBFBD><E5AEA4>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㥬 <20><><EFBFBD>砩<EFBFBD><E7A0A9><EFBFBD> seq
|
|
|
|
|
; <20><><EFBFBD> <20>⮣<EFBFBD> <20><>६ <20>६<EFBFBD>, <20><><EFBFBD>襤襥 <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>᪠ <20><><EFBFBD>⥬<EFBFBD>
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 26
|
|
|
|
|
;mov ebx, 9
|
|
|
|
|
;int 40h
|
|
|
|
|
mcall 26, 9
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [seq], ax
|
|
|
|
|
;
|
|
|
|
|
; <20>⤠<EFBFBD><E2A4A0> <20><>ࢥ<EFBFBD><E0A2A5> cookie
|
|
|
|
|
;
|
|
|
|
|
mov [flap.bCh], 1
|
|
|
|
|
mov [flap.wSn], ax
|
|
|
|
|
xor eax, eax
|
|
|
|
|
mov ax, [cookie_len]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
add eax, 8 ; TLV len + protocol version len
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [flap.wDs], ax
|
|
|
|
|
mov dword [buff], 01000000h ; 00 00 00 01 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⮪<EFBFBD><E2AEAA><EFBFBD>
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov word [buff+4], 0600h ; 00 06 TLV.Type
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov ax, [cookie_len]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [buff+6], ah ;
|
|
|
|
|
mov [buff+7], al ; TLV.Length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov edx, ecx ; edx <-- socket handle
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ecx, eax ; ecx <-- cookie len
|
|
|
|
|
mov eax, srv_cookie ; Src
|
2011-02-02 12:52:07 +03:00
|
|
|
|
lea ebx, [buff+8]
|
|
|
|
|
call strcpy
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ecx, edx ; ecx <-- socket handle
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, flap
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
call sendflap
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
m_login_other:
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD> <20><>ࠡ<EFBFBD><E0A0A1><EFBFBD><EFBFBD><EFBFBD> <20>訡<EFBFBD><E8A8A1>, <20> <20><> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
m_flap_err:
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD> <20><> <20><>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
m_keep_alive:
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>祭 SNAC
|
|
|
|
|
; <20><>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ⨯
|
|
|
|
|
;
|
|
|
|
|
m_snac:
|
|
|
|
|
mov eax, rsnac
|
|
|
|
|
mov ebx, mbuff
|
|
|
|
|
call snacpar
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
xor edx, edx
|
|
|
|
|
mov bx, [rsnac.wFid]
|
|
|
|
|
mov dx, [rsnac.wSid]
|
|
|
|
|
|
|
|
|
|
cmp bx, 1
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz m_snac_1 ;Generic service controls
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp bx, 2
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz m_snac_2 ;Location services
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp bx, 3
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz m_snac_3 ;Buddy List management service
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp bx, 4
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz m_snac_4 ;ICBM (messages) service
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp bx, 9
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz m_snac_9 ;Privacy management service
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp bx, 015h
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz m_snac_15 ;ICQ specific extensions service
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp bx, 013h
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz m_snac_13 ;Server Side Information (SSI) service
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
jmp m_other_snac
|
|
|
|
|
;
|
|
|
|
|
; FAMILY 1
|
|
|
|
|
;
|
|
|
|
|
m_snac_1:
|
|
|
|
|
cmp dx, 7
|
|
|
|
|
jz m_snac_1_7
|
|
|
|
|
cmp dx, 3
|
|
|
|
|
jz m_snac_1_3
|
|
|
|
|
cmp dx, 018h
|
|
|
|
|
jz m_snac_1_18
|
|
|
|
|
cmp dx, 01Fh
|
|
|
|
|
jz m_snac_1_f
|
|
|
|
|
cmp dx, 13h
|
|
|
|
|
jz m_snac_13
|
|
|
|
|
cmp dx, 1
|
|
|
|
|
jz m_snac_1_1
|
|
|
|
|
jmp m_snac_1_other
|
|
|
|
|
;
|
|
|
|
|
; Rate limits information response
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
m_snac_1_7: ; <20>⢥砥<E2A2A5>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [ssnac.wFid], 1 ; Family
|
|
|
|
|
mov [ssnac.wSid], 8 ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 8
|
|
|
|
|
mov word [buff], 0100h ; 0001
|
|
|
|
|
mov word [buff+2], 0200h ; 0002
|
|
|
|
|
mov word [buff+4], 0300h ; 0003
|
|
|
|
|
mov word [buff+6], 0400h ; 0004
|
|
|
|
|
mov word [buff+8], 0500h ; 0005
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov edx, 10 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call sendsnac
|
|
|
|
|
;
|
|
|
|
|
; Client ask server location service limitations
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 2 ; Family
|
|
|
|
|
mov [ssnac.wSid], 2 ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 2
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
xor edx, edx
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Server supported snac families list
|
|
|
|
|
;
|
|
|
|
|
m_snac_1_3:
|
|
|
|
|
;
|
|
|
|
|
; Server sends supported services list
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; SNAC(01,17)
|
2011-02-02 12:52:07 +03:00
|
|
|
|
; Client ask for services version numbers
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 1 ; Family
|
|
|
|
|
mov [ssnac.wSid], 17h ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 17h
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD>᮪ <20><>ࢨᮢ, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>㦭<EFBFBD>
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; xx xx word family number #1
|
|
|
|
|
; xx xx word family version
|
|
|
|
|
; ... ... ...
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD>ࠢ<EFBFBD><E0A0A2> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> &RQ
|
|
|
|
|
;
|
|
|
|
|
mov word [buff], 0100h ; 0001
|
|
|
|
|
mov word [buff+2], 0300h ; 0003
|
|
|
|
|
|
|
|
|
|
mov word [buff+4], 1300h ; 0013
|
|
|
|
|
mov word [buff+6], 0200h ; 0002
|
|
|
|
|
|
|
|
|
|
mov word [buff+8], 0200h ; 0002
|
|
|
|
|
mov word [buff+10], 0100h ; 0001
|
|
|
|
|
|
|
|
|
|
mov word [buff+12], 0300h ; 0002
|
|
|
|
|
mov word [buff+14], 0100h ; 0001
|
|
|
|
|
|
|
|
|
|
mov word [buff+16], 1500h ; 0015
|
|
|
|
|
mov word [buff+18], 0100h ; 0001
|
|
|
|
|
|
|
|
|
|
mov word [buff+20], 0400h ; 0004
|
|
|
|
|
mov word [buff+22], 0100h ; 0001
|
|
|
|
|
|
|
|
|
|
mov word [buff+24], 0600h ; 0006
|
|
|
|
|
mov word [buff+26], 0100h ; 0001
|
|
|
|
|
|
|
|
|
|
mov word [buff+28], 0900h ; 0009
|
|
|
|
|
mov word [buff+30], 0100h ; 0001
|
|
|
|
|
|
|
|
|
|
mov word [buff+32], 1300h ; 0013
|
|
|
|
|
mov word [buff+34], 0400h ; 0004
|
|
|
|
|
|
|
|
|
|
mov word [buff+36], 1500h ; 0015
|
|
|
|
|
mov word [buff+38], 0400h ; 0004
|
|
|
|
|
|
|
|
|
|
mov word [buff+40], 1000h ; 0010
|
|
|
|
|
mov word [buff+42], 0100h ; 0001
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
mov edx, 44
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Server services versions
|
|
|
|
|
;
|
|
|
|
|
m_snac_1_18:
|
|
|
|
|
;
|
|
|
|
|
; <20><>ࠡ<EFBFBD>⪨ <20><><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Client ask server for rate limits info
|
|
|
|
|
; SNAC(01,06)
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 1 ; Family
|
|
|
|
|
mov [ssnac.wSid], 6 ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 6
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
xor edx, edx
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Requested online info response
|
|
|
|
|
;
|
|
|
|
|
m_snac_1_f:
|
|
|
|
|
;
|
|
|
|
|
;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><>ࠡ<EFBFBD>⪨ <20><><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Message of the day (MOTD)
|
|
|
|
|
;
|
|
|
|
|
m_snac_1_13:
|
|
|
|
|
;
|
|
|
|
|
; <20><>祣<EFBFBD> <20><>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0> :-))
|
|
|
|
|
;
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>饭<EFBFBD><E9A5AD> <20><> <20>訡<EFBFBD><E8A8A1>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
m_snac_1_1:
|
|
|
|
|
xor eax, eax
|
|
|
|
|
mov ax, word [mbuff+10]
|
|
|
|
|
call ntohs
|
|
|
|
|
data_debug 'SERVER SEND ERROR #', eax
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_snac_1_other:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
data_debug 'Unknown SNAC Family 1 recived, type ', edx
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Family 2
|
|
|
|
|
;
|
|
|
|
|
m_snac_2:
|
|
|
|
|
cmp dx, 3
|
|
|
|
|
jz m_snac_2_3
|
|
|
|
|
jmp m_snac_2_other
|
|
|
|
|
;
|
|
|
|
|
; Server replies via location service limitations
|
|
|
|
|
;
|
|
|
|
|
m_snac_2_3:
|
|
|
|
|
;
|
|
|
|
|
; <20><>ࠡ<EFBFBD>⪨ <20><><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD>뫠<EFBFBD><EBABA0> capabilities / profile
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 2 ; Family
|
|
|
|
|
mov [ssnac.wSid], 4 ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 4
|
|
|
|
|
|
|
|
|
|
;mov eax, CAPABILITIES
|
|
|
|
|
;mov ebx, buff
|
|
|
|
|
;push ecx
|
|
|
|
|
;mov ecx, 5 ; TLV.Type(0x05) - CLSID values
|
|
|
|
|
;mov edx, C_LEN
|
|
|
|
|
;call tlvstr
|
|
|
|
|
;pop ecx
|
|
|
|
|
mov word [buff], 0500h ; 00 05
|
|
|
|
|
mov eax, C_LEN
|
|
|
|
|
call htons
|
|
|
|
|
mov word [buff+2], ax
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
push ecx
|
|
|
|
|
|
|
|
|
|
mov eax, CAPABILITIES
|
|
|
|
|
lea ebx, [buff+4]
|
|
|
|
|
mov ecx, C_LEN
|
|
|
|
|
call strcpy
|
|
|
|
|
|
|
|
|
|
pop ecx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov edx, C_LEN+4 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TLV
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> server BLM service limitations
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 3 ; Family
|
|
|
|
|
mov [ssnac.wSid], 2 ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 2
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
xor edx, edx
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
m_snac_2_other:
|
|
|
|
|
write_debug 'Unknown SNAC Family 2 Recived'
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; FAMILY 3
|
|
|
|
|
;
|
|
|
|
|
m_snac_3:
|
|
|
|
|
cmp dx, 3
|
|
|
|
|
jz m_snac_3_3
|
|
|
|
|
cmp dx, 0Bh
|
|
|
|
|
jz m_snac_3_b
|
|
|
|
|
cmp dx, 0Ch
|
|
|
|
|
jz m_snac_3_c
|
|
|
|
|
jmp m_snac_3_other
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Server replies via BLM service limitations
|
|
|
|
|
;
|
|
|
|
|
m_snac_3_3:
|
|
|
|
|
;
|
|
|
|
|
; <20><>ࠡ<EFBFBD>⪨ <20><><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Client ask server for ICBM service parameters
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 4 ; Family
|
|
|
|
|
mov [ssnac.wSid], 4 ; Subtype
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [ssnac.dRi], 4 ; request-id
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
xor edx, edx
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; User online notification
|
|
|
|
|
;
|
|
|
|
|
m_snac_3_b:
|
|
|
|
|
;
|
|
|
|
|
; <20><> <20>ᥩ <20><><EFBFBD><EFBFBD>ଠ樨 <20><><EFBFBD><EFBFBD> <20>㦥<EFBFBD> ⮫쪮 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
xor edx, edx ; <20><><EFBFBD><EFBFBD>稪 - <20><><EFBFBD><EFBFBD><EFBFBD> UIN <20> <20><><EFBFBD>ᨢ<EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
xor ecx, ecx
|
|
|
|
|
xor eax, eax
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cld ; <20> <20><><EFBFBD>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD> 㢥<><E3A2A5>祭<EFBFBD><E7A5AD> <20><><EFBFBD><EFBFBD>ᮢ
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
dec edx
|
|
|
|
|
m_snac_3_b_loop:
|
|
|
|
|
inc edx
|
|
|
|
|
cmp edx, UINS
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jnc m_snac_3_b_end ;>=
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov cl, [mbuff+10] ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, ecx
|
|
|
|
|
mov edi, UIN_LEN
|
2011-10-19 02:58:49 +04:00
|
|
|
|
imul edi, edx
|
2011-02-02 12:52:07 +03:00
|
|
|
|
lea edi, [uins+edi]
|
|
|
|
|
lea esi, [mbuff+11]
|
|
|
|
|
repe cmpsb
|
|
|
|
|
|
|
|
|
|
jnz m_snac_3_b_loop
|
|
|
|
|
;
|
|
|
|
|
; UIN <20><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD> TLV <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ᮬ
|
|
|
|
|
; <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> edx
|
|
|
|
|
|
|
|
|
|
xor esi, esi ; <20><><EFBFBD><EFBFBD>稪 TLV
|
|
|
|
|
|
|
|
|
|
xor ecx, ecx
|
|
|
|
|
mov ch, byte [mbuff + eax + 13] ; <20><><EFBFBD>-<2D><> TLV <20> 楯<>窥
|
|
|
|
|
mov cl, byte [mbuff + eax + 14] ;
|
|
|
|
|
|
|
|
|
|
lea eax, [eax + 10 + 5] ; eax 㪠<><E3AAA0>⥫<EFBFBD> <20><> 楯<><E6A5AF><EFBFBD><EFBFBD> TLV
|
|
|
|
|
lea eax, [mbuff + eax] ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_snac_3_b_next_tlv:
|
|
|
|
|
cmp esi, ecx
|
|
|
|
|
jz m_snac_3_b_endchain
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
mov bh, [eax] ;
|
|
|
|
|
mov bl, [eax + 1] ; TLV.Type
|
|
|
|
|
|
|
|
|
|
data_debug 'TLV type', ebx
|
|
|
|
|
|
|
|
|
|
cmp ebx, 0x06 ;TLV.Type(0x06) - user status
|
|
|
|
|
jz m_snac_3_b_status
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>ࠥ<EFBFBD> 楯<><E6A5AF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
get_next_tlv
|
|
|
|
|
inc esi
|
|
|
|
|
jmp m_snac_3_b_next_tlv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; FIXME <20><><EFBFBD><EFBFBD>⨬<EFBFBD><E2A8AC>쭮 - <20><><EFBFBD> <20>㤥<EFBFBD> 㤠<><E3A4A0><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
;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
|
|
|
|
|
;jz m_snac_3_b_extip
|
|
|
|
|
;jmp m_snac_3_b_bad_tlv
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;m_snac_3_b_dc:
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
; <20>ய<EFBFBD>᪠<EFBFBD><E1AAA0> <20><><EFBFBD><EFBFBD> TLV
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;lea ecx, [ecx+41]
|
|
|
|
|
;m_snac_3_b_extip:
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
; <20> <20><><EFBFBD><EFBFBD> :-)
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;lea ecx, [ecx+8]
|
|
|
|
|
;mov ax, word [mbuff+ecx]
|
|
|
|
|
;cmp ax, 0600h ;TLV.Type(0x0A) - external ip address
|
|
|
|
|
;jz m_snac_3_b_status
|
|
|
|
|
;jmp m_snac_3_b_bad_tlv
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
m_snac_3_b_status:
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ecx, eax
|
|
|
|
|
mov eax, dword [ecx + 4]
|
|
|
|
|
;mov eax, dword [mbuff+ecx+4]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call ntohl
|
|
|
|
|
;mov ebx, 4
|
|
|
|
|
;imul ebx, edx
|
|
|
|
|
;mov [stats+ebx], eax
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
mov ebx, NAME_LEN
|
|
|
|
|
imul ebx, edx
|
|
|
|
|
lea ebx, [names+ebx]
|
|
|
|
|
mov eax, edx
|
|
|
|
|
call loadbb
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_snac_3_b_bad_tlv:
|
|
|
|
|
write_debug 'TLV Type Mismatch in SNAC(3,b)'
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
m_snac_3_b_end:
|
|
|
|
|
write_debug 'UIN not in local Contact List'
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
m_snac_3_b_endchain:
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_snac_3_c:
|
|
|
|
|
;
|
|
|
|
|
; User offline notification
|
|
|
|
|
;
|
|
|
|
|
xor edx, edx
|
|
|
|
|
xor ecx, ecx
|
|
|
|
|
|
|
|
|
|
dec edx
|
|
|
|
|
m_snac_3_c_loop:
|
|
|
|
|
inc edx
|
|
|
|
|
cmp edx, UINS
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jnc m_snac_3_b_end ;>=
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov cl, [mbuff+10] ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov edi, UIN_LEN
|
|
|
|
|
imul edi ,edx
|
|
|
|
|
lea edi, [uins+edi]
|
|
|
|
|
lea esi, [mbuff+11]
|
|
|
|
|
repe cmpsb
|
|
|
|
|
jnz m_snac_3_c_loop
|
|
|
|
|
;
|
|
|
|
|
; UIN <20><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
;mov eax, -1
|
|
|
|
|
;mov ebx, 4
|
|
|
|
|
;imul ebx, edx
|
|
|
|
|
;mov [stats+ebx], eax
|
|
|
|
|
mov ecx, -1
|
|
|
|
|
mov ebx, NAME_LEN
|
|
|
|
|
imul ebx, edx
|
|
|
|
|
lea ebx, [names+ebx]
|
|
|
|
|
mov eax, edx
|
|
|
|
|
call loadbb
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_snac_3_other:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
write_debug 'Unknown SNAC Family 3 Recived'
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; FAMILY 4
|
|
|
|
|
;
|
|
|
|
|
m_snac_4:
|
|
|
|
|
cmp dx, 5
|
|
|
|
|
jz m_snac_4_5
|
|
|
|
|
cmp dx, 7
|
|
|
|
|
jz m_snac_4_7
|
|
|
|
|
jmp m_snac_4_other
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Server sends ICBM service parameters to client
|
|
|
|
|
;
|
|
|
|
|
m_snac_4_5:
|
|
|
|
|
;
|
|
|
|
|
; <20><>ࠡ<EFBFBD>⪨ <20><><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Client change default ICBM parameters command
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 4 ; Family
|
|
|
|
|
mov [ssnac.wSid], 2 ; Subtype
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [ssnac.dRi], 2 ; request-id
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov eax, ICBM_PARAMS
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
push ecx
|
|
|
|
|
mov ecx, ICBMP_LEN
|
|
|
|
|
call strcpy
|
|
|
|
|
pop ecx
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
mov edx, ICBMP_LEN
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Client ask server PRM service limitations
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 9 ; Family
|
|
|
|
|
mov [ssnac.wSid], 2 ; Subtype
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [ssnac.dRi], 2 ; request-id
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
xor edx, edx
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Message for client from server
|
|
|
|
|
;
|
|
|
|
|
m_snac_4_7:
|
|
|
|
|
;
|
|
|
|
|
; <20><>।<EFBFBD><E0A5A4>塞 ⨯ ᮮ<>饭<EFBFBD><E9A5AD> <20><> <20><><EFBFBD><EFBFBD> message channel
|
|
|
|
|
;
|
|
|
|
|
xor eax, eax
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ax, word [mbuff+10+8] ; +10 - ࠧ<><E0A0A7><EFBFBD> SNAC
|
|
|
|
|
; +8 ᬥ饭<E1ACA5><E9A5AD> <20><> message channel
|
|
|
|
|
cmp ax, 0100h ; 00 01
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz m_snac_ch1
|
|
|
|
|
cmp ax, 0200h
|
|
|
|
|
jz m_snac_ch2
|
|
|
|
|
cmp ax, 0400h
|
|
|
|
|
jz m_snac_ch4
|
|
|
|
|
jmp m_ch_other
|
|
|
|
|
;
|
|
|
|
|
; channel 1 plain text
|
|
|
|
|
;
|
|
|
|
|
m_snac_ch1:
|
|
|
|
|
;
|
|
|
|
|
; <20>.<2E> <20> <20><><EFBFBD>।<EFBFBD><E0A5A4><EFBFBD> ࠧ <20><><EFBFBD>ᠭ<EFBFBD><E1A0AD> <20><><EFBFBD>⮪<EFBFBD><E2AEAA><EFBFBD> <20><> ᮢ<><E1AEA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ॠ<>쭮<EFBFBD><ECADAE><EFBFBD><EFBFBD>
|
|
|
|
|
; ࠧ<><E0A0A7>ࠥ<EFBFBD> <20><><EFBFBD> TLV <20><> <20><><EFBFBD>浪<EFBFBD>
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov eax, dword [mbuff+10] ; cookie
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [msg_cookie1], eax
|
|
|
|
|
mov eax, dword [mbuff+10+4]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [msg_cookie2], eax ; <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD> <20>ਥ<EFBFBD><E0A8A5> ᮮ<>饭<EFBFBD><E9A5AD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov al, [mbuff+10+10] ; Sender UIN length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [ui.bUinLength], al
|
|
|
|
|
|
|
|
|
|
push ecx
|
|
|
|
|
movzx ecx, al
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea eax, [mbuff+10+11] ; UIN string
|
|
|
|
|
lea ebx, [ui.bUin] ; Dest
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call strcpy
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea ecx, [ecx+10+15] ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TLV
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_snac_ch1_loop:
|
|
|
|
|
|
|
|
|
|
movzx eax, word [mbuff+ecx]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp eax, 0100h ;TLV.Type(0x01) - user class
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz m_snac_ch1_1
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp eax, 0600h ;TLV.Type(0x06) - user status
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz m_snac_ch1_6
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp eax, 0800h ; Unknown type
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz m_snac_ch1_8
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp eax, 0500h ; Unknown type
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz m_snac_ch1_5
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp eax, 0F00h ; TLV.Type(0x0f) - user idle time
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz m_snac_ch1_f
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp eax, 0300h ; TLV.Type(0x03) - account creation time
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz m_snac_ch1_3
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp eax, 0400h ; TLV.Type(0x04) - automated response flag
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz m_snac_ch1_4
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp eax, 0200h ; TLV.Type(0x02) - message data
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz m_snac_ch1_mess
|
|
|
|
|
jmp m_snac_msg_tlv_err
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫쭠<E2A5AB> <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD> <20>㤥<EFBFBD> <20><>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD>
|
|
|
|
|
; <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|
|
|
|
|
|
|
|
|
m_snac_ch1_1:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
movzx eax, word [mbuff+ecx+2] ; TLV.Length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call ntohs
|
|
|
|
|
lea ecx, [eax+ecx+4]
|
|
|
|
|
jmp m_snac_ch1_loop
|
|
|
|
|
|
|
|
|
|
m_snac_ch1_6:
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov eax, dword [mbuff+ecx+4] ; User status
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call ntohl
|
|
|
|
|
mov [ui.dUserStatus], eax
|
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
movzx eax, word [mbuff+ecx+2] ; TLV.Length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call ntohs
|
|
|
|
|
lea ecx, [eax+ecx+4]
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp m_snac_ch1_loop
|
|
|
|
|
|
|
|
|
|
m_snac_ch1_8:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
movzx eax, word [mbuff+ecx+2] ; TLV.Length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call ntohs
|
|
|
|
|
lea ecx, [eax+ecx+4]
|
|
|
|
|
jmp m_snac_ch1_loop
|
|
|
|
|
|
|
|
|
|
m_snac_ch1_5:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
movzx eax, word [mbuff+ecx+2] ; TLV.Length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call ntohs
|
|
|
|
|
lea ecx, [eax+ecx+4]
|
|
|
|
|
jmp m_snac_ch1_loop
|
|
|
|
|
|
|
|
|
|
m_snac_ch1_f:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
movzx eax, word [mbuff+ecx+2] ; TLV.Length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call ntohs
|
|
|
|
|
lea ecx, [eax+ecx+4]
|
|
|
|
|
jmp m_snac_ch1_loop
|
|
|
|
|
|
|
|
|
|
m_snac_ch1_3:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
movzx eax, word [mbuff+ecx+2] ; TLV.Length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call ntohs
|
|
|
|
|
lea ecx, [eax+ecx+4]
|
|
|
|
|
jmp m_snac_ch1_loop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_snac_ch1_4:
|
|
|
|
|
;movzx eax, word [buff+ecx+2] ; TLV.Length
|
|
|
|
|
lea ecx, [ecx+4]
|
|
|
|
|
jmp m_snac_ch1_loop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_snac_ch1_mess:
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
movzx eax, word [mbuff+ecx+4] ;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp eax, 0105h ; 05 fragment identifier (array of required capabilities)
|
|
|
|
|
jnz m_snac_ch1_fr_err ; 01 fragment version
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
movzx eax, word [mbuff+ecx+6] ; Length
|
|
|
|
|
call ntohs
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea ecx, [ecx+eax+8] ; <20>ய<EFBFBD>᪠<EFBFBD><E1AAA0> byte array of required capabilities (1 - text)
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
movzx eax, word [mbuff+ecx] ; fragment identifier (message text)
|
|
|
|
|
cmp eax, 0101h ; fragment version
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jnz m_snac_ch1_fr_err
|
|
|
|
|
|
|
|
|
|
movzx eax, word [mbuff+ecx+2] ; TLV Length
|
|
|
|
|
call ntohs
|
|
|
|
|
xchg eax, ecx
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea eax, [eax+8] ; <20><>砫<EFBFBD> ⥪<>⮢<EFBFBD><E2AEA2><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD>
|
|
|
|
|
lea ecx, [ecx-4] ; - sizeof Message charset number, Message charset subset
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
push eax
|
|
|
|
|
push ecx
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20>뢮<EFBFBD><EBA2AE><EFBFBD> Message From UIN
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
mov eax, MESS
|
|
|
|
|
call strlen
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
|
|
|
|
|
mov eax, MESS
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
call strcpy
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea ebx, [ebx + ecx]
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>뫮 <20><> <20>뢥<EFBFBD><EBA2A5><EFBFBD> <20><> UIN <20> Nickname, <20> <20><> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD>⠪<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
xor esi, esi ; <20><><EFBFBD><EFBFBD>稪
|
|
|
|
|
|
|
|
|
|
m_snac_ch1_next_uin:
|
|
|
|
|
|
|
|
|
|
cmp esi, UINS
|
|
|
|
|
jz m_snac_ch1_notfound
|
|
|
|
|
|
|
|
|
|
mov edx, UIN_LEN
|
|
|
|
|
imul edx, esi
|
|
|
|
|
|
|
|
|
|
lea edx, [uins + edx]
|
|
|
|
|
movzx ecx, byte [ui.bUinLength]
|
|
|
|
|
strcmp edx, ui.bUin, ecx
|
|
|
|
|
jz m_snac_ch1_uin
|
|
|
|
|
|
|
|
|
|
inc esi
|
|
|
|
|
jmp m_snac_ch1_next_uin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD>室<EFBFBD>騩 UIN <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD>⠪<EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
m_snac_ch1_uin:
|
|
|
|
|
|
|
|
|
|
mov edx, NAME_LEN
|
|
|
|
|
imul edx, esi
|
|
|
|
|
|
|
|
|
|
lea edx, [names + edx]
|
|
|
|
|
mov eax, edx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call strlen
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
|
|
|
|
|
mov eax, edx
|
|
|
|
|
call strcpy
|
|
|
|
|
|
|
|
|
|
jmp m_snac_ch1_msgfrom
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20> <20><><EFBFBD>室<EFBFBD>饣<EFBFBD> UIN <20><><EFBFBD> <20> <20><><EFBFBD>⠪<EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
m_snac_ch1_notfound:
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
lea eax, [ui.bUin]
|
|
|
|
|
movzx ecx, byte [ui.bUinLength]
|
|
|
|
|
call strcpy
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;
|
|
|
|
|
; <20>뢮<EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD> "<22><> <20><><EFBFBD><EFBFBD>"
|
|
|
|
|
;
|
|
|
|
|
m_snac_ch1_msgfrom:
|
|
|
|
|
|
|
|
|
|
mov [ebx + ecx], byte 0
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov eax, buff
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
|
|
|
|
|
call writemsg
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
pop ecx
|
|
|
|
|
pop eax
|
|
|
|
|
lea eax, [mbuff+eax]
|
|
|
|
|
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
call strcpy
|
|
|
|
|
mov [ebx+ecx], byte 0
|
|
|
|
|
|
|
|
|
|
mov eax, buff
|
|
|
|
|
call win2dos
|
|
|
|
|
mov ebx, 00FF0000h
|
|
|
|
|
call writemsg
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD>⢥ত<E2A2A5><E0A6A4><EFBFBD> <20>ਥ<EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
pop ecx
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD> <20><> ॠ<><E0A5A0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>.<2E>. <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :-)
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
m_snac_msg_tlv_err:
|
|
|
|
|
write_debug 'TLV TYPE MISMATCH'
|
|
|
|
|
pop ecx
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
m_snac_ch1_fr_err:
|
|
|
|
|
write_debug 'UNKNOWN FRAGMENT IDENTIFIER OR FRAGMENT VERSION'
|
|
|
|
|
|
|
|
|
|
;m_snac_ch1_end:
|
|
|
|
|
pop ecx
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Channel 2 message format (rtf messages, rendezvous)
|
|
|
|
|
;
|
|
|
|
|
m_snac_ch2:
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD>ࠢ<EFBFBD><E0A0A2> ᮮ<>饭<EFBFBD><E9A5AD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <20>㦭<EFBFBD> <20>㪨 <20> 㨭
|
|
|
|
|
mov eax, dword [mbuff+10]
|
|
|
|
|
mov [msg_cookie1], eax
|
|
|
|
|
mov eax, dword [mbuff+10+4]
|
|
|
|
|
mov [msg_cookie2], eax
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov al, [mbuff+10+10] ; Sender UIN length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [ui.bUinLength], al
|
|
|
|
|
|
|
|
|
|
push ecx
|
|
|
|
|
movzx ecx, al
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea eax, [mbuff+10+11] ; UIN string
|
|
|
|
|
lea ebx, [ui.bUin] ; Dest
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call strcpy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mov [ssnac.wFid], 4 ; Family
|
|
|
|
|
mov [ssnac.wSid], 0Bh ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 0Bh
|
|
|
|
|
|
|
|
|
|
mov eax, [msg_cookie1]
|
|
|
|
|
mov dword [buff], eax
|
|
|
|
|
mov eax, [msg_cookie2]
|
|
|
|
|
mov dword [buff+4], eax
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov word [buff+8], 0200h ; Channel 2
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov al, [ui.bUinLength]
|
|
|
|
|
mov [buff+10], al
|
|
|
|
|
lea eax, [ui.bUin]
|
|
|
|
|
lea ebx, [buff+11]
|
|
|
|
|
call strcpy
|
|
|
|
|
lea ecx, [ecx+11]
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov word [buff+ecx], 0100h ; reason code (1 - unsupported channel, 2 - busted payload, 3 - channel specific)
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov edx, ecx
|
|
|
|
|
|
|
|
|
|
pop ecx
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Channel 4 message format (typed old-style messages)
|
|
|
|
|
;
|
|
|
|
|
m_snac_ch4:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_ch_other:
|
|
|
|
|
write_debug 'Unknown message channel'
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_snac_4_other:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
write_debug 'Unknown SNAC Family 4 recived'
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; FAMILY 9
|
|
|
|
|
;
|
|
|
|
|
m_snac_9:
|
|
|
|
|
cmp dx, 3
|
|
|
|
|
jz m_snac_9_3
|
|
|
|
|
jmp m_snac_9_other
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Server sends PRM service limitations to client
|
|
|
|
|
;
|
|
|
|
|
m_snac_9_3:
|
|
|
|
|
;
|
|
|
|
|
; <20><>ࠡ<EFBFBD>⪨ <20><><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
if USE_SSI <> 0
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20> <20><>ࢥ<EFBFBD><E0A2A5>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Request contact list (first time)
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 13h ; Family
|
|
|
|
|
mov [ssnac.wSid], 04h ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 04h ; request-id
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
xor edx, edx
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; <20>⪫<EFBFBD>祭<EFBFBD>, <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SIQ
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Client ask server for SSI service limitations
|
|
|
|
|
;
|
|
|
|
|
;mov [ssnac.wFid], 13h ; Family
|
|
|
|
|
;mov [ssnac.wSid], 2 ; Subtype
|
|
|
|
|
;mov [ssnac.dRi], 2 ; request-id
|
|
|
|
|
;mov eax, ssnac
|
|
|
|
|
;mov ebx, buff
|
|
|
|
|
;xor edx, edx
|
|
|
|
|
;call sendsnac
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20>⠤<EFBFBD><E2A0A4> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> <> <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 1 ; Family
|
|
|
|
|
mov [ssnac.wSid], 0Eh ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 0Eh ; request-id
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
2011-10-19 02:58:49 +04:00
|
|
|
|
xor edx, edx ; TLV head len
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Client sends its DC info and status to server
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 1 ; Family
|
|
|
|
|
mov [ssnac.wSid], 1Eh ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 1Eh ; request-id
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [buff], 0 ; TLV type 06
|
|
|
|
|
mov [buff+1], 6h ;
|
|
|
|
|
mov [buff+2], 0 ; TLV data length
|
|
|
|
|
mov [buff+3], 4 ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
mov ax, STATUS_DCDISABLED ; DC disabled
|
|
|
|
|
call htons
|
|
|
|
|
mov word [buff+4], ax
|
|
|
|
|
mov ax, STATUS_ONLINE
|
|
|
|
|
mov [status], ax
|
|
|
|
|
mov word [buff+6], ax
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov edx, 8 ; TLV head len+ data len
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> <20><> <20><>ࢥ<EFBFBD> <20><>
|
|
|
|
|
;
|
|
|
|
|
call uploadkl
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD>⮩
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 9 ; Family
|
|
|
|
|
mov [ssnac.wSid], 7 ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 7
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
xor edx, edx
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20> &RQ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD> ࠧ<><E0A0A7>襭<EFBFBD><E8A5AD>. <20> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <20>.<2E>. <20><> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><> ᮤ<>ন<EFBFBD>
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov [ssnac.wFid], 15 ; Family
|
|
|
|
|
;mov [ssnac.wSid], 2 ; Subtype
|
|
|
|
|
;mov [ssnac.dRi], 2
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov word [buff], 0100h ; 00 01 encapsulated META_DATA
|
|
|
|
|
;mov word [buff+2], 1000h ; 00 10 Len
|
|
|
|
|
;mov word [buff+4], 000Eh ; LE Len
|
|
|
|
|
;mov word [buff+10], 07D0h ; META_DATA_REQ
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, UIN
|
|
|
|
|
;call ascitoint
|
|
|
|
|
;mov dword [buff+6], eax
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;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
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, ssnac
|
|
|
|
|
;mov ebx, buff
|
|
|
|
|
;mov edx, 20
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Client READY command
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 1 ; Family
|
|
|
|
|
mov [ssnac.wSid], 2 ; Subtype
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [ssnac.dRi], 2 ; request-id
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov eax, FAMILY_ARR
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
push ecx
|
|
|
|
|
mov ecx, FA_LEN
|
|
|
|
|
call strcpy
|
|
|
|
|
pop ecx
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
mov edx, FA_LEN
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> offline ᮮ<>饭<EFBFBD><E9A5AD>
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 15h ; Family
|
|
|
|
|
mov [ssnac.wSid], 2 ; Subtype
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [ssnac.dRi], 2 ; request-id
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov word [buff], 0100h ; TLV type 01
|
|
|
|
|
mov word [buff+2], 0A00h ; 00 0a <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov word [buff+4], 0008h ; 08 00
|
|
|
|
|
lea eax, [vtable + vartable.uin]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call ascitoint
|
|
|
|
|
mov dword [buff+6], eax
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov word [buff+10], 003Ch ; 3C 00 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>䫠<EFBFBD><E4ABA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD>
|
|
|
|
|
mov word [buff+12], 0002 ; 02 00 - request sequence number
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov edx, 14 ; <20><>騩 ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD> <20><><EFBFBD><EFBFBD> UIN
|
|
|
|
|
;
|
|
|
|
|
call getinfo
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
mov [login], 2
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
|
|
|
|
end if ; USE_SSI = 0
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
m_snac_9_other:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
write_debug 'Unknown SNAC Family 9 Recived'
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; FAMILY 13
|
|
|
|
|
;
|
|
|
|
|
m_snac_13:
|
|
|
|
|
cmp dx, 3
|
|
|
|
|
jz m_snac_13_3
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp dx, 6
|
|
|
|
|
jz m_snac_13_6
|
2011-02-02 12:52:07 +03:00
|
|
|
|
cmp dx, 0fh
|
|
|
|
|
jz m_snac_13_F
|
|
|
|
|
|
|
|
|
|
jmp m_snac_13_other
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Server sends SSI service limitations to client
|
|
|
|
|
;
|
|
|
|
|
m_snac_13_3:
|
|
|
|
|
;
|
|
|
|
|
; <20><>ࠡ<EFBFBD>⪨ <20><><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; SNAC(13,05) Client check if its local SSI copy is up-to-date
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 13h ; Family
|
|
|
|
|
mov [ssnac.wSid], 5 ; Subtype
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [ssnac.dRi], 5 ; request-id
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, ssnac
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
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+4], 00 ;
|
|
|
|
|
mov [buff+5], 00h ; number of items in client local SSI copy
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
mov edx, 5
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Server contact list reply
|
|
|
|
|
;
|
|
|
|
|
m_snac_13_6:
|
|
|
|
|
|
|
|
|
|
lea eax, [mbuff+10] ; <20> eax <20><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> <20><><EFBFBD><EFBFBD><EFBFBD> <20>ਥ<EFBFBD><E0A8A5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+ ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> snac
|
|
|
|
|
|
|
|
|
|
call ssi_process_data ; <20><>ࠡ<EFBFBD>⪠ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><>⨢<EFBFBD><E2A8A2>㥬 SSI
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
mov [ssnac.wFid], 13h ; Family
|
|
|
|
|
mov [ssnac.wSid], 7 ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 7 ; request-id
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
xor edx, edx
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20>⠤<EFBFBD><E2A0A4> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> <> <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 1 ; Family
|
|
|
|
|
mov [ssnac.wSid], 0Eh ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 0Eh ; request-id
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
xor edx, edx ; TLV head len
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Client sends its DC info and status to server
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 1 ; Family
|
|
|
|
|
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 ax, STATUS_DCDISABLED ; DC disabled
|
|
|
|
|
call htons
|
|
|
|
|
mov word [buff+4], ax
|
|
|
|
|
mov ax, STATUS_ONLINE
|
|
|
|
|
mov [status], ax
|
|
|
|
|
mov word [buff+6], ax
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
mov edx, 8 ; TLV head len+ data len
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> <20><> <20><>ࢥ<EFBFBD> <20><>
|
|
|
|
|
; FIXME <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20>㦭<EFBFBD> <20><><EFBFBD> <20>㭪<EFBFBD><E3ADAA><EFBFBD>
|
|
|
|
|
;call uploadkl
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD>⮩
|
|
|
|
|
;
|
|
|
|
|
;mov [ssnac.wFid], 9 ; Family
|
|
|
|
|
;mov [ssnac.wSid], 7 ; Subtype
|
|
|
|
|
;mov [ssnac.dRi], 7
|
|
|
|
|
|
|
|
|
|
;mov eax, ssnac
|
|
|
|
|
;mov ebx, buff
|
|
|
|
|
;xor edx, edx
|
|
|
|
|
;call sendsnac
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20> &RQ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD> ࠧ<><E0A0A7>襭<EFBFBD><E8A5AD>. <20> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <20>.<2E>. <20><> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><> ᮤ<>ন<EFBFBD>
|
|
|
|
|
; - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
;mov [ssnac.wFid], 15 ; Family
|
|
|
|
|
;mov [ssnac.wSid], 2 ; Subtype
|
|
|
|
|
;mov [ssnac.dRi], 2
|
|
|
|
|
|
|
|
|
|
;mov word [buff], 0100h ; 00 01 encapsulated META_DATA
|
|
|
|
|
;mov word [buff+2], 1000h ; 00 10 Len
|
|
|
|
|
;mov word [buff+4], 000Eh ; LE Len
|
|
|
|
|
;mov word [buff+10], 07D0h ; META_DATA_REQ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;mov eax, UIN
|
|
|
|
|
;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 eax, ssnac
|
|
|
|
|
;mov ebx, buff
|
|
|
|
|
;mov edx, 20
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Client READY command
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 1 ; Family
|
|
|
|
|
mov [ssnac.wSid], 2 ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 2 ; request-id
|
|
|
|
|
|
|
|
|
|
mov eax, FAMILY_ARR
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
push ecx
|
|
|
|
|
mov ecx, FA_LEN
|
|
|
|
|
call strcpy
|
|
|
|
|
pop ecx
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
mov edx, FA_LEN
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> offline ᮮ<>饭<EFBFBD><E9A5AD>
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 15h ; Family
|
|
|
|
|
mov [ssnac.wSid], 2 ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 2 ; request-id
|
|
|
|
|
|
|
|
|
|
mov word [buff], 0100h ; TLV type 01
|
|
|
|
|
mov word [buff+2], 0A00h ; 00 0a <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov word [buff+4], 0008h ; 08 00
|
|
|
|
|
lea eax, [vtable + vartable.uin]
|
|
|
|
|
call ascitoint
|
|
|
|
|
mov dword [buff+6], eax
|
|
|
|
|
|
|
|
|
|
mov word [buff+10], 003Ch ; 3C 00 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>䫠<EFBFBD><E4ABA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD>
|
|
|
|
|
mov word [buff+12], 0002 ; 02 00 - request sequence number
|
|
|
|
|
|
|
|
|
|
mov edx, 14 ; <20><>騩 ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> <20><><EFBFBD><EFBFBD>ଠ<EFBFBD><E0ACA0><EFBFBD> <20><><EFBFBD><EFBFBD> UIN
|
|
|
|
|
; FIXME <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20>㦭<EFBFBD> <20><><EFBFBD> <20>㭪<EFBFBD><E3ADAA><EFBFBD>
|
|
|
|
|
;call getinfo
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
mov [login], 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
; Server tell client its local copy up-to-date
|
|
|
|
|
;
|
|
|
|
|
m_snac_13_F:
|
|
|
|
|
;
|
|
|
|
|
; <20><>ࠡ<EFBFBD>⪨ <20><><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Client activates server SSI data
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 13h ; Family
|
|
|
|
|
mov [ssnac.wSid], 7 ; Subtype
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [ssnac.dRi], 7 ; request-id
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
xor edx, edx
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20>⠤<EFBFBD><E2A0A4> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Client sends its DC info and status to server
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 1 ; Family
|
|
|
|
|
mov [ssnac.wSid], 1Eh ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 1Eh ; request-id
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [buff], 0 ; TLV type 06
|
|
|
|
|
mov [buff+1], 6h ;
|
|
|
|
|
mov [buff+2], 0 ; TLV data length
|
|
|
|
|
mov [buff+3], 4 ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
mov ax, STATUS_DCDISABLED ; DC disabled
|
|
|
|
|
call htons
|
|
|
|
|
mov word [buff+4], ax
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
mov ax, [status]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov word [buff+6], ax
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov edx, 8 ; TLV head len+ data len
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Client READY command
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 1 ; Family
|
|
|
|
|
mov [ssnac.wSid], 2 ; Subtype
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [ssnac.dRi], 2 ; request-id
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov eax, FAMILY_ARR
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
push ecx
|
|
|
|
|
mov ecx, FA_LEN
|
|
|
|
|
call strcpy
|
|
|
|
|
pop ecx
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
mov edx, FA_LEN
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> offline ᮮ<>饭<EFBFBD><E9A5AD>
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 15h ; Family
|
|
|
|
|
mov [ssnac.wSid], 2 ; Subtype
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [ssnac.dRi], 2 ; request-id
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov word [buff], 0100h ; TLV type 01
|
|
|
|
|
mov word [buff+2], 0A00h ; 00 0a <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov word [buff+4], 0008h ; 08 00
|
|
|
|
|
lea eax, [vtable + vartable.uin]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call ascitoint
|
|
|
|
|
mov dword [buff+6], eax
|
|
|
|
|
|
|
|
|
|
mov [buff+10], 003Ch ; 3C 00 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>䫠<EFBFBD><E4ABA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD>
|
|
|
|
|
mov [buff+12], 0002 ; 02 00 - request sequence number
|
|
|
|
|
|
|
|
|
|
mov edx, 14 ; <20><>騩 ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
m_snac_13_other:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
write_debug 'Unknown SNAC Family 13 Recived'
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Family 15
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
m_snac_15:
|
|
|
|
|
|
|
|
|
|
cmp dx, 3
|
|
|
|
|
jz m_snac_15_3
|
|
|
|
|
|
|
|
|
|
jmp m_snac_15_other
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; Server sends message #N
|
|
|
|
|
;
|
|
|
|
|
m_snac_15_3:
|
|
|
|
|
;
|
|
|
|
|
; <20><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD>⨯ <20>ਭ<EFBFBD>⮣<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;write_debug 'SNAC 15, 3'
|
|
|
|
|
|
|
|
|
|
xor eax, eax
|
|
|
|
|
mov ax, word [mbuff+10] ; + SNAC.head size
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp ax, 0100h ; 00 01 TLV type
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jnz m_snac_tlv_err
|
|
|
|
|
|
|
|
|
|
mov ax, word [mbuff+10+10]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp ax, 0041h ; Offline Message
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz m_snac_offline_mes
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp ax, 0042h ; End messages
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz m_snac_offline_end
|
|
|
|
|
cmp ax, 07DAh
|
|
|
|
|
jz m_snac_meta_data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
write_debug 'Unknown Subtype SNAC (15,3)'
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
m_snac_offline_mes:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov eax, MESS ;
|
|
|
|
|
call strlen ; <20>뢮<EFBFBD><EBA2AE><EFBFBD> <20><>ப<EFBFBD> <20> ᮮ<>饭<EFBFBD><E9A5AD><EFBFBD> <20> <20><><EFBFBD>ࠢ<EFBFBD>⥫<EFBFBD> <20> <20>६<EFBFBD><E0A5AC><EFBFBD> <20><><EFBFBD>ࠢ<EFBFBD><E0A0A2>
|
|
|
|
|
push ecx ;
|
|
|
|
|
mov ecx, eax ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, MESS
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
call strcpy
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov eax, dword [mbuff+14+10] ; Sender UIN
|
|
|
|
|
lea ebx, [buff+ecx] ; <20><> <20><><EFBFBD><EFBFBD>窨 <20> ᮮ<>饭<EFBFBD><E9A5AD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call int2strd
|
|
|
|
|
|
|
|
|
|
lea ebx, [ebx+eax]
|
|
|
|
|
mov [ebx], byte ' '
|
|
|
|
|
inc ebx
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; + <20><><EFBFBD><EFBFBD><EFBFBD> UIN
|
|
|
|
|
movzx eax, byte [mbuff+21+10] ; Day
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call int2strd
|
|
|
|
|
|
|
|
|
|
lea ebx, [ebx+eax]
|
|
|
|
|
mov [ebx], byte '.'
|
|
|
|
|
inc ebx
|
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
movzx eax, byte [mbuff+20+10] ;Mounth
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call int2strd
|
|
|
|
|
|
|
|
|
|
lea ebx, [ebx+eax]
|
|
|
|
|
mov [ebx], byte ' '
|
|
|
|
|
inc ebx
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
movzx eax, [mbuff+22+10] ; Hour
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call int2strd
|
|
|
|
|
|
|
|
|
|
lea ebx, [ebx+eax]
|
|
|
|
|
mov [ebx], byte ':'
|
|
|
|
|
inc ebx
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
movzx eax, [mbuff+23+10] ; Minute
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call int2strd
|
|
|
|
|
|
|
|
|
|
lea ebx, [ebx+eax]
|
|
|
|
|
;mov [ebx], byte ' '
|
|
|
|
|
;inc ebx
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [ebx], byte 0 ; Str end
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, buff
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
|
|
|
|
|
call writemsg
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
movzx ecx, word [mbuff+26+10] ; <20><><EFBFBD><EFBFBD><EFBFBD> ᮮ<><E1AEAE>饭<EFBFBD><E9A5AD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
lea eax, [mbuff+28+10]
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
call strcpy
|
|
|
|
|
|
|
|
|
|
mov [ebx+ecx], byte 0
|
|
|
|
|
|
|
|
|
|
mov eax, buff
|
2011-10-19 02:58:49 +04:00
|
|
|
|
call win2dos ;<3B><>४<EFBFBD><E0A5AA><EFBFBD><EFBFBD>㥬
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ebx, 00FF0000h ;<3B><><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
call writemsg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pop ecx
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_snac_offline_end:
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>塞 ᮮ<>饭<EFBFBD><E9A5AD> <20><> <20><>ࢥ<EFBFBD><E0A2A5>
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 15h ; Family
|
|
|
|
|
mov [ssnac.wSid], 2 ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 0602h ; request-id
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
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)
|
|
|
|
|
lea eax, [vtable + vartable.uin]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call ascitoint
|
|
|
|
|
mov dword [buff+6], eax ; xx xx xx xx (LE) client uin
|
2011-10-19 02:58:49 +04:00
|
|
|
|
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
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov edx, 14 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20>⢥<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>짮<EFBFBD><ECA7AE>⥫<EFBFBD><E2A5AB>
|
|
|
|
|
;
|
|
|
|
|
m_snac_meta_data:
|
|
|
|
|
;
|
|
|
|
|
; <20><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD>।<EFBFBD><E0A5A4><EFBFBD> <20><><EFBFBD>⨯ :-)
|
|
|
|
|
;
|
|
|
|
|
mov ax, word [mbuff+10+14]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp ax, 0104h ;data subtype: META_SHORT_USERINFO
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jz m_snac_short_userinfo
|
|
|
|
|
cmp ax, 00C8h
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz m_snac_basic_userinfo ;data subtype: META_BASIC_USERINFO
|
2011-02-02 12:52:07 +03:00
|
|
|
|
write_debug 'Unknown META DATA subtype'
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_snac_short_userinfo:
|
|
|
|
|
;
|
|
|
|
|
; <20><> <20>ᥩ <20><><EFBFBD><EFBFBD>ଠ樨 <20><><EFBFBD><EFBFBD> <20>㦥<EFBFBD> ⮫쪮 <20><><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
mov al, [mbuff+10+16]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp al, 0Ah ;success byte
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jnz m_fin
|
|
|
|
|
|
|
|
|
|
movzx eax, word [mbuff+10+12] ;request sequence number
|
|
|
|
|
;
|
|
|
|
|
; <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD> <20><><EFBFBD>浪<EFBFBD><EFA4AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <><EEA7A5> <20> <20><>
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea ebx, [mbuff+10+19] ;nickname string
|
2011-02-02 12:52:07 +03:00
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20><> <20>㦭<EFBFBD>, <20>.<2E>. <20><>ப<EFBFBD> Null-Terminated
|
|
|
|
|
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ecx, 4
|
|
|
|
|
imul ecx, eax
|
|
|
|
|
mov ecx, [stats+ecx]
|
|
|
|
|
|
|
|
|
|
call loadbb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><> SIQ <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⪮<EFBFBD> <20><><EFBFBD><EFBFBD> <20>⢥砥<E2A2A5>
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>⮬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ଠ樨, ॠ<><E0A5A0><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ⮫쪮 <20><><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
m_snac_basic_userinfo:
|
|
|
|
|
mov al, [mbuff+10+16]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp al, 0Ah ;success byte
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jnz m_fin
|
|
|
|
|
|
|
|
|
|
movzx eax, word [mbuff+10+12] ;request sequence number
|
|
|
|
|
;
|
|
|
|
|
; <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD> <20><><EFBFBD>浪<EFBFBD><EFA4AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <><EEA7A5> <20> <20><>
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea ebx, [mbuff+10+19] ;nickname string
|
2011-02-02 12:52:07 +03:00
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20><> <20>㦭<EFBFBD>, <20>.<2E>. <20><>ப<EFBFBD> Null-Terminated
|
|
|
|
|
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ecx, 4
|
|
|
|
|
imul ecx, eax
|
|
|
|
|
mov ecx, [stats+ecx]
|
|
|
|
|
|
|
|
|
|
call loadbb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
m_snac_tlv_err:
|
|
|
|
|
write_debug 'TLV TYPE MISMATCH'
|
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_snac_15_other:
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
write_debug 'Unknown SNAC Family 15 Recived'
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_other_snac:
|
2011-10-19 02:58:49 +04:00
|
|
|
|
write_debug 'Unknown SNAC recived'
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jmp m_fin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_fin:
|
|
|
|
|
;pop edx
|
|
|
|
|
;pop ebx
|
|
|
|
|
;pop eax
|
|
|
|
|
popad
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
; <20><><EFBFBD> <20><>ॢ<EFBFBD><E0A5A2><EFBFBD> DWORD <20><> Little Endian <20> Big Endian
|
|
|
|
|
; <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :-)
|
|
|
|
|
; <--EAX DWORD
|
|
|
|
|
; -->EAX
|
|
|
|
|
;
|
|
|
|
|
ntohl:
|
|
|
|
|
htonl:
|
|
|
|
|
;pushf
|
|
|
|
|
push ebx
|
|
|
|
|
;push ecx
|
|
|
|
|
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
|
|
|
|
|
mov bl, ah
|
|
|
|
|
mov bh, al
|
|
|
|
|
shl ebx, 16
|
|
|
|
|
|
|
|
|
|
shr eax, 16
|
|
|
|
|
mov bl, ah
|
|
|
|
|
mov bh, al
|
|
|
|
|
|
|
|
|
|
mov eax, ebx
|
|
|
|
|
|
|
|
|
|
;pop ecx
|
|
|
|
|
pop ebx
|
|
|
|
|
;popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; <20><><EFBFBD> <20><>ॢ<EFBFBD><E0A5A2><EFBFBD> WORD <20><> Little Endian <20> Big Endian
|
|
|
|
|
; <--AX WORD
|
|
|
|
|
; -->AX WORD
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
ntohs:
|
|
|
|
|
htons:
|
|
|
|
|
;pushf
|
|
|
|
|
push ebx
|
|
|
|
|
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
mov bl, ah
|
|
|
|
|
mov bh, al
|
|
|
|
|
mov eax, ebx
|
|
|
|
|
|
|
|
|
|
pop ebx
|
|
|
|
|
;popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SNAC
|
|
|
|
|
; <--EAX 㪠<><E3AAA0>⥫<EFBFBD> <20><> SNAC_head
|
|
|
|
|
; <--EBX 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; -->EAX 㪠<><E3AAA0>⥫<EFBFBD> <20><>砫<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = buffer+sizeof SNAC_head
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
snacpar:
|
|
|
|
|
pushf
|
|
|
|
|
push ecx
|
|
|
|
|
;push edx
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov cl, [ebx+1] ; Family (service) id number <20><><EFBFBD><EFBFBD>訩 <20><><EFBFBD><EFBFBD>
|
|
|
|
|
mov ch, [ebx] ; <20><><EFBFBD><EFBFBD>訩
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov word [eax], cx
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov cl, [ebx+3] ; Family subtype id number
|
|
|
|
|
mov ch, [ebx+2] ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov word [eax+2], cx
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov cl, [ebx+5] ; SNAC flags
|
|
|
|
|
mov ch, [ebx+4] ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov word [eax+4], cx ;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
|
|
|
|
mov cl, [ebx+7] ;
|
|
|
|
|
mov ch, [ebx+6] ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov word [eax+8], cx ; SNAC request id
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov cl, [ebx+8] ;
|
|
|
|
|
mov ch, [ebx+7] ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov word [eax+6], cx ;
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
add ebx, 10 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, ebx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;pop edx
|
|
|
|
|
pop ecx
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> userinfo block
|
|
|
|
|
; FIXIT
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
; userinfopar:
|
|
|
|
|
; pushf
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
; popf
|
|
|
|
|
; ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD>뫪<EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD>
|
|
|
|
|
; [eax] <-- ⥪<>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD><EFBFBD> \
|
|
|
|
|
; [ebx] <-- UIN / Null-terminated
|
|
|
|
|
|
|
|
|
|
sendmsg:
|
|
|
|
|
pushf
|
|
|
|
|
pushad
|
|
|
|
|
push eax
|
|
|
|
|
push ebx
|
|
|
|
|
|
|
|
|
|
mov [ssnac.wFid], 4h ; Family
|
|
|
|
|
mov [ssnac.wSid], 6 ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 106h ; request-id
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>砥<EFBFBD> <20>६<EFBFBD> <20> <20><><EFBFBD><EFBFBD>᪠ <20><><EFBFBD>⥬<EFBFBD>, <20><><EFBFBD> cookie
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;mov eax, 26
|
|
|
|
|
;mov ebx, 9
|
|
|
|
|
;int 40h
|
|
|
|
|
mcall 26, 9
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov dword [buff], eax ; Cookie 1
|
|
|
|
|
mov dword [buff+4], eax ; Cookie 2
|
|
|
|
|
|
|
|
|
|
mov word [buff+8], 0100h ; Message channel 00 01
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pop ebx
|
|
|
|
|
mov eax, ebx
|
|
|
|
|
call strlen
|
|
|
|
|
|
|
|
|
|
mov [buff+10], al
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
mov eax, ebx
|
|
|
|
|
lea ebx, [buff+11]
|
|
|
|
|
call strcpy
|
|
|
|
|
lea ecx, [ecx+11]
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov word [buff+ecx], 0200h ; TLV.Type(0x02) - message data
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
;push ecx ;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; TLV.Length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov word [buff+ecx+4], 0105h ; 05 01 01 - fragment version, 05 - fragment identifier
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov word [buff+ecx+6], 0100h ; data length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [buff+ecx+8], 01 ; byte array of required capabilities (1 - text)
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [buff+ecx+9], 01 ; fragment identifier (text message)
|
|
|
|
|
mov [buff+ecx+10], 01 ; fragment version
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
pop ebx
|
|
|
|
|
mov eax, ebx
|
|
|
|
|
call strlen
|
|
|
|
|
mov edx, eax
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea eax, [eax+4] ; <20><><EFBFBD><EFBFBD><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD> + Message charset number+ Message language number
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
call htons
|
|
|
|
|
mov word [buff+ecx+11], ax
|
|
|
|
|
|
|
|
|
|
mov eax, edx
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea eax, [eax+13] ; + <20><><EFBFBD><EFBFBD><EFBFBD> <20><>㦥<EFBFBD><E3A6A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call htons
|
|
|
|
|
mov word [buff+ecx+2], ax
|
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov word [buff+ecx+13], 0700h ; Message charset number
|
|
|
|
|
mov word [buff+ecx+15], 0300h ; Message language number
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov eax, ecx
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov ecx, edx ; Len
|
2011-02-02 12:52:07 +03:00
|
|
|
|
lea edx, [eax+17]
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov eax, ebx ;Source
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea ebx, [buff+edx] ;Dest
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
call strcpy
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea ecx, [ecx+edx] ; +String length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov [buff+ecx], byte 0
|
|
|
|
|
mov eax, ebx
|
|
|
|
|
call dos2win
|
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov word [buff+ecx], 0600h ; TLV.Type(0x06) - store message if recipient offline
|
|
|
|
|
mov word [buff+ecx+2], 0 ; TLV.Length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
lea edx, [ecx+4] ; +TLV_head length
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
mov ecx, [socket]
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
popad
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ଠ樨 UIN<49><4E>
|
|
|
|
|
;
|
|
|
|
|
getinfo:
|
|
|
|
|
pushad
|
|
|
|
|
pushf
|
|
|
|
|
;
|
|
|
|
|
; SNAC (15,2) - Meta information request
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
mov [ssnac.wFid], 15h ; Family
|
|
|
|
|
mov [ssnac.wSid], 2 ; Subtype
|
|
|
|
|
mov [ssnac.dRi], 702h ; request-id
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
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)
|
|
|
|
|
lea eax, [vtable + vartable.uin]
|
2011-02-02 12:52:07 +03:00
|
|
|
|
call ascitoint
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov dword [buff+6], eax ;(LE) request owner uin
|
|
|
|
|
mov word [buff+10], 07D0h ;data type: META_DATA_REQ
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;mov word [buff+12], 0008h ; request sequence number <<<-- <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FIXIT
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov word [buff+14], 04BAh ; data subtype: META_SHORTINFO_REQUEST
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mov ecx, [socket]
|
|
|
|
|
mov edx, 20
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
xor esi, esi ; <20><><EFBFBD><EFBFBD>稪
|
2011-02-02 12:52:07 +03:00
|
|
|
|
xor eax, eax
|
|
|
|
|
|
|
|
|
|
gi_loop:
|
|
|
|
|
mov ebx, esi
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov word [buff+12], bx ; request sequence number
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov ebx, UIN_LEN
|
|
|
|
|
imul ebx, esi
|
|
|
|
|
mov al, [uins+ebx]
|
|
|
|
|
cmp al, 0
|
2011-10-19 02:58:49 +04:00
|
|
|
|
jz gi_end
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
lea eax, [uins+ebx]
|
|
|
|
|
call ascitoint
|
|
|
|
|
mov dword [buff+16], eax
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
|
|
|
|
|
call sendsnac
|
|
|
|
|
inc esi
|
|
|
|
|
cmp esi, UINS
|
|
|
|
|
jnc gi_end
|
|
|
|
|
jmp gi_loop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gi_end:
|
|
|
|
|
popf
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><>ࢥ<EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
uploadkl:
|
|
|
|
|
pushf
|
|
|
|
|
pushad
|
|
|
|
|
;
|
|
|
|
|
; Add buddy(s) to contact list
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 3 ; Family
|
|
|
|
|
mov [ssnac.wSid], 4 ; Subtype
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [ssnac.dRi], 4 ; request-id
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
xor esi, esi ; <20><><EFBFBD><EFBFBD>稪
|
|
|
|
|
xor edx, edx ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
ukk_loop:
|
|
|
|
|
mov ebx, UIN_LEN
|
|
|
|
|
imul ebx, esi
|
|
|
|
|
mov al, [uins+ebx]
|
|
|
|
|
cmp al, 0
|
|
|
|
|
jz ukk_end
|
|
|
|
|
lea eax, [uins+ebx]
|
|
|
|
|
|
|
|
|
|
call strlen
|
|
|
|
|
mov [buff+edx], al
|
|
|
|
|
inc edx
|
|
|
|
|
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
lea eax, [uins+ebx] ; Source
|
|
|
|
|
lea ebx, [buff+edx]
|
|
|
|
|
call strcpy
|
|
|
|
|
add edx, ecx
|
|
|
|
|
inc esi
|
|
|
|
|
cmp esi, UINS
|
|
|
|
|
jz ukk_end
|
|
|
|
|
jmp ukk_loop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ukk_end:
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
mov ecx, [socket]
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
popad
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
sendkeep:
|
|
|
|
|
pushf
|
|
|
|
|
pushad
|
|
|
|
|
cmp [login], 2
|
|
|
|
|
jnz @f
|
|
|
|
|
mov ax, [timer]
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cmp ax, 300 ;60 c
|
2011-02-02 12:52:07 +03:00
|
|
|
|
jb @f
|
|
|
|
|
mov [timer], 0
|
|
|
|
|
mov [flap.bId], FLAP_ID
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mov [flap.bCh], 5 ;Keep alive
|
2011-02-02 12:52:07 +03:00
|
|
|
|
mov [flap.wDs], 0
|
|
|
|
|
inc [seq]
|
|
|
|
|
mov ax, [seq]
|
|
|
|
|
mov [flap.wSn], ax
|
|
|
|
|
mov eax, flap
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
mov ecx, [socket]
|
|
|
|
|
call sendflap
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@:
|
|
|
|
|
popad
|
|
|
|
|
popf
|
|
|
|
|
ret
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;
|
|
|
|
|
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD> <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> status
|
|
|
|
|
setstatus:
|
|
|
|
|
push eax
|
|
|
|
|
push ebx
|
|
|
|
|
push edx
|
|
|
|
|
;
|
|
|
|
|
; Client sends its DC info and status to server
|
|
|
|
|
;
|
|
|
|
|
mov [ssnac.wFid], 1 ; Family
|
|
|
|
|
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 ax, STATUS_DCDISABLED ; DC disabled
|
|
|
|
|
call htons
|
|
|
|
|
mov word [buff+4], ax
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
mov ax, [status]
|
|
|
|
|
mov word [buff+6], ax
|
|
|
|
|
|
|
|
|
|
mov eax, ssnac
|
|
|
|
|
mov ebx, buff
|
|
|
|
|
mov edx, 8 ; TLV head len+ data len
|
|
|
|
|
call sendsnac
|
|
|
|
|
|
|
|
|
|
pop edx
|
|
|
|
|
pop ebx
|
|
|
|
|
pop eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ய<EFBFBD>᪠<EFBFBD><E1AAA0> <20><><EFBFBD> <20><EFBFBD><E0AEA1><EFBFBD> <20> <20><>ப<EFBFBD> <20><>
|
|
|
|
|
; 1 <20><> <20><><EFBFBD><EFBFBD><EFBFBD>饣<EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD>
|
|
|
|
|
; eax - 㪠<><E3AAA0>⥫<EFBFBD> <20><> null-terminated <20><>ப<EFBFBD>
|
|
|
|
|
|
|
|
|
|
macro skip_spaces {
|
|
|
|
|
local ..sp_end, ..sp_loop
|
|
|
|
|
|
|
|
|
|
push ebx
|
|
|
|
|
push ecx
|
|
|
|
|
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
xor ecx, ecx
|
|
|
|
|
|
|
|
|
|
..sp_loop:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mov bl, [eax + ecx]
|
|
|
|
|
cmp bl, 0x20
|
|
|
|
|
jnz ..sp_end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc ecx
|
|
|
|
|
jmp ..sp_loop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
..sp_end:
|
|
|
|
|
lea eax, [eax + ecx]
|
|
|
|
|
|
|
|
|
|
pop ecx
|
|
|
|
|
pop ebx
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><>ࠡ<EFBFBD>⪠ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <20> <20>ax <20><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><>ப<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA1><EFBFBD><EFBFBD>
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>稭<EFBFBD><E7A8AD><EFBFBD><EFBFBD><EFBFBD> <20> /
|
|
|
|
|
; <20> eax - १<><E0A5A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>믮<EFBFBD><EBAFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, -1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 0 <20><>, <20><>㣨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
cmd:
|
|
|
|
|
push ebx
|
|
|
|
|
push ecx
|
|
|
|
|
push edi
|
|
|
|
|
push esi
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
mov bl, [eax]
|
|
|
|
|
cmp bl, '/'
|
|
|
|
|
jnz cmd_end
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 1<> <20>㪢<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
mov bl, [eax + 1]
|
|
|
|
|
|
|
|
|
|
cmp bl, 'c'
|
|
|
|
|
jz cmd_c
|
|
|
|
|
|
|
|
|
|
cmp bl, 'e'
|
|
|
|
|
jz cmd_e
|
|
|
|
|
|
|
|
|
|
cmp bl, 's'
|
|
|
|
|
jz cmd_s
|
|
|
|
|
|
|
|
|
|
jmp cmd_no
|
|
|
|
|
|
|
|
|
|
cmd_c:
|
|
|
|
|
|
|
|
|
|
cmd_e:
|
|
|
|
|
|
|
|
|
|
lea ebx, [eax + 1]
|
|
|
|
|
strcmp ebx, str_exit, str_exit.len
|
|
|
|
|
jz cmd_exit
|
|
|
|
|
|
|
|
|
|
jmp cmd_no
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd_s:
|
|
|
|
|
|
|
|
|
|
lea ebx, [eax + 1]
|
|
|
|
|
strcmp ebx, str_status, str_status.len
|
|
|
|
|
jz cmd_status
|
|
|
|
|
|
|
|
|
|
jmp cmd_no
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd_exit:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd_status:
|
|
|
|
|
;
|
|
|
|
|
; <20><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><E1ABA0> <20><><EFBFBD><EFBFBD><EFBFBD> ᬥ<><E1ACA5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
lea eax, [eax + 1 + str_status.len]
|
|
|
|
|
skip_spaces
|
|
|
|
|
|
|
|
|
|
strcmp eax, str_online, str_online.len
|
|
|
|
|
jz cmd_st_online
|
|
|
|
|
|
|
|
|
|
strcmp eax, str_away, str_away.len
|
|
|
|
|
jz cmd_st_away
|
|
|
|
|
|
|
|
|
|
strcmp eax, str_na, str_na.len
|
|
|
|
|
jz cmd_st_na
|
|
|
|
|
|
|
|
|
|
strcmp eax, str_dnd, str_dnd.len
|
|
|
|
|
jz cmd_st_dnd
|
|
|
|
|
|
|
|
|
|
strcmp eax, str_bisy, str_bisy.len
|
|
|
|
|
jz cmd_st_bisy
|
|
|
|
|
|
|
|
|
|
strcmp eax, str_free4chat, str_free4chat.len
|
|
|
|
|
jz cmd_st_free4chat
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD>.
|
|
|
|
|
; <20>뢥<EFBFBD><EBA2A5><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD> <20> <20><><EFBFBD><EFBFBD>㯭<EFBFBD><E3AFAD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
mov eax, str_status_message
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
call writemsg
|
|
|
|
|
|
|
|
|
|
jmp cmd_end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd_st_online:
|
|
|
|
|
|
|
|
|
|
cmd_st_away:
|
|
|
|
|
|
|
|
|
|
cmd_st_na:
|
|
|
|
|
|
|
|
|
|
cmd_st_dnd:
|
|
|
|
|
|
|
|
|
|
cmd_st_bisy:
|
|
|
|
|
|
|
|
|
|
cmd_st_free4chat:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd_no:
|
|
|
|
|
|
|
|
|
|
cmd_end:
|
|
|
|
|
pop esi
|
|
|
|
|
pop edi
|
|
|
|
|
pop ecx
|
|
|
|
|
pop ebx
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; <--- initialised data --->
|
|
|
|
|
DATA
|
2011-10-19 02:58:49 +04:00
|
|
|
|
include "parser_data.inc"
|
|
|
|
|
include "ssi_data.inc"
|
|
|
|
|
include "comp_data.inc"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
head db 'KI',0
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
MESS db 'Message from ', 0
|
|
|
|
|
CUSER db 'Current user: ', 0
|
|
|
|
|
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; <20><><EFBFBD>᮪ IP <20><>ࢥ ICQ
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;205.188.153.121
|
|
|
|
|
;icq_ip db '64.12.200.089',0
|
|
|
|
|
;icq_ip db '64.12.161.185',0
|
|
|
|
|
;icq_ip db '205.188.179.233',0
|
|
|
|
|
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
flap FLAP_head
|
|
|
|
|
rflap FLAP_head
|
|
|
|
|
;
|
|
|
|
|
ssnac SNAC_head ; <20><><EFBFBD> <20><>।<EFBFBD><E0A5A4><EFBFBD> SNAC
|
|
|
|
|
rsnac SNAC_head ; <20><><EFBFBD> <20>ਭ<EFBFBD>⮣<EFBFBD> SNAC
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
ui UI_head ; User info
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
procinfo process_information
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;UIN db '362820484',0
|
|
|
|
|
;PASS db 'test',0
|
2011-02-02 12:52:07 +03:00
|
|
|
|
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
|
2011-10-19 02:58:49 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;CAPABILITIES db 0x09, 0x46, 0x13, 0x49, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00,\
|
|
|
|
|
;0x97, 0xB1, 0x27, 0x51, 0x24, 0x3C, 0x43, 0x34, 0xAD, 0x22, 0xD6, 0xAB, 0xF7, 0x3F, 0x14, 0x92,\
|
|
|
|
|
CAPABILITIES db 0x2E, 0x7A, 0x64, 0x75, 0xFA, 0xDF, 0x4D, 0xC8, 0x88, 0x6F, 0xEA, 0x35, 0x95, 0xFD, 0xB6, 0xDF,\
|
|
|
|
|
'KOLIBRI KI(cq)',0,0
|
|
|
|
|
;0x09, 0x46, 0x13, 0x44, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00
|
|
|
|
|
|
|
|
|
|
; 1 <20><>ப<EFBFBD>
|
|
|
|
|
; {09461349-4C7F-11D1-8222-444553540000}
|
|
|
|
|
; Client supports channel 2 extended, TLV(0x2711) based messages. Currently used only by ICQ clients.
|
|
|
|
|
;ICQ clients and clones use this GUID as message format sign. Trillian client use another GUID
|
|
|
|
|
; in channel 2 messages to implement its own message format (trillian doesn't use TLV(x2711) in SecureIM channel 2 messages!).
|
|
|
|
|
;
|
|
|
|
|
; 2 <20><>ப<EFBFBD>
|
|
|
|
|
; {97B12751-243C-4334-AD22-D6ABF73F1492}
|
|
|
|
|
; Client supports RTF messages. This capability currently used by ICQ service and ICQ clients.
|
|
|
|
|
;
|
|
|
|
|
; 4 <20><>ப<EFBFBD>
|
|
|
|
|
; {0946134E-4C7F-11D1-8222-444553540000}
|
|
|
|
|
; Client supports UTF-8 messages. This capability currently used by AIM service and AIM clients
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
; From &RQ
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
;CAPABILITIES db 0x09, 0x46, 0x13, 0x49, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45,\ ;...P.F.IL.T<>"DE
|
|
|
|
|
; 0x53, 0x54, 0x00, 0x00, 0x09, 0x46, 0x13, 0x44, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45,\ ;ST...F.DL.T<>"DE
|
|
|
|
|
; 0x53, 0x54, 0x00, 0x00, 0x09, 0x46, 0x13, 0x4E, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45,\ ;ST...F.NL.T<>"DE
|
|
|
|
|
; 0x53, 0x54, 0x00, 0x00, 0x09, 0x46, 0x00, 0x00, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45,\ ;ST...F..L.T<>"DE
|
|
|
|
|
; 0x53, 0x54, 0x00, 0x00, 0x26, 0x52, 0x51, 0x69, 0x6E, 0x73, 0x69, 0x64, 0x65, 0x02, 0x07, 0x09,\ ;ST..&RQinside...
|
|
|
|
|
; 0x00, 0x00, 0x00, 0x00
|
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
C_LEN = 32
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;C_LEN = 80
|
|
|
|
|
ICBM_PARAMS db 0, 0, 0, 0, 0, 0Bh, 01Fh, 040h, 3, 0E7h, 3, 0E7h, 0, 0, 0, 0
|
2011-10-19 02:58:49 +04:00
|
|
|
|
ICBMP_LEN = 16 ; ^^^ from &RQ
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; from &rq
|
|
|
|
|
;
|
2011-10-19 02:58:49 +04:00
|
|
|
|
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
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
FA_LEN = 50h
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;
|
|
|
|
|
;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
;
|
|
|
|
|
ID_NUM = 010Ah
|
|
|
|
|
MAJOR = 05h
|
|
|
|
|
;MAJOR = 04h
|
|
|
|
|
;MINOR = 041h
|
|
|
|
|
MINOR = 011h
|
|
|
|
|
LESSER = 01h
|
|
|
|
|
;BUILD = 0CD1h
|
|
|
|
|
BUILD = 0E3Ah
|
|
|
|
|
DISTR = 055h
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
TCB_ESTABLISHED = 4
|
|
|
|
|
TCB_CLOSED = 11
|
|
|
|
|
;
|
|
|
|
|
CL_LANG db 'en',0
|
|
|
|
|
CL_COUNTRY db 'us',0
|
|
|
|
|
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
sbuff db 1024 dup 0 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>।<EFBFBD><E0A5A4><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> sendflap
|
|
|
|
|
|
|
|
|
|
;recived db 0 ; <20>ਭ<EFBFBD><E0A8AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ⥫<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;rbuff db 1024 dup 0 ; <20>ਥ<EFBFBD><E0A8A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
tbuff db 512 dup 0 ; <20><><EFBFBD> TLV
|
2011-02-02 12:52:07 +03:00
|
|
|
|
srv_cookie db 512 dup 0 ; <20>㪨 <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ਧ<EFBFBD>樨
|
|
|
|
|
bos_address db 128 dup 0 ; <20><><EFBFBD><EFBFBD><EFBFBD> BOS <20><>ࢥ<EFBFBD><E0A2A5>
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cookie_len dw 0 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20>㪨
|
|
|
|
|
seq dw 0 ; Sequence number
|
2011-02-02 12:52:07 +03:00
|
|
|
|
bos_ip dd 0
|
|
|
|
|
bos_port dd 0
|
2011-10-19 02:58:49 +04:00
|
|
|
|
status dw 0 ; status
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
mbuff db 2048 dup 0 ; <20><><EFBFBD> <20>ਥ<EFBFBD><E0A8A5>
|
|
|
|
|
MBUFF_SIZE = 2048
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
hrf db 0 ; <20><><EFBFBD><EFBFBD> <20>ਥ<EFBFBD><E0A8A5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
mouse_flag dd 0
|
|
|
|
|
socket dd 0
|
|
|
|
|
login db 0
|
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
msg_cookie1 dd 0 ; <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>⢥ত<E2A2A5><E0A6A4><EFBFBD><EFBFBD> <20>ਥ<EFBFBD><E0A8A5> ᮮ<>饭<EFBFBD><E9A5AD>
|
|
|
|
|
msg_cookie2 dd 0 ;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
curruser db 0 ; ⥪<>騩 <20><><EFBFBD>짮<EFBFBD><ECA7AE>⥫<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮮ<>饭<EFBFBD><E9A5AD>
|
|
|
|
|
; - <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><> <20><> <20><><EFBFBD>浪<EFBFBD>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
timer dw 0
|
|
|
|
|
|
|
|
|
|
;ltest db "ADMIN",0
|
2011-10-19 02:58:49 +04:00
|
|
|
|
buff db 1024 dup 0
|
|
|
|
|
; lbuff db 8 dup 0 ; <20><><EFBFBD> 1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>ࢥ<EFBFBD><E0A2A5>
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
;
|
|
|
|
|
; <20><>ப<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
str_status db 'status '
|
|
|
|
|
str_status.len = $ - str_status
|
|
|
|
|
str_exit db 'exit '
|
|
|
|
|
str_exit.len = $ - str_exit
|
|
|
|
|
;
|
|
|
|
|
; <20><>ப<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ᮢ <20><><EFBFBD> <20>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
str_away db 'away'
|
|
|
|
|
str_away.len = $ - str_away
|
|
|
|
|
|
|
|
|
|
str_dnd db 'dnd'
|
|
|
|
|
str_dnd.len = $ - str_dnd
|
|
|
|
|
|
|
|
|
|
str_bisy db 'bisy'
|
|
|
|
|
str_bisy.len = $ - str_bisy
|
|
|
|
|
|
|
|
|
|
str_na db 'na'
|
|
|
|
|
str_na.len = $ - str_na
|
|
|
|
|
|
|
|
|
|
str_online db 'online'
|
|
|
|
|
str_online.len = $ - str_online
|
|
|
|
|
|
|
|
|
|
str_free4chat db 'free4chat'
|
|
|
|
|
str_free4chat.len = $ - str_free4chat
|
|
|
|
|
|
|
|
|
|
str_status_message db '<27><><EFBFBD><EFBFBD>㯭<EFBFBD><E3AFAD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: away, bisy, na, dnd, online, free4chat',0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
;
|
|
|
|
|
;
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
2011-10-19 02:58:49 +04:00
|
|
|
|
cfg_message db 'Config:',0
|
|
|
|
|
|
2011-02-02 12:52:07 +03:00
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
; EDITBOXES
|
|
|
|
|
;
|
|
|
|
|
inputbuff:
|
|
|
|
|
rb 512
|
|
|
|
|
|
|
|
|
|
inputbox edit_box 490,10,460,0xffffff,0x6a9480,0,0xAABBCC,0,511,inputbuff,ed_focus,0,0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; <--- uninitialised data --->
|
|
|
|
|
UDATA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MEOS_APP_END
|
2011-10-19 02:58:49 +04:00
|
|
|
|
; <--- end of MenuetOS application --->
|