Rev 1832 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1832 | Rev 1833 | ||
---|---|---|---|
1 | ; <--- description ---> |
1 | ; <--- description ---> |
2 | ; compiler: FASM 1.67.21 |
2 | ; compiler: FASM 1.67.21 |
3 | ; name: ICQ for Kolibri |
3 | ; name: ICQ for Kolibri |
4 | ; version: 0.01 |
4 | ; version: 0.01 |
5 | ; written by: LV |
5 | ; written by: LV |
6 | ; e-mail: lv4evil@ya.ru |
6 | ; e-mail: lv4evil@ya.ru |
7 | 7 | ||
8 | 8 | ||
9 | ; <--- include all MeOS stuff ---> |
9 | ; <--- include all MeOS stuff ---> |
10 | include "lang.inc" |
10 | include "lang.inc" |
11 | include "MACROS.INC" |
11 | include "../../../macros.inc" |
12 | purge mov |
12 | purge mov |
13 | ;include "ASCL9/ascl.inc" |
13 | ;include "ASCL9/ascl.inc" |
14 | ;include "debug.inc" |
14 | ;include "debug.inc" |
15 | include "editbox.inc" |
15 | include "editbox.inc" |
16 | 16 | ||
17 | ; <--- start of MenuetOS application ---> |
17 | ; <--- start of MenuetOS application ---> |
18 | MEOS_APP_START |
18 | MEOS_APP_START |
19 | 19 | ||
20 | ;include "debug.inc" |
20 | ;include "debug.inc" |
21 | include "2000.inc" |
21 | include "2000.inc" |
22 | include "comp.inc" |
22 | include "comp.inc" |
23 | 23 | ||
24 | use_edit_box procinfo,22,5 |
24 | use_edit_box procinfo,22,5 |
25 | 25 | ||
26 | ; <--- start of code ---> |
26 | ; <--- start of code ---> |
27 | CODE |
27 | CODE |
28 | 28 | ||
29 | 29 | ||
30 | ;mov eax, 40 |
30 | ;mov eax, 40 |
31 | ;mov ebx, 47h |
31 | ;mov ebx, 47h |
32 | ;int 40h |
32 | ;int 40h |
33 | 33 | ||
34 | call loaduin |
34 | call loaduin |
35 | call draw_window ; at first create and draw the window |
35 | call draw_window ; at first create and draw the window |
36 | 36 | ||
37 | ;call buttonbox |
37 | ;call buttonbox |
38 | 38 | ||
39 | wait_event: ; main cycle |
39 | wait_event: ; main cycle |
40 | mov eax, 23 |
40 | mov eax, 23 |
41 | mov ebx, 20 |
41 | mov ebx, 20 |
42 | int 0x40 |
42 | int 0x40 |
43 | 43 | ||
44 | cmp eax, 1 ; if event == 1 |
44 | cmp eax, 1 ; if event == 1 |
45 | je redraw ; jump to redraw handler |
45 | je redraw ; jump to redraw handler |
46 | cmp eax, 2 ; else if event == 2 |
46 | cmp eax, 2 ; else if event == 2 |
47 | je key ; jump to key handler |
47 | je key ; jump to key handler |
48 | cmp eax, 3 ; else if event == 3 |
48 | cmp eax, 3 ; else if event == 3 |
49 | je button ; jump to button handler |
49 | je button ; jump to button handler |
50 | 50 | ||
51 | ; |
51 | ; |
52 | ; ¤¥¬ ¤ ëå |
52 | ; ¤¥¬ ¤ ëå |
53 | ; |
53 | ; |
54 | mov eax, 53 |
54 | mov eax, 53 |
55 | mov ebx, 2 |
55 | mov ebx, 2 |
56 | push ecx |
56 | push ecx |
57 | mov ecx, [socket] |
57 | mov ecx, [socket] |
58 | int 0x40 |
58 | int 0x40 |
59 | pop ecx |
59 | pop ecx |
60 | cmp eax, 0 |
60 | cmp eax, 0 |
61 | jnz read_socket |
61 | jnz read_socket |
62 | 62 | ||
63 | mouse_edit_box inputbox |
63 | mouse_edit_box inputbox |
64 | ; |
64 | ; |
65 | ; ᫨ ¥áâì ᮥ¤¨¥¨¥ á á¥à¢¥à®¬, ¯®áë« ¥¬ ¯ ª¥âë - ¯®¤â¢¥¦¤¥¨ï ª ¦¤ë¥ 60 á |
65 | ; ᫨ ¥áâì ᮥ¤¨¥¨¥ á á¥à¢¥à®¬, ¯®áë« ¥¬ ¯ ª¥âë - ¯®¤â¢¥¦¤¥¨ï ª ¦¤ë¥ 60 á |
66 | ; |
66 | ; |
67 | call sendkeep |
67 | call sendkeep |
68 | 68 | ||
69 | jmp wait_event ; else return to the start of main cycle |
69 | jmp wait_event ; else return to the start of main cycle |
70 | 70 | ||
71 | 71 | ||
72 | redraw: ; redraw event handler |
72 | redraw: ; redraw event handler |
73 | call draw_window |
73 | call draw_window |
74 | jmp wait_event |
74 | jmp wait_event |
75 | 75 | ||
76 | 76 | ||
77 | key: ; key event handler |
77 | key: ; key event handler |
78 | mov eax, 2 ; get key code |
78 | mov eax, 2 ; get key code |
79 | int 0x40 |
79 | int 0x40 |
80 | 80 | ||
81 | cmp ah, 0Dh ; ஡¥« - ®â¯à ¢¨âì á®®¡é¥¨¥ |
81 | cmp ah, 0Dh ; ஡¥« - ®â¯à ¢¨âì á®®¡é¥¨¥ |
82 | jz send |
82 | jz send |
83 | 83 | ||
84 | 84 | ||
85 | key_edit_box inputbox |
85 | key_edit_box inputbox |
86 | 86 | ||
87 | jmp wait_event |
87 | jmp wait_event |
88 | 88 | ||
89 | 89 | ||
90 | button: ; button event handler |
90 | button: ; button event handler |
91 | mov eax, 17 ; get button identifier |
91 | mov eax, 17 ; get button identifier |
92 | int 0x40 |
92 | int 0x40 |
93 | 93 | ||
94 | cmp ah, 2 |
94 | cmp ah, 2 |
95 | jz connect |
95 | jz connect |
96 | 96 | ||
97 | cmp ah, 3 |
97 | cmp ah, 3 |
98 | jz disconnect |
98 | jz disconnect |
99 | 99 | ||
100 | cmp ah, 4 |
100 | cmp ah, 4 |
101 | jz send |
101 | jz send |
102 | 102 | ||
103 | ; |
103 | ; |
104 | ; ஢¥à塞, ¥ ¦ â «¨ ª®¯ª ¢ |
104 | ; ஢¥à塞, ¥ ¦ â «¨ ª®¯ª ¢ |
105 | ; 100 |
105 | ; 100 |
106 | cmp ah, UINS+100 |
106 | cmp ah, UINS+100 |
107 | jnc @f |
107 | jnc @f |
108 | cmp ah, 100 |
108 | cmp ah, 100 |
109 | jc @f |
109 | jc @f |
110 | ; |
110 | ; |
111 | ; ¦ â |
111 | ; ¦ â |
112 | ; |
112 | ; |
113 | sub ah, 100 |
113 | sub ah, 100 |
114 | mov [curruser], ah |
114 | mov [curruser], ah |
115 | ; |
115 | ; |
116 | ; 뢮¤¨¬ áâà®çªã, ª®¬ã |
116 | ; 뢮¤¨¬ áâà®çªã, ª®¬ã |
117 | ; |
117 | ; |
118 | shr eax, 8 |
118 | shr eax, 8 |
119 | and eax, 000000FFh |
119 | and eax, 000000FFh |
120 | push eax |
120 | push eax |
121 | mov eax, CUSER |
121 | mov eax, CUSER |
122 | call strlen |
122 | call strlen |
123 | mov ecx, eax |
123 | mov ecx, eax |
124 | mov eax, CUSER |
124 | mov eax, CUSER |
125 | mov ebx, buff |
125 | mov ebx, buff |
126 | call strcpy |
126 | call strcpy |
127 | pop eax |
127 | pop eax |
128 | mov ebx, NAME_LEN |
128 | mov ebx, NAME_LEN |
129 | imul ebx, eax |
129 | imul ebx, eax |
130 | lea eax, [names+ebx] |
130 | lea eax, [names+ebx] |
131 | mov [buff+ecx], ' ' ; ஡¥« |
131 | mov [buff+ecx], ' ' ; ஡¥« |
132 | lea ebx, [buff+ecx+1] |
132 | lea ebx, [buff+ecx+1] |
133 | mov ecx, NAME_LEN |
133 | mov ecx, NAME_LEN |
134 | call strcpy |
134 | call strcpy |
135 | mov eax, buff |
135 | mov eax, buff |
136 | xor ebx, ebx |
136 | xor ebx, ebx |
137 | call writemsg |
137 | call writemsg |
138 | 138 | ||
139 | 139 | ||
140 | 140 | ||
141 | 141 | ||
142 | @@: |
142 | @@: |
143 | cmp ah, 1 |
143 | cmp ah, 1 |
144 | jne wait_event ; return if button id != 1 |
144 | jne wait_event ; return if button id != 1 |
145 | 145 | ||
146 | or eax, -1 ; exit application |
146 | or eax, -1 ; exit application |
147 | int 0x40 |
147 | int 0x40 |
148 | 148 | ||
149 | 149 | ||
150 | draw_window: |
150 | draw_window: |
151 | mov eax, 12 ; start drawing |
151 | mov eax, 12 ; start drawing |
152 | mov ebx, 1 |
152 | mov ebx, 1 |
153 | int 0x40 |
153 | int 0x40 |
154 | 154 | ||
155 | mov eax, 0 ; create and draw the window |
155 | mov eax, 0 ; create and draw the window |
156 | mov ebx, 100*65536+700 ; (window_cx)*65536+(window_sx) |
156 | mov ebx, 100*65536+700 ; (window_cx)*65536+(window_sx) |
157 | mov ecx, 100*65536+500 ; (window_cy)*65536+(window_sy) |
157 | mov ecx, 100*65536+500 ; (window_cy)*65536+(window_sy) |
158 | mov edx, 0x03ffffff ; work area color & window type 3 |
158 | mov edx, 0x03ffffff ; work area color & window type 3 |
159 | ; mov esi, 0 ; grab color (not used) |
159 | ; mov esi, 0 ; grab color (not used) |
160 | ; mov edi, 0 ; frame color (not used) |
160 | ; mov edi, 0 ; frame color (not used) |
161 | int 0x40 |
161 | int 0x40 |
162 | 162 | ||
163 | mov eax, 4 ; window header |
163 | mov eax, 4 ; window header |
164 | mov ebx, 8*65536+8 ; coordinates |
164 | mov ebx, 8*65536+8 ; coordinates |
165 | mov ecx, 0x10ffffff ; color & font N1 |
165 | mov ecx, 0x10ffffff ; color & font N1 |
166 | mov edx, header ; address of text |
166 | mov edx, header ; address of text |
167 | mov esi, header.size ; length of text |
167 | mov esi, header.size ; length of text |
168 | int 0x40 |
168 | int 0x40 |
169 | 169 | ||
170 | draw_edit_box inputbox |
170 | draw_edit_box inputbox |
171 | 171 | ||
172 | rect 10, 30, 500, 450, 0 |
172 | rect 10, 30, 500, 450, 0 |
173 | 173 | ||
174 | draw_button 600, 460, 60, 15, 2, 'CONNECT' |
174 | draw_button 600, 460, 60, 15, 2, 'CONNECT' |
175 | ;draw_button 600, 460, 60, 15, 3, 'Disconnect' |
175 | ;draw_button 600, 460, 60, 15, 3, 'Disconnect' |
176 | draw_button 530, 460, 60, 15, 4, 'SEND' |
176 | draw_button 530, 460, 60, 15, 4, 'SEND' |
177 | 177 | ||
178 | call printbuff |
178 | call printbuff |
179 | call buttonbox |
179 | call buttonbox |
180 | 180 | ||
181 | 181 | ||
182 | mov eax, 12 ; finish drawing |
182 | mov eax, 12 ; finish drawing |
183 | mov ebx, 2 |
183 | mov ebx, 2 |
184 | int 0x40 |
184 | int 0x40 |
185 | 185 | ||
186 | ret |
186 | ret |
187 | 187 | ||
188 | ; |
188 | ; |
189 | ; ®¥¤¨¥¨¥ |
189 | ; ®¥¤¨¥¨¥ |
190 | ; |
190 | ; |
191 | connect: |
191 | connect: |
192 | mov eax, ICQ_IP |
192 | mov eax, ICQ_IP |
193 | mov ebx, ICQ_PORT |
193 | mov ebx, ICQ_PORT |
194 | call srv_connect |
194 | call srv_connect |
195 | ;call srv_login |
195 | ;call srv_login |
196 | 196 | ||
197 | 197 | ||
198 | jmp wait_event |
198 | jmp wait_event |
199 | 199 | ||
200 | 200 | ||
201 | ; |
201 | ; |
202 | ; |
202 | ; |
203 | ; |
203 | ; |
204 | disconnect: |
204 | disconnect: |
205 | mov ecx, [socket] |
205 | mov ecx, [socket] |
206 | call closesocket |
206 | call closesocket |
207 | 207 | ||
208 | jmp wait_event |
208 | jmp wait_event |
209 | 209 | ||
210 | 210 | ||
211 | ; |
211 | ; |
212 | ; |
212 | ; |
213 | ; |
213 | ; |
214 | send: |
214 | send: |
215 | ; |
215 | ; |
216 | ; ¯à¥¤¥«ï¥¬, ¥ ᬥ¥ «¨ ⥪ã騩 |
216 | ; ¯à¥¤¥«ï¥¬, ¥ ᬥ¥ «¨ ⥪ã騩 |
217 | ; |
217 | ; |
218 | ; «ï á¬¥ë ¨á¯®«ì§ã¥âáï / ¢ ç «¥ áâப¨ ¨ ®¬¥à 㨠|
218 | ; «ï á¬¥ë ¨á¯®«ì§ã¥âáï / ¢ ç «¥ áâப¨ ¨ ®¬¥à 㨠|
219 | ; ¯® ¯®à浪ã. ᫨ ¤«¨ > 2 ᨬ¢®«®¢, áç¨â ¥âáï, çâ® ¯¥à¥¤ |
219 | ; ¯® ¯®à浪ã. ᫨ ¤«¨ > 2 ᨬ¢®«®¢, áç¨â ¥âáï, çâ® ¯¥à¥¤ |
220 | ; á ¬ 㨠- ¤«ï ®â¯à ¢ª¨ á®®¡é¥¨© î§¥à ¬, ª®â®àëå ¥â ¢ |
220 | ; á ¬ 㨠- ¤«ï ®â¯à ¢ª¨ á®®¡é¥¨© î§¥à ¬, ª®â®àëå ¥â ¢ |
221 | ; |
221 | ; |
222 | mov al, [inputbuff] |
222 | mov al, [inputbuff] |
223 | cmp al, '/' |
223 | cmp al, '/' |
224 | jnz sd_message |
224 | jnz sd_message |
225 | ; ¬¥ 㨠|
225 | ; ¬¥ 㨠|
226 | ;mov al, [inputbuff+2] |
226 | ;mov al, [inputbuff+2] |
227 | ;cmp al, 20h |
227 | ;cmp al, 20h |
228 | ;jz sd_use_kl |
228 | ;jz sd_use_kl |
229 | mov al, [inputbuff+3] |
229 | mov al, [inputbuff+3] |
230 | cmp al, 20h ; ஡¥« |
230 | cmp al, 20h ; ஡¥« |
231 | jz sd_use_kl |
231 | jz sd_use_kl |
232 | ; |
232 | ; |
233 | ; 饬 ¯¥à¢ë© ¯à®¡¥«, ¨¬ ¤®«¦¥ § ª®ç¨âìáï 㨠|
233 | ; 饬 ¯¥à¢ë© ¯à®¡¥«, ¨¬ ¤®«¦¥ § ª®ç¨âìáï 㨠|
234 | ; |
234 | ; |
235 | xor ecx, ecx |
235 | xor ecx, ecx |
236 | sd_loop: |
236 | sd_loop: |
237 | mov al, [inputbuff+ecx] |
237 | mov al, [inputbuff+ecx] |
238 | cmp al, 20h |
238 | cmp al, 20h |
239 | jz sd_space |
239 | jz sd_space |
240 | cmp al, 0 |
240 | cmp al, 0 |
241 | jz wait_event |
241 | jz wait_event |
242 | inc ecx |
242 | inc ecx |
243 | jmp sd_loop |
243 | jmp sd_loop |
244 | 244 | ||
245 | sd_space: |
245 | sd_space: |
246 | ; |
246 | ; |
247 | ; ¬¥ï¥¬ ¯à®¡¥« 0, ®âáë« ¥¬ á®®¡é¥¨¥ |
247 | ; ¬¥ï¥¬ ¯à®¡¥« 0, ®âáë« ¥¬ á®®¡é¥¨¥ |
248 | mov [inputbuff+ecx], byte 0 |
248 | mov [inputbuff+ecx], byte 0 |
249 | lea ebx, [inputbuff+1] |
249 | lea ebx, [inputbuff+1] |
250 | lea eax, [inputbuff+ecx+1] |
250 | lea eax, [inputbuff+ecx+1] |
251 | call sendmsg |
251 | call sendmsg |
252 | mov ebx, 0000FFh |
252 | mov ebx, 0000FFh |
253 | call writemsg |
253 | call writemsg |
254 | jmp wait_event |
254 | jmp wait_event |
255 | 255 | ||
256 | 256 | ||
257 | 257 | ||
258 | sd_use_kl: |
258 | sd_use_kl: |
259 | lea eax, [inputbuff+1] |
259 | lea eax, [inputbuff+1] |
260 | mov [inputbuff+3], byte 0 |
260 | mov [inputbuff+3], byte 0 |
261 | call ascitoint |
261 | call ascitoint |
262 | lea eax, [eax-1] ; .ª. ¢ ®âáç¥â á 0 |
262 | lea eax, [eax-1] ; .ª. ¢ ®âáç¥â á 0 |
263 | mov [curruser], al |
263 | mov [curruser], al |
264 | 264 | ||
265 | 265 | ||
266 | sd_message: |
266 | sd_message: |
267 | ; |
267 | ; |
268 | ; ®®¡é¥¨¥ |
268 | ; ®®¡é¥¨¥ |
269 | movzx eax, [curruser] |
269 | movzx eax, [curruser] |
270 | mov ebx, UIN_LEN |
270 | mov ebx, UIN_LEN |
271 | imul ebx, eax |
271 | imul ebx, eax |
272 | lea ebx, [uins+ebx] |
272 | lea ebx, [uins+ebx] |
273 | mov al, [inputbuff] |
273 | mov al, [inputbuff] |
274 | cmp al, '/' |
274 | cmp al, '/' |
275 | jz @f |
275 | jz @f |
276 | mov eax, inputbuff |
276 | mov eax, inputbuff |
277 | jmp sd_send |
277 | jmp sd_send |
278 | @@: |
278 | @@: |
279 | ;mov al, [inputbuff+2] |
279 | ;mov al, [inputbuff+2] |
280 | ;cmp al, ' ' |
280 | ;cmp al, ' ' |
281 | ;jz @f |
281 | ;jz @f |
282 | lea eax, [inputbuff+4] |
282 | lea eax, [inputbuff+4] |
283 | ;jmp sd_send |
283 | ;jmp sd_send |
284 | ;@@: lea eax, [inputbuff+3] |
284 | ;@@: lea eax, [inputbuff+3] |
285 | 285 | ||
286 | sd_send: |
286 | sd_send: |
287 | call sendmsg |
287 | call sendmsg |
288 | mov ebx, 0000FFh |
288 | mov ebx, 0000FFh |
289 | call writemsg |
289 | call writemsg |
290 | 290 | ||
291 | 291 | ||
292 | jmp wait_event |
292 | jmp wait_event |
293 | 293 | ||
294 | 294 | ||
295 | ; |
295 | ; |
296 | ; áâì ¯à¨ïâë¥ ¤ ë¥ |
296 | ; áâì ¯à¨ïâë¥ ¤ ë¥ |
297 | ; |
297 | ; |
298 | read_socket: |
298 | read_socket: |
299 | pushf |
299 | pushf |
300 | pushad |
300 | pushad |
301 | ;write_debug 'Some data in socket' |
301 | ;write_debug 'Some data in socket' |
302 | ; |
302 | ; |
303 | ; ஢¥à塞, ¥ ¡ë« «¨ ¯®«ãç¥ § £®«®¢®ª ®â¤¥«ì® ®â ¤ ëå |
303 | ; ஢¥à塞, ¥ ¡ë« «¨ ¯®«ãç¥ § £®«®¢®ª ®â¤¥«ì® ®â ¤ ëå |
304 | ; ¢ ¯à¥¤ë¤ã饬 横«¥ |
304 | ; ¢ ¯à¥¤ë¤ã饬 横«¥ |
305 | ; |
305 | ; |
306 | cmp [hrf], 1 |
306 | cmp [hrf], 1 |
307 | jz rs_head_recived |
307 | jz rs_head_recived |
308 | 308 | ||
309 | 309 | ||
310 | mov eax, 53 |
310 | mov eax, 53 |
311 | mov ebx, 2 |
311 | mov ebx, 2 |
312 | mov ecx, [socket] |
312 | mov ecx, [socket] |
313 | int 40h |
313 | int 40h |
314 | cmp eax, 6 ; Flap head size |
314 | cmp eax, 6 ; Flap head size |
315 | jc r_end |
315 | jc r_end |
316 | ; |
316 | ; |
317 | ; ਨ¬ ¥¬ § £®«®¢®ª |
317 | ; ਨ¬ ¥¬ § £®«®¢®ª |
318 | ; |
318 | ; |
319 | xor edx, edx |
319 | xor edx, edx |
320 | 320 | ||
321 | ;mov ecx, [socket] |
321 | ;mov ecx, [socket] |
322 | rs_loop: |
322 | rs_loop: |
323 | mov eax, 53 |
323 | mov eax, 53 |
324 | mov ebx, 3 |
324 | mov ebx, 3 |
325 | 325 | ||
326 | int 40h |
326 | int 40h |
327 | 327 | ||
328 | mov [mbuff+edx], bl |
328 | mov [mbuff+edx], bl |
329 | inc edx |
329 | inc edx |
330 | cmp edx, 6 |
330 | cmp edx, 6 |
331 | 331 | ||
332 | jnz rs_loop |
332 | jnz rs_loop |
333 | ; |
333 | ; |
334 | ; ¯®«ï¥¬ § £®«®¢®ª |
334 | ; ¯®«ï¥¬ § £®«®¢®ª |
335 | ; |
335 | ; |
336 | ;xor eax, eax |
336 | ;xor eax, eax |
337 | 337 | ||
338 | ; |
338 | ; |
339 | ; £®«®¢®ª ¯à¨ïâ! |
339 | ; £®«®¢®ª ¯à¨ïâ! |
340 | ; |
340 | ; |
341 | mov [hrf], 1 |
341 | mov [hrf], 1 |
342 | 342 | ||
343 | mov bl, [mbuff] |
343 | mov bl, [mbuff] |
344 | mov [rflap.bId], bl |
344 | mov [rflap.bId], bl |
345 | 345 | ||
346 | mov bl, [mbuff+1] |
346 | mov bl, [mbuff+1] |
347 | mov [rflap.bCh], bl |
347 | mov [rflap.bCh], bl |
348 | 348 | ||
349 | mov bh, [mbuff+2] |
349 | mov bh, [mbuff+2] |
350 | mov bl, [mbuff+3] |
350 | mov bl, [mbuff+3] |
351 | mov [rflap.wSn], bx |
351 | mov [rflap.wSn], bx |
352 | 352 | ||
353 | mov bh, [mbuff+4] |
353 | mov bh, [mbuff+4] |
354 | mov bl, [mbuff+5] |
354 | mov bl, [mbuff+5] |
355 | mov [rflap.wDs], bx |
355 | mov [rflap.wDs], bx |
356 | 356 | ||
357 | ; |
357 | ; |
358 | ; ਨ¬ ¥¬ ¤ ë¥ |
358 | ; ਨ¬ ¥¬ ¤ ë¥ |
359 | ; |
359 | ; |
360 | ;xor edx, edx |
360 | ;xor edx, edx |
361 | cmp [rflap.bId], 2Ah |
361 | cmp [rflap.bId], 2Ah |
362 | jnz rs_flap_error |
362 | jnz rs_flap_error |
363 | ; |
363 | ; |
364 | ; ஢¥à塞, ¯®«ãç¥ë «¨ ¤ ë¥ |
364 | ; ஢¥à塞, ¯®«ãç¥ë «¨ ¤ ë¥ |
365 | ; |
365 | ; |
366 | rs_head_recived: |
366 | rs_head_recived: |
367 | 367 | ||
368 | mov eax, 53 |
368 | mov eax, 53 |
369 | mov ebx, 2 |
369 | mov ebx, 2 |
370 | ;mov ecx, [socket] |
370 | ;mov ecx, [socket] |
371 | int 40h |
371 | int 40h |
372 | cmp ax, [rflap.wDs] ; §¬¥à ¤ ëå |
372 | cmp ax, [rflap.wDs] ; §¬¥à ¤ ëå |
373 | jc r_end |
373 | jc r_end |
374 | ; |
374 | ; |
375 | ; |
375 | ; |
376 | mov ax, [rflap.wDs] |
376 | mov ax, [rflap.wDs] |
377 | ; |
377 | ; |
378 | ; ஢¥à塞 à §¬¥à ¤ ëå |
378 | ; ஢¥à塞 à §¬¥à ¤ ëå |
379 | ; |
379 | ; |
380 | cmp ax, MBUFF_SIZE+1 |
380 | cmp ax, MBUFF_SIZE+1 |
381 | jnc rs_big_flap |
381 | jnc rs_big_flap |
382 | 382 | ||
383 | xor esi, esi |
383 | xor esi, esi |
384 | mov esi, eax |
384 | mov esi, eax |
385 | xor edx, edx |
385 | xor edx, edx |
386 | 386 | ||
387 | ;mov ecx, [socket] |
387 | ;mov ecx, [socket] |
388 | 388 | ||
389 | rs_data_loop: |
389 | rs_data_loop: |
390 | cmp edx, esi |
390 | cmp edx, esi |
391 | jz rs_data_end |
391 | jz rs_data_end |
392 | 392 | ||
393 | mov eax, 53 |
393 | mov eax, 53 |
394 | mov ebx, 3 |
394 | mov ebx, 3 |
395 | int 40h |
395 | int 40h |
396 | mov [mbuff+edx], bl |
396 | mov [mbuff+edx], bl |
397 | inc edx |
397 | inc edx |
398 | jmp rs_data_loop |
398 | jmp rs_data_loop |
399 | 399 | ||
400 | ; |
400 | ; |
401 | ; ë¥ ¯à¨ïâë |
401 | ; ë¥ ¯à¨ïâë |
402 | ; |
402 | ; |
403 | rs_data_end: |
403 | rs_data_end: |
404 | mov [hrf], 0 |
404 | mov [hrf], 0 |
405 | write_debug 'Some data recived' |
405 | write_debug 'Some data received' |
406 | ; |
406 | ; |
407 | ; |
407 | ; |
408 | ; |
408 | ; |
409 | cmp [login], 0 |
409 | cmp [login], 0 |
410 | jz rs_login |
410 | jz rs_login |
411 | call main_loop |
411 | call main_loop |
412 | jmp r_end |
412 | jmp r_end |
413 | 413 | ||
414 | 414 | ||
415 | rs_login: |
415 | rs_login: |
416 | call srv_login |
416 | call srv_login |
417 | ;write_debug 'Exited srv_login' |
417 | ;write_debug 'Exited srv_login' |
418 | jmp r_end |
418 | jmp r_end |
419 | 419 | ||
420 | rs_flap_error: |
420 | rs_flap_error: |
421 | write_debug 'Invalid Flap' |
421 | write_debug 'Invalid Flap' |
422 | ; |
422 | ; |
423 | ; FLAP.id ¥¢¥àë©. 㦮 § ªàëâì ᮪¥â |
423 | ; FLAP.id ¥¢¥àë©. 㦮 § ªàëâì ᮪¥â |
424 | ; |
424 | ; |
425 | 425 | ||
426 | mov ecx, [socket] |
426 | mov ecx, [socket] |
427 | ;call closesocket |
427 | ;call closesocket |
428 | jmp r_end |
428 | jmp r_end |
429 | 429 | ||
430 | ; |
430 | ; |
431 | ; «¨èª®¬ ¡®«ì让 ¯ ª¥â! |
431 | ; «¨èª®¬ ¡®«ì让 ¯ ª¥â! |
432 | ; |
432 | ; |
433 | rs_big_flap: |
433 | rs_big_flap: |
434 | 434 | ||
435 | write_debug 'Too BIG FLAP Recived' |
435 | write_debug 'Too BIG FLAP Received' |
436 | mov [hrf], 0 |
436 | mov [hrf], 0 |
437 | 437 | ||
438 | mov ecx, [socket] |
438 | mov ecx, [socket] |
439 | mov ax, [rflap.wDs] |
439 | mov ax, [rflap.wDs] |
440 | xor esi, esi |
440 | xor esi, esi |
441 | mov esi, eax |
441 | mov esi, eax |
442 | xor edx, edx |
442 | xor edx, edx |
443 | 443 | ||
444 | rs_data_loop2: |
444 | rs_data_loop2: |
445 | cmp edx, esi |
445 | cmp edx, esi |
446 | jz r_end |
446 | jz r_end |
447 | 447 | ||
448 | mov eax, 53 |
448 | mov eax, 53 |
449 | mov ebx, 3 |
449 | mov ebx, 3 |
450 | int 40h |
450 | int 40h |
451 | ;mov [mbuff+edx], bl |
451 | ;mov [mbuff+edx], bl |
452 | inc edx |
452 | inc edx |
453 | jmp rs_data_loop2 |
453 | jmp rs_data_loop2 |
454 | 454 | ||
455 | 455 | ||
456 | 456 | ||
457 | 457 | ||
458 | 458 | ||
459 | r_end: |
459 | r_end: |
460 | 460 | ||
461 | popad |
461 | popad |
462 | popf |
462 | popf |
463 | jmp wait_event |
463 | jmp wait_event |
464 | 464 | ||
465 | ; ®¥¤¨¥¨¥ á á¥à¢¥à®¬, ¢®§¢à é ¥â ¢ eax - åí¤« ᮪¥â |
465 | ; ®¥¤¨¥¨¥ á á¥à¢¥à®¬, ¢®§¢à é ¥â ¢ eax - åí¤« ᮪¥â |
466 | ; ¯¥à¥¤ ¥¬ ¢ ¥ å IP ¤à¥á á¥à¢¥à |
466 | ; ¯¥à¥¤ ¥¬ ¢ ¥ å IP ¤à¥á á¥à¢¥à |
467 | ; ¢ ebx - ¯®àâ |
467 | ; ¢ ebx - ¯®àâ |
468 | srv_connect: |
468 | srv_connect: |
469 | push ecx |
469 | push ecx |
470 | push edx |
470 | push edx |
471 | push esi |
471 | push esi |
472 | push edi |
472 | push edi |
473 | push ebx |
473 | push ebx |
474 | 474 | ||
475 | mov esi, eax ; IP - ¢ esi |
475 | mov esi, eax ; IP - ¢ esi |
476 | ; find free port |
476 | ; find free port |
477 | mov ecx, 1000 ; ¯à¥¤¥«ï¥¬ «®ª «ìë© ¯®àâ, ç¨ ¥¬ á 1000 |
477 | mov ecx, 1000 ; ¯à¥¤¥«ï¥¬ «®ª «ìë© ¯®àâ, ç¨ ¥¬ á 1000 |
478 | 478 | ||
479 | getlp: |
479 | getlp: |
480 | inc ecx |
480 | inc ecx |
481 | push ecx |
481 | push ecx |
482 | mov eax, 53 |
482 | mov eax, 53 |
483 | mov ebx, 9 |
483 | mov ebx, 9 |
484 | int 0x40 |
484 | int 0x40 |
485 | pop ecx |
485 | pop ecx |
486 | cmp eax, 0 ; íâ®â «®ª «ìë© ¯®à⠨ᯮ«ì§ã¥âáï? |
486 | cmp eax, 0 ; íâ®â «®ª «ìë© ¯®à⠨ᯮ«ì§ã¥âáï? |
487 | jz getlp ; ¤ - ¯à®¤®«¦ ¥¬ ¯¥à¥¡¨à âì |
487 | jz getlp ; ¤ - ¯à®¤®«¦ ¥¬ ¯¥à¥¡¨à âì |
488 | ;OK ecx = port number |
488 | ;OK ecx = port number |
489 | ;Open Socket |
489 | ;Open Socket |
490 | mov eax, 53 |
490 | mov eax, 53 |
491 | mov ebx, 5 |
491 | mov ebx, 5 |
492 | xor edx, edx |
492 | xor edx, edx |
493 | ;mov dx, ICQ_PORT |
493 | ;mov dx, ICQ_PORT |
494 | pop edx |
494 | pop edx |
495 | ;mov esi,ICQ_IP |
495 | ;mov esi,ICQ_IP |
496 | mov edi, 1;SOCKET_ACTIVE |
496 | mov edi, 1;SOCKET_ACTIVE |
497 | 497 | ||
498 | int 040h |
498 | int 040h |
499 | ; |
499 | ; |
500 | mov [socket], eax |
500 | mov [socket], eax |
501 | ; |
501 | ; |
502 | ; ¤¥¬ ãáâ ®¢ª¨ ᮥ¤¨¥¨ï |
502 | ; ¤¥¬ ãáâ ®¢ª¨ ᮥ¤¨¥¨ï |
503 | mov ecx, eax |
503 | mov ecx, eax |
504 | srv_loop: |
504 | srv_loop: |
505 | 505 | ||
506 | mov eax, 53 |
506 | mov eax, 53 |
507 | mov ebx, 6 |
507 | mov ebx, 6 |
508 | int 40h |
508 | int 40h |
509 | cmp eax, TCB_ESTABLISHED |
509 | cmp eax, TCB_ESTABLISHED |
510 | jz fin |
510 | jz fin |
511 | cmp eax, 11 |
511 | cmp eax, 11 |
512 | jae @f |
512 | jae @f |
513 | ; |
513 | ; |
514 | mov eax, 5 |
514 | mov eax, 5 |
515 | mov ebx, 50 |
515 | mov ebx, 50 |
516 | int 40h |
516 | int 40h |
517 | jmp srv_loop |
517 | jmp srv_loop |
518 | 518 | ||
519 | 519 | ||
520 | 520 | ||
521 | 521 | ||
522 | ;cmp eax,-1 |
522 | ;cmp eax,-1 |
523 | ;jnz fin |
523 | ;jnz fin |
524 | ;delay 100 |
524 | ;delay 100 |
525 | write_debug 'CONNECTION FAILED' ;®¤ª«î票¥ ¥ 㤠«®áì |
525 | write_debug 'CONNECTION FAILED' ;®¤ª«î票¥ ¥ 㤠«®áì |
526 | jmp @f |
526 | jmp @f |
527 | ;connrcted: |
527 | ;connrcted: |
528 | ;CONNECTED |
528 | ;CONNECTED |
529 | 529 | ||
530 | fin: |
530 | fin: |
531 | write_debug 'Connected!!!!' |
531 | write_debug 'Connected!!!!' |
532 | @@: |
532 | @@: |
533 | pop edi |
533 | pop edi |
534 | pop esi |
534 | pop esi |
535 | pop edx |
535 | pop edx |
536 | pop ecx |
536 | pop ecx |
537 | ;pop ebx |
537 | ;pop ebx |
538 | ret |
538 | ret |
539 | 539 | ||
540 | ; |
540 | ; |
541 | ; --> ecx socket handle |
541 | ; --> ecx socket handle |
542 | ; |
542 | ; |
543 | buff db 1024 dup 0 |
543 | buff db 1024 dup 0 |
544 | lbuff db 8 dup 0 ; «ï 1 ¯ ª¥â ®â á¥à¢¥à |
544 | lbuff db 8 dup 0 ; «ï 1 ¯ ª¥â ®â á¥à¢¥à |
545 | srv_login: |
545 | srv_login: |
546 | pushf |
546 | pushf |
547 | push eax |
547 | push eax |
548 | push ebx |
548 | push ebx |
549 | ;push ecx |
549 | ;push ecx |
550 | push edx |
550 | push edx |
551 | 551 | ||
552 | ; |
552 | ; |
553 | ; ¯à¥¤¥«ï¥¬ ⨯ ¯®«ãç¥ëå ¤ ëå |
553 | ; ¯à¥¤¥«ï¥¬ ⨯ ¯®«ãç¥ëå ¤ ëå |
554 | ; |
554 | ; |
555 | movzx eax, [rflap.bCh] |
555 | movzx eax, [rflap.bCh] |
556 | cmp eax, 01 |
556 | cmp eax, 01 |
557 | jz s_new_connection |
557 | jz s_new_connection |
558 | cmp eax, 04 |
558 | cmp eax, 04 |
559 | jz s_cookie ; cookie |
559 | jz s_cookie ; cookie |
560 | jmp l_flap_err |
560 | jmp l_flap_err |
561 | 561 | ||
562 | s_new_connection: |
562 | s_new_connection: |
563 | ; |
563 | ; |
564 | ; ஢¥à塞 ¯®«ãç¥ë© ¯ ª¥â |
564 | ; ஢¥à塞 ¯®«ãç¥ë© ¯ ª¥â |
565 | ; |
565 | ; |
566 | movzx eax, [rflap.wDs] |
566 | movzx eax, [rflap.wDs] |
567 | cmp eax, 4 |
567 | cmp eax, 4 |
568 | jnz l_len_err |
568 | jnz l_len_err |
569 | mov eax, dword [mbuff] |
569 | mov eax, dword [mbuff] |
570 | cmp eax, 01000000h ; 00 00 00 01 |
570 | cmp eax, 01000000h ; 00 00 00 01 |
571 | jnz l_data_err |
571 | jnz l_data_err |
572 | ; |
572 | ; |
573 | ;®à¬¨à㥬 ¯ ª¥â ¤«ï ᮥ¤¨¥¨ï |
573 | ;®à¬¨à㥬 ¯ ª¥â ¤«ï ᮥ¤¨¥¨ï |
574 | ; |
574 | ; |
575 | ;mov [flap.bId], FLAP_ID |
575 | ;mov [flap.bId], FLAP_ID |
576 | mov [flap.bCh], NEW_CONNECTION |
576 | mov [flap.bCh], NEW_CONNECTION |
577 | 577 | ||
578 | mov eax, 26 |
578 | mov eax, 26 |
579 | mov ebx, 9 |
579 | mov ebx, 9 |
580 | int 40h |
580 | int 40h |
581 | mov [seq], ax |
581 | mov [seq], ax |
582 | 582 | ||
583 | mov [flap.wSn], ax ; Sequence number |
583 | mov [flap.wSn], ax ; Sequence number |
584 | ;mov [buff],0 |
584 | ;mov [buff],0 |
585 | ;mov [buff+1],0 |
585 | ;mov [buff+1],0 |
586 | ;mov [buff+2],0 |
586 | ;mov [buff+2],0 |
587 | mov dword [buff], 0x01000000 ;login Protokol version 00 00 00 01 |
587 | mov dword [buff], 0x01000000 ;login Protokol version 00 00 00 01 |
588 | ;mov[buff+4],0 |
588 | ;mov[buff+4],0 |
589 | mov word [buff+4], 0x0100; TLV.TYPE = UIN 00 01 |
589 | mov word [buff+4], 0x0100; TLV.TYPE = UIN 00 01 |
590 | 590 | ||
591 | mov eax, UIN |
591 | mov eax, UIN |
592 | call strlen |
592 | call strlen |
593 | mov [buff+6], ah |
593 | mov [buff+6], ah |
594 | mov [buff+7], al ; Length of UIN |
594 | mov [buff+7], al ; Length of UIN |
595 | mov edx, eax |
595 | mov edx, eax |
596 | add edx, 7 ; ¢ edx ¤«¨ § ¯®«¥®£® ¡ãä¥à |
596 | add edx, 7 ; ¢ edx ¤«¨ § ¯®«¥®£® ¡ãä¥à |
597 | 597 | ||
598 | mov ecx, eax ;«¨ áâப¨ |
598 | mov ecx, eax ;«¨ áâப¨ |
599 | 599 | ||
600 | mov eax, UIN |
600 | mov eax, UIN |
601 | lea ebx, [buff+8] ; + à §¬¥à ¤ ëå ¢ ¡ãä¥à¥ + 1 |
601 | lea ebx, [buff+8] ; + à §¬¥à ¤ ëå ¢ ¡ãä¥à¥ + 1 |
602 | 602 | ||
603 | call strcpy |
603 | call strcpy |
604 | 604 | ||
605 | 605 | ||
606 | mov eax, PASS |
606 | mov eax, PASS |
607 | call roast |
607 | call roast |
608 | 608 | ||
609 | mov [buff+edx+2], 2 ; TLV.TYPE - rosted password |
609 | mov [buff+edx+2], 2 ; TLV.TYPE - rosted password |
610 | call strlen |
610 | call strlen |
611 | mov word [buff+edx+4], ax ; Length of pass |
611 | mov word [buff+edx+4], ax ; Length of pass |
612 | 612 | ||
613 | add edx, 4 |
613 | add edx, 4 |
614 | mov ebx, buff |
614 | mov ebx, buff |
615 | add ebx, edx ; § 票¥ |
615 | add ebx, edx ; § 票¥ |
616 | add edx, eax ; ®åà 塞 ¢ EDX ¤«¨ã § ¯®«¥®£® ¡ãäà |
616 | add edx, eax ; ®åà 塞 ¢ EDX ¤«¨ã § ¯®«¥®£® ¡ãäà |
617 | mov ecx, eax ; «¨ áâப¨ |
617 | mov ecx, eax ; «¨ áâப¨ |
618 | mov eax, PASS ; áâ®ç¨ª |
618 | mov eax, PASS ; áâ®ç¨ª |
619 | inc ebx |
619 | inc ebx |
620 | call strcpy |
620 | call strcpy |
621 | 621 | ||
622 | mov [buff+edx+2], 3 ; TLV.TYPE - client id string |
622 | mov [buff+edx+2], 3 ; TLV.TYPE - client id string |
623 | mov eax, ID_STRING |
623 | mov eax, ID_STRING |
624 | call strlen |
624 | call strlen |
625 | mov word [buff+edx+4], ax |
625 | mov word [buff+edx+4], ax |
626 | 626 | ||
627 | add edx, 4 |
627 | add edx, 4 |
628 | mov ecx, eax |
628 | mov ecx, eax |
629 | mov ebx, buff |
629 | mov ebx, buff |
630 | add ebx, edx |
630 | add ebx, edx |
631 | add edx, eax |
631 | add edx, eax |
632 | inc ebx |
632 | inc ebx |
633 | mov eax, ID_STRING |
633 | mov eax, ID_STRING |
634 | call strcpy |
634 | call strcpy |
635 | 635 | ||
636 | mov [buff+edx+2], 016h ; TLV.TYPE - Client id |
636 | mov [buff+edx+2], 016h ; TLV.TYPE - Client id |
637 | mov [buff+edx+4], 2 |
637 | mov [buff+edx+4], 2 |
638 | mov word [buff+edx+6], ID_NUM |
638 | mov word [buff+edx+6], ID_NUM |
639 | add edx, 6 |
639 | add edx, 6 |
640 | 640 | ||
641 | mov [buff+edx+2], 017h ; Client major version |
641 | mov [buff+edx+2], 017h ; Client major version |
642 | mov [buff+edx+4], 2 |
642 | mov [buff+edx+4], 2 |
643 | mov [buff+edx+6], MAJOR |
643 | mov [buff+edx+6], MAJOR |
644 | add edx, 6 |
644 | add edx, 6 |
645 | 645 | ||
646 | mov [buff+edx+2], 018h ; Client minor version |
646 | mov [buff+edx+2], 018h ; Client minor version |
647 | mov [buff+edx+4], 2 |
647 | mov [buff+edx+4], 2 |
648 | mov [buff+edx+6], MINOR |
648 | mov [buff+edx+6], MINOR |
649 | add edx, 6 |
649 | add edx, 6 |
650 | 650 | ||
651 | mov [buff+edx+2], 019h ; Client lesser version |
651 | mov [buff+edx+2], 019h ; Client lesser version |
652 | mov [buff+edx+4], 2 |
652 | mov [buff+edx+4], 2 |
653 | mov [buff+edx+6], LESSER |
653 | mov [buff+edx+6], LESSER |
654 | add edx, 6 |
654 | add edx, 6 |
655 | 655 | ||
656 | mov [buff+edx+2], 01Ah ; Client build number |
656 | mov [buff+edx+2], 01Ah ; Client build number |
657 | mov [buff+edx+4], 2 |
657 | mov [buff+edx+4], 2 |
658 | mov word [buff+edx+6], BUILD |
658 | mov word [buff+edx+6], BUILD |
659 | add edx, 6 |
659 | add edx, 6 |
660 | 660 | ||
661 | mov [buff+edx+2], 014h ; Client distribution number |
661 | mov [buff+edx+2], 014h ; Client distribution number |
662 | mov [buff+edx+4], 4 |
662 | mov [buff+edx+4], 4 |
663 | mov [buff+edx+8], DISTR |
663 | mov [buff+edx+8], DISTR |
664 | add edx, 8 |
664 | add edx, 8 |
665 | 665 | ||
666 | mov [buff+edx+2], 0Fh ; Client language |
666 | mov [buff+edx+2], 0Fh ; Client language |
667 | mov eax, CL_LANG |
667 | mov eax, CL_LANG |
668 | call strlen |
668 | call strlen |
669 | mov word [buff+edx+4], ax |
669 | mov word [buff+edx+4], ax |
670 | add edx, 4 |
670 | add edx, 4 |
671 | mov ecx, eax |
671 | mov ecx, eax |
672 | mov ebx, buff |
672 | mov ebx, buff |
673 | add ebx, edx |
673 | add ebx, edx |
674 | inc ebx |
674 | inc ebx |
675 | add edx, eax |
675 | add edx, eax |
676 | mov eax, CL_LANG |
676 | mov eax, CL_LANG |
677 | call strcpy |
677 | call strcpy |
678 | 678 | ||
679 | mov [buff+edx+2], 0Fh ; Client language |
679 | mov [buff+edx+2], 0Fh ; Client language |
680 | mov eax, CL_COUNTRY |
680 | mov eax, CL_COUNTRY |
681 | call strlen |
681 | call strlen |
682 | mov word [buff+edx+4], ax |
682 | mov word [buff+edx+4], ax |
683 | add edx, 4 |
683 | add edx, 4 |
684 | mov ecx, eax |
684 | mov ecx, eax |
685 | mov ebx, buff |
685 | mov ebx, buff |
686 | add ebx, edx |
686 | add ebx, edx |
687 | inc ebx |
687 | inc ebx |
688 | add edx, eax |
688 | add edx, eax |
689 | mov eax, CL_COUNTRY |
689 | mov eax, CL_COUNTRY |
690 | call strcpy |
690 | call strcpy |
691 | 691 | ||
692 | ;write_debug 'Connect attemption' |
692 | ;write_debug 'Connect attemption' |
693 | ; mov eax, ICQ_IP |
693 | ; mov eax, ICQ_IP |
694 | ; call srv_connect |
694 | ; call srv_connect |
695 | ; cmp eax, -1 ; ®¤ª«î票¥ ¥ 㤠«®áì |
695 | ; cmp eax, -1 ; ®¤ª«î票¥ ¥ 㤠«®áì |
696 | ; jz l_fin |
696 | ; jz l_fin |
697 | 697 | ||
698 | ; mov ecx, eax |
698 | ; mov ecx, eax |
699 | ; mov eax, rflap |
699 | ; mov eax, rflap |
700 | ; mov ebx, lbuff |
700 | ; mov ebx, lbuff |
701 | ; call recvflap |
701 | ; call recvflap |
702 | 702 | ||
703 | ; cmp eax, -1 |
703 | ; cmp eax, -1 |
704 | ; jz l_flap_err |
704 | ; jz l_flap_err |
705 | ; cmp [rflap.bCh], 01 ; AUTH channel |
705 | ; cmp [rflap.bCh], 01 ; AUTH channel |
706 | ; jnz l_ch_err |
706 | ; jnz l_ch_err |
707 | ; cmp eax, 4 |
707 | ; cmp eax, 4 |
708 | ; jnz l_len_err |
708 | ; jnz l_len_err |
709 | ; cmp dword [lbuff+3], dword 1 |
709 | ; cmp dword [lbuff+3], dword 1 |
710 | ; jnz l_data_err |
710 | ; jnz l_data_err |
711 | 711 | ||
712 | mov ecx, [socket] |
712 | mov ecx, [socket] |
713 | inc dx |
713 | inc dx |
714 | mov [flap.wDs], dx ; Data size |
714 | mov [flap.wDs], dx ; Data size |
715 | mov eax, flap |
715 | mov eax, flap |
716 | mov ebx, buff |
716 | mov ebx, buff |
717 | call sendflap |
717 | call sendflap |
718 | cmp eax, 0 |
718 | cmp eax, 0 |
719 | jnz l_fin ; ¥ãᯥå |
719 | jnz l_fin ; ¥ãᯥå |
720 | jmp l_end |
720 | jmp l_end |
721 | 721 | ||
722 | 722 | ||
723 | s_cookie: |
723 | s_cookie: |
724 | ;mov eax, rflap |
724 | ;mov eax, rflap |
725 | ;mov ebx, buff |
725 | ;mov ebx, buff |
726 | ;call recvflap |
726 | ;call recvflap |
727 | ;cmp eax, -1 |
727 | ;cmp eax, -1 |
728 | ;jz l_flap_err |
728 | ;jz l_flap_err |
729 | ;cmp [rflap.bCh], 4 |
729 | ;cmp [rflap.bCh], 4 |
730 | ;jnz l_ch_err |
730 | ;jnz l_ch_err |
731 | 731 | ||
732 | ;write_debug 'UIN' |
732 | ;write_debug 'UIN' |
733 | xor ebx, ebx |
733 | xor ebx, ebx |
734 | 734 | ||
735 | uin_loop: |
735 | uin_loop: |
736 | xor eax, eax |
736 | xor eax, eax |
737 | mov ax, word [mbuff+ebx] |
737 | mov ax, word [mbuff+ebx] |
738 | cmp ax, 0100h ; 00 01 TLV.Type UIN |
738 | cmp ax, 0100h ; 00 01 TLV.Type UIN |
739 | jz l_uin_ok ; ¥¯¥àì á¥à¢¥à ¯¥à¥¤ ¥â ¥é¥ ¤ ë¥ ¯à¨ ᮥ¤¨¥¨¨, ¯®â®¬ ®¯ïâì |
739 | jz l_uin_ok ; ¥¯¥àì á¥à¢¥à ¯¥à¥¤ ¥â ¥é¥ ¤ ë¥ ¯à¨ ᮥ¤¨¥¨¨, ¯®â®¬ ®¯ïâì |
740 | add ebx, 5 ; â®â ¦¥ TLV 1 |
740 | add ebx, 5 ; â®â ¦¥ TLV 1 |
741 | cmp ebx, 5 |
741 | cmp ebx, 5 |
742 | ja l_tlvt_err |
742 | ja l_tlvt_err |
743 | jmp uin_loop |
743 | jmp uin_loop |
744 | 744 | ||
745 | 745 | ||
746 | 746 | ||
747 | 747 | ||
748 | 748 | ||
749 | l_uin_ok: |
749 | l_uin_ok: |
750 | mov eax, ebx |
750 | mov eax, ebx |
751 | xor ebx, ebx |
751 | xor ebx, ebx |
752 | mov bl, [mbuff+eax+3] ; |
752 | mov bl, [mbuff+eax+3] ; |
753 | mov bh, [mbuff+eax+2] ; «¨ ¤ ëå |
753 | mov bh, [mbuff+eax+2] ; «¨ ¤ ëå |
754 | ; |
754 | ; |
755 | ; UIN ®ª ¥ ¯à®¢¥àï¥âáï |
755 | ; UIN ®ª ¥ ¯à®¢¥àï¥âáï |
756 | ; |
756 | ; |
757 | 757 | ||
758 | 758 | ||
759 | lea ebx, [ebx+eax+4] |
759 | lea ebx, [ebx+eax+4] |
760 | mov ax, word [mbuff+ebx] |
760 | mov ax, word [mbuff+ebx] |
761 | cmp ax, 0500h ; 00 05 Bos address |
761 | cmp ax, 0500h ; 00 05 Bos address |
762 | jz l_all_ok |
762 | jz l_all_ok |
763 | cmp ax, 0400h ; UIN incorrect |
763 | cmp ax, 0400h ; UIN incorrect |
764 | jz l_uin_err |
764 | jz l_uin_err |
765 | cmp ax, 0800h |
765 | cmp ax, 0800h |
766 | jz l_pass_err |
766 | jz l_pass_err |
767 | jmp l_tlvt_err |
767 | jmp l_tlvt_err |
768 | ; |
768 | ; |
769 | ; ¥á«¨ ¥¢¥àë© UIN/ ¯ ஫ì, ¯®«ãç ¥¬ TLV.TYPE 4/8 |
769 | ; ¥á«¨ ¥¢¥àë© UIN/ ¯ ஫ì, ¯®«ãç ¥¬ TLV.TYPE 4/8 |
770 | ; |
770 | ; |
771 | 771 | ||
772 | l_all_ok: |
772 | l_all_ok: |
773 | xor ecx, ecx |
773 | xor ecx, ecx |
774 | mov cl, [mbuff+ebx+3] ;length |
774 | mov cl, [mbuff+ebx+3] ;length |
775 | mov ch, [mbuff+ebx+2] ; |
775 | mov ch, [mbuff+ebx+2] ; |
776 | 776 | ||
777 | lea eax, [mbuff+ebx+4] |
777 | lea eax, [mbuff+ebx+4] |
778 | push ebx |
778 | push ebx |
779 | mov ebx, bos_address |
779 | mov ebx, bos_address |
780 | call strcpy |
780 | call strcpy |
781 | pop ebx |
781 | pop ebx |
782 | add ebx, ecx |
782 | add ebx, ecx |
783 | lea ebx, [ebx+4] ; §¬¥à § £®«®¢ª |
783 | lea ebx, [ebx+4] ; §¬¥à § £®«®¢ª |
784 | ; |
784 | ; |
785 | ; cookie |
785 | ; cookie |
786 | ; |
786 | ; |
787 | ;write_debug 'Login Cookie' |
787 | ;write_debug 'Login Cookie' |
788 | 788 | ||
789 | xor eax, eax |
789 | xor eax, eax |
790 | mov ax, word [mbuff+ebx] |
790 | mov ax, word [mbuff+ebx] |
791 | cmp ax, 0600h ; TLV.Type cookie |
791 | cmp ax, 0600h ; TLV.Type cookie |
792 | jnz l_tlvt_err |
792 | jnz l_tlvt_err |
793 | mov cl, [mbuff+ebx+3] ; |
793 | mov cl, [mbuff+ebx+3] ; |
794 | mov ch, [mbuff+ebx+2] ; Length |
794 | mov ch, [mbuff+ebx+2] ; Length |
795 | mov [cookie_len], cx |
795 | mov [cookie_len], cx |
796 | lea eax, [mbuff+ebx+4] |
796 | lea eax, [mbuff+ebx+4] |
797 | push ebx |
797 | push ebx |
798 | mov ebx, srv_cookie |
798 | mov ebx, srv_cookie |
799 | call strcpy |
799 | call strcpy |
800 | pop ebx |
800 | pop ebx |
801 | 801 | ||
802 | ; |
802 | ; |
803 | ; ®¥¤¨ï¥¬áï á BOS |
803 | ; ®¥¤¨ï¥¬áï á BOS |
804 | ; |
804 | ; |
805 | ;call srv_disconnect |
805 | ;call srv_disconnect |
806 | mov ecx, [socket] |
806 | mov ecx, [socket] |
807 | ;write_debug 'Closing socket' |
807 | ;write_debug 'Closing socket' |
808 | ;call closesocket |
808 | ;call closesocket |
809 | ; |
809 | ; |
810 | ; |
810 | ; |
811 | ;mov eax, 53 |
811 | ;mov eax, 53 |
812 | ;mov ebx, 8 |
812 | ;mov ebx, 8 |
813 | ;int 40h |
813 | ;int 40h |
814 | 814 | ||
815 | 815 | ||
816 | 816 | ||
817 | 817 | ||
818 | mov eax, bos_address |
818 | mov eax, bos_address |
819 | call ip_parser |
819 | call ip_parser |
820 | 820 | ||
821 | call htonl |
821 | call htonl |
822 | data_debug 'BOS Address: ', eax |
822 | data_debug 'BOS Address: ', eax |
823 | data_debug 'BOS Port: ', ebx |
823 | data_debug 'BOS Port: ', ebx |
824 | mov [bos_ip], eax |
824 | mov [bos_ip], eax |
825 | mov [bos_port], ebx |
825 | mov [bos_port], ebx |
826 | call srv_connect |
826 | call srv_connect |
827 | mov [login], 1 ; ®¥¤¨¥¨¥ á ®á®¢ë¬ á¥à¢¥à®¬ ãáâ ®¢«¥® |
827 | mov [login], 1 ; ®¥¤¨¥¨¥ á ®á®¢ë¬ á¥à¢¥à®¬ ãáâ ®¢«¥® |
828 | ;mov [socket], eax |
828 | ;mov [socket], eax |
829 | 829 | ||
830 | 830 | ||
831 | 831 | ||
832 | jmp l_end |
832 | jmp l_end |
833 | ; |
833 | ; |
834 | ; |
834 | ; |
835 | ; |
835 | ; |
836 | l_pass_err: |
836 | l_pass_err: |
837 | write_debug 'PASSWORD INVALID' |
837 | write_debug 'PASSWORD INVALID' |
838 | jmp l_fin |
838 | jmp l_fin |
839 | 839 | ||
840 | l_uin_err: |
840 | l_uin_err: |
841 | write_debug 'UIN INVALID' |
841 | write_debug 'UIN INVALID' |
842 | jmp l_fin |
842 | jmp l_fin |
843 | 843 | ||
844 | l_data_err: |
844 | l_data_err: |
845 | write_debug 'LOGIN DATA MISMATCH' |
845 | write_debug 'LOGIN DATA MISMATCH' |
846 | jmp l_fin |
846 | jmp l_fin |
847 | 847 | ||
848 | l_len_err: |
848 | l_len_err: |
849 | write_debug 'RECIVED DATA LENGTH MISMATCH' |
849 | write_debug 'RECEIVED DATA LENGTH MISMATCH' |
850 | jmp l_fin |
850 | jmp l_fin |
851 | 851 | ||
852 | l_tlvt_err: |
852 | l_tlvt_err: |
853 | write_debug 'TLV TYPE MISMATCH' |
853 | write_debug 'TLV TYPE MISMATCH' |
854 | jmp l_fin |
854 | jmp l_fin |
855 | 855 | ||
856 | l_ch_err: |
856 | l_ch_err: |
857 | write_debug 'FLAP CHANNEL MISMATCH' |
857 | write_debug 'FLAP CHANNEL MISMATCH' |
858 | jmp l_fin |
858 | jmp l_fin |
859 | 859 | ||
860 | l_flap_err: |
860 | l_flap_err: |
861 | write_debug 'FLAP ID MISMATCH / RECIVE ERROR' |
861 | write_debug 'FLAP ID MISMATCH / RECEIVE ERROR' |
862 | 862 | ||
863 | l_fin: |
863 | l_fin: |
864 | 864 | ||
865 | ; |
865 | ; |
866 | ; ¥®¡å®¤¨¬® § ªàëâì ᮪¥â |
866 | ; ¥®¡å®¤¨¬® § ªàëâì ᮪¥â |
867 | ; |
867 | ; |
868 | ;call srv_disconnect |
868 | ;call srv_disconnect |
869 | ;call closesocket |
869 | ;call closesocket |
870 | l_end: |
870 | l_end: |
871 | pop edx |
871 | pop edx |
872 | ;pop ecx |
872 | ;pop ecx |
873 | pop ebx |
873 | pop ebx |
874 | pop eax |
874 | pop eax |
875 | popf |
875 | popf |
876 | ret |
876 | ret |
877 | 877 | ||
878 | ; |
878 | ; |
879 | ; Length of string |
879 | ; Length of string |
880 | ; input eax = offset string |
880 | ; input eax = offset string |
881 | ; output eax = strlen |
881 | ; output eax = strlen |
882 | ; |
882 | ; |
883 | strlen: |
883 | strlen: |
884 | push ebx |
884 | push ebx |
885 | push ecx |
885 | push ecx |
886 | pushf |
886 | pushf |
887 | xor ebx, ebx |
887 | xor ebx, ebx |
888 | xor ecx, ecx |
888 | xor ecx, ecx |
889 | 889 | ||
890 | loop_s: |
890 | loop_s: |
891 | mov cl, [eax+ebx] |
891 | mov cl, [eax+ebx] |
892 | cmp ecx,0 |
892 | cmp ecx,0 |
893 | jz nl |
893 | jz nl |
894 | inc ebx |
894 | inc ebx |
895 | jmp loop_s |
895 | jmp loop_s |
896 | 896 | ||
897 | nl: |
897 | nl: |
898 | mov eax, ebx |
898 | mov eax, ebx |
899 | popf |
899 | popf |
900 | pop ecx |
900 | pop ecx |
901 | pop ebx |
901 | pop ebx |
902 | ret |
902 | ret |
903 | 903 | ||
904 | ; |
904 | ; |
905 | ; Roasting password |
905 | ; Roasting password |
906 | ; EAX = offset password |
906 | ; EAX = offset password |
907 | ; |
907 | ; |
908 | 908 | ||
909 | roast: |
909 | roast: |
910 | pushf |
910 | pushf |
911 | push ecx |
911 | push ecx |
912 | push ebx |
912 | push ebx |
913 | 913 | ||
914 | xor ecx, ecx |
914 | xor ecx, ecx |
915 | xor ebx, ebx |
915 | xor ebx, ebx |
916 | 916 | ||
917 | loop_r: |
917 | loop_r: |
918 | mov bl, [eax+ecx] ;¨¬¢®« ¨§ ¬ áᨢ ¯ ஫ï |
918 | mov bl, [eax+ecx] ;¨¬¢®« ¨§ ¬ áᨢ ¯ ஫ï |
919 | cmp bl, 0 ;®¥æ áâப¨ |
919 | cmp bl, 0 ;®¥æ áâப¨ |
920 | jz r_fin |
920 | jz r_fin |
921 | 921 | ||
922 | xor bl, [ROASTING_ARRAY+ecx] |
922 | xor bl, [ROASTING_ARRAY+ecx] |
923 | mov [eax+ecx], bl |
923 | mov [eax+ecx], bl |
924 | inc ecx |
924 | inc ecx |
925 | jmp loop_r |
925 | jmp loop_r |
926 | 926 | ||
927 | r_fin: |
927 | r_fin: |
928 | pop ebx |
928 | pop ebx |
929 | pop ecx |
929 | pop ecx |
930 | popf |
930 | popf |
931 | ret |
931 | ret |
932 | 932 | ||
933 | 933 | ||
934 | ; |
934 | ; |
935 | ;Copy string of bytes |
935 | ;Copy string of bytes |
936 | ; EAX = ¤à¥á ¨á室®© áâப¨ |
936 | ; EAX = ¤à¥á ¨á室®© áâப¨ |
937 | ; EBX = ¤à¥á § 票ï |
937 | ; EBX = ¤à¥á § 票ï |
938 | ; ECX = ¤«¨ áâப¨ |
938 | ; ECX = ¤«¨ áâப¨ |
939 | ; |
939 | ; |
940 | strcpy: |
940 | strcpy: |
941 | pushf |
941 | pushf |
942 | push esi |
942 | push esi |
943 | push edi |
943 | push edi |
944 | push ecx |
944 | push ecx |
945 | 945 | ||
946 | cld ;¡à ¡ âë¢ ¥¬ áâப㠮â ç « ª ª®æã |
946 | cld ;¡à ¡ âë¢ ¥¬ áâப㠮â ç « ª ª®æã |
947 | mov esi, eax |
947 | mov esi, eax |
948 | mov edi, ebx |
948 | mov edi, ebx |
949 | 949 | ||
950 | rep movsb |
950 | rep movsb |
951 | 951 | ||
952 | pop ecx |
952 | pop ecx |
953 | pop edi |
953 | pop edi |
954 | pop esi |
954 | pop esi |
955 | popf |
955 | popf |
956 | ret |
956 | ret |
957 | 957 | ||
958 | 958 | ||
959 | ; |
959 | ; |
960 | ; ¯®«ï¥â ¡ãä¥à, ¯® ¤à¥áã ¢ ebx |
960 | ; ¯®«ï¥â ¡ãä¥à, ¯® ¤à¥áã ¢ ebx |
961 | ; ¤ 묨, ¯® ¤à¥áã eax, ¢ |
961 | ; ¤ 묨, ¯® ¤à¥áã eax, ¢ |
962 | ; cx - ¨¯ TLV |
962 | ; cx - ¨¯ TLV |
963 | ; dx - ¤«¨ ¤ ëå |
963 | ; dx - ¤«¨ ¤ ëå |
964 | ; |
964 | ; |
965 | ; |
965 | ; |
966 | 966 | ||
967 | tlvstr: |
967 | tlvstr: |
968 | ;pushf |
968 | ;pushf |
969 | push edx |
969 | push edx |
970 | push ecx |
970 | push ecx |
971 | push ebx |
971 | push ebx |
972 | 972 | ||
973 | mov [ebx], ch ; Type |
973 | mov [ebx], ch ; Type |
974 | mov [ebx+1], cl |
974 | mov [ebx+1], cl |
975 | 975 | ||
976 | mov [ebx+2], dh ; Length |
976 | mov [ebx+2], dh ; Length |
977 | mov [ebx+3], dl |
977 | mov [ebx+3], dl |
978 | 978 | ||
979 | lea ebx, [ebx+4] |
979 | lea ebx, [ebx+4] |
980 | ; EBX = offset of destination |
980 | ; EBX = offset of destination |
981 | mov ecx, edx |
981 | mov ecx, edx |
982 | 982 | ||
983 | call strcpy |
983 | call strcpy |
984 | 984 | ||
985 | pop ebx |
985 | pop ebx |
986 | pop ecx |
986 | pop ecx |
987 | pop edx |
987 | pop edx |
988 | ;popf |
988 | ;popf |
989 | ret |
989 | ret |
990 | 990 | ||
991 | ; |
991 | ; |
992 | ; eax - 㪠§ ⥫ì FLAP_head |
992 | ; eax - 㪠§ ⥫ì FLAP_head |
993 | ; ebx - 㪠§ â¥«ì ¬ áᨢ, § ¯®«¥ë© ¤ 묨 |
993 | ; ebx - 㪠§ â¥«ì ¬ áᨢ, § ¯®«¥ë© ¤ 묨 |
994 | ; ecx - 奤« ᮪¥â |
994 | ; ecx - 奤« ᮪¥â |
995 | ; |
995 | ; |
996 | ; eax ¢®§¢à é ¥â १ã«ìâ â § ¯¨á¨ ¢ ᮪¥â |
996 | ; eax ¢®§¢à é ¥â १ã«ìâ â § ¯¨á¨ ¢ ᮪¥â |
997 | ; |
997 | ; |
998 | sendflap: |
998 | sendflap: |
999 | pushf |
999 | pushf |
1000 | push edx |
1000 | push edx |
1001 | ;push ecx |
1001 | ;push ecx |
1002 | push esi |
1002 | push esi |
1003 | push ebx |
1003 | push ebx |
1004 | push ecx |
1004 | push ecx |
1005 | 1005 | ||
1006 | xor edx, edx |
1006 | xor edx, edx |
1007 | 1007 | ||
1008 | mov dl, [eax] ; ID byte |
1008 | mov dl, [eax] ; ID byte |
1009 | mov [sbuff], dl |
1009 | mov [sbuff], dl |
1010 | 1010 | ||
1011 | mov dl, [eax+1] ; FLAP channel |
1011 | mov dl, [eax+1] ; FLAP channel |
1012 | mov [sbuff+1], dl |
1012 | mov [sbuff+1], dl |
1013 | 1013 | ||
1014 | mov dl, [eax+2] ; FLAP datagramm seq number |
1014 | mov dl, [eax+2] ; FLAP datagramm seq number |
1015 | mov [sbuff+3], dl ; ¬¥ï¥¬ ¬¥áâ ¬¨ ¡ ©âë ¤«ï ¯¥à¥¤ ç¨ ¯® á¥â¨ |
1015 | mov [sbuff+3], dl ; ¬¥ï¥¬ ¬¥áâ ¬¨ ¡ ©âë ¤«ï ¯¥à¥¤ ç¨ ¯® á¥â¨ |
1016 | mov dl, [eax+3] |
1016 | mov dl, [eax+3] |
1017 | mov [sbuff+2], dl |
1017 | mov [sbuff+2], dl |
1018 | 1018 | ||
1019 | mov dl, [eax+4] ; FLAP data size |
1019 | mov dl, [eax+4] ; FLAP data size |
1020 | mov [sbuff+5], dl |
1020 | mov [sbuff+5], dl |
1021 | mov dl, [eax+5] |
1021 | mov dl, [eax+5] |
1022 | mov [sbuff+4], dl |
1022 | mov [sbuff+4], dl |
1023 | mov dx, word [eax+4] |
1023 | mov dx, word [eax+4] |
1024 | 1024 | ||
1025 | xchg ecx, edx ; ecx - size edx - handle |
1025 | xchg ecx, edx ; ecx - size edx - handle |
1026 | mov eax, ebx ; data |
1026 | mov eax, ebx ; data |
1027 | mov ebx, sbuff ; dest |
1027 | mov ebx, sbuff ; dest |
1028 | add ebx, 6 ; + header size |
1028 | add ebx, 6 ; + header size |
1029 | call strcpy |
1029 | call strcpy |
1030 | 1030 | ||
1031 | xchg ecx, edx ; ecx - handle, edx - data size |
1031 | xchg ecx, edx ; ecx - handle, edx - data size |
1032 | 1032 | ||
1033 | s_wait: |
1033 | s_wait: |
1034 | mov eax, 53 ; ஢¥à塞 á®áâ®ï¨¥ ᮪¥â . ᫨ ᮥ¤¨¥¨¥ |
1034 | mov eax, 53 ; ஢¥à塞 á®áâ®ï¨¥ ᮪¥â . ᫨ ᮥ¤¨¥¨¥ |
1035 | mov ebx, 6 ; ãáâ ®¢«¥® - ¯®áë« ¥¬ ¡ãä¥à, ¥á«¨ ᮪¥â § ªàëâ, ã室¨¬ |
1035 | mov ebx, 6 ; ãáâ ®¢«¥® - ¯®áë« ¥¬ ¡ãä¥à, ¥á«¨ ᮪¥â § ªàëâ, ã室¨¬ |
1036 | int 40h |
1036 | int 40h |
1037 | cmp eax, TCB_ESTABLISHED ; ãáâ ®¢«¥® |
1037 | cmp eax, TCB_ESTABLISHED ; ãáâ ®¢«¥® |
1038 | jz s_est |
1038 | jz s_est |
1039 | cmp eax, TCB_CLOSED |
1039 | cmp eax, TCB_CLOSED |
1040 | jz s_fin |
1040 | jz s_fin |
1041 | cmp eax, 12 ; ¬¥ï â ª®¥ ¡ë«®, ª®£¤ ᮥ¤¨¥¨¥ ãáâ ¢«¨¢ «®áì á ¯ãáâ®â®© :-) |
1041 | cmp eax, 12 ; ¬¥ï â ª®¥ ¡ë«®, ª®£¤ ᮥ¤¨¥¨¥ ãáâ ¢«¨¢ «®áì á ¯ãáâ®â®© :-) |
1042 | jnc s_fin ; |
1042 | jnc s_fin ; |
1043 | 1043 | ||
1044 | 1044 | ||
1045 | mov eax, 5 |
1045 | mov eax, 5 |
1046 | mov ebx, 1 |
1046 | mov ebx, 1 |
1047 | int 40h ; ¤¥¬ |
1047 | int 40h ; ¤¥¬ |
1048 | jmp s_wait |
1048 | jmp s_wait |
1049 | 1049 | ||
1050 | 1050 | ||
1051 | s_est: |
1051 | s_est: |
1052 | mov eax, 53 |
1052 | mov eax, 53 |
1053 | mov ebx, 7 ; ¯¨á âì ¢ ᮪¥â |
1053 | mov ebx, 7 ; ¯¨á âì ¢ ᮪¥â |
1054 | ;xchg ecx, edx ; ecx - handle, edx - data length |
1054 | ;xchg ecx, edx ; ecx - handle, edx - data length |
1055 | add edx, 6 ; + size of header |
1055 | add edx, 6 ; + size of header |
1056 | mov esi, sbuff ; data |
1056 | mov esi, sbuff ; data |
1057 | int 40h |
1057 | int 40h |
1058 | 1058 | ||
1059 | s_fin: |
1059 | s_fin: |
1060 | pop ecx |
1060 | pop ecx |
1061 | pop ebx |
1061 | pop ebx |
1062 | pop esi |
1062 | pop esi |
1063 | ;pop ecx |
1063 | ;pop ecx |
1064 | pop edx |
1064 | pop edx |
1065 | popf |
1065 | popf |
1066 | ret |
1066 | ret |
1067 | 1067 | ||
1068 | ; |
1068 | ; |
1069 | ; ਨ¬ ¥â ¯ ª¥â ¨§ ᮪¥â |
1069 | ; ਨ¬ ¥â ¯ ª¥â ¨§ ᮪¥â |
1070 | ; eax - 㪠§ ⥫ì FLAP_head |
1070 | ; eax - 㪠§ ⥫ì FLAP_head |
1071 | ; ebx - 㪠§ â¥«ì ¬ áᨢ |
1071 | ; ebx - 㪠§ â¥«ì ¬ áᨢ |
1072 | ; ecx - 奤« ᮪¥â |
1072 | ; ecx - 奤« ᮪¥â |
1073 | ; ®§¢à é ¥â ¢ eax ª®«¨ç¥á⢮ ¯à¨ïâëå ¡ ©â ¢ ¬ áᨢ¥ |
1073 | ; ®§¢à é ¥â ¢ eax ª®«¨ç¥á⢮ ¯à¨ïâëå ¡ ©â ¢ ¬ áᨢ¥ |
1074 | ; |
1074 | ; |
1075 | ; recvflap: |
1075 | ; recvflap: |
1076 | ; pushf |
1076 | ; pushf |
1077 | ; |
1077 | ; |
1078 | ; ;push eax |
1078 | ; ;push eax |
1079 | ; push ebx |
1079 | ; push ebx |
1080 | ; push esi |
1080 | ; push esi |
1081 | ; push edi |
1081 | ; push edi |
1082 | ; push edx |
1082 | ; push edx |
1083 | ; mov esi, eax |
1083 | ; mov esi, eax |
1084 | ; mov edi, ebx |
1084 | ; mov edi, ebx |
1085 | ; |
1085 | ; |
1086 | ; r_fail: |
1086 | ; r_fail: |
1087 | ; mov eax, 53 ; ¯à 訢 ¥¬ ᮪¥â |
1087 | ; mov eax, 53 ; ¯à 訢 ¥¬ ᮪¥â |
1088 | ; mov ebx, 2 ; ¢ eax ª®«¨ç¥á⢮ ¯®«ãç¥ëå ¡ ©â |
1088 | ; mov ebx, 2 ; ¢ eax ª®«¨ç¥á⢮ ¯®«ãç¥ëå ¡ ©â |
1089 | ; int 40h ; |
1089 | ; int 40h ; |
1090 | ; cmp eax, 6 ; ¡ãä¥à ¥ ¯ãá⮩ |
1090 | ; cmp eax, 6 ; ¡ãä¥à ¥ ¯ãá⮩ |
1091 | ; jnc r_ok |
1091 | ; jnc r_ok |
1092 | ; |
1092 | ; |
1093 | ; mov eax, 53 ; ®«ãç ¥¬ á®áâ®ï¨¥ ᮪¥â |
1093 | ; mov eax, 53 ; ®«ãç ¥¬ á®áâ®ï¨¥ ᮪¥â |
1094 | ; mov ebx, 6 ; |
1094 | ; mov ebx, 6 ; |
1095 | ; int 40h ; |
1095 | ; int 40h ; |
1096 | ; |
1096 | ; |
1097 | ; cmp eax, TCB_CLOSED ; § ªàëâ - ã室¨¬ |
1097 | ; cmp eax, TCB_CLOSED ; § ªàëâ - ã室¨¬ |
1098 | ; jz r_err |
1098 | ; jz r_err |
1099 | ; |
1099 | ; |
1100 | ; |
1100 | ; |
1101 | ; ;mov eax, 5 ; ¦¤¥¬ |
1101 | ; ;mov eax, 5 ; ¦¤¥¬ |
1102 | ; ;mov ebx, 1 |
1102 | ; ;mov ebx, 1 |
1103 | ; ;int 40h |
1103 | ; ;int 40h |
1104 | ; ; ã室¨¬ |
1104 | ; ; ã室¨¬ |
1105 | ; |
1105 | ; |
1106 | ; ;jmp r_fail |
1106 | ; ;jmp r_fail |
1107 | ; jmp rf_fin |
1107 | ; jmp rf_fin |
1108 | ; |
1108 | ; |
1109 | ; r_ok: ; ¡ãä¥à¥ ¤ ë¥ |
1109 | ; r_ok: ; ¡ãä¥à¥ ¤ ë¥ |
1110 | ; |
1110 | ; |
1111 | ; mov eax, 53 |
1111 | ; mov eax, 53 |
1112 | ; mov ebx, 3 |
1112 | ; mov ebx, 3 |
1113 | ; int 40h |
1113 | ; int 40h |
1114 | ; mov [esi], bl ; flap.bId |
1114 | ; mov [esi], bl ; flap.bId |
1115 | ; cmp bl, FLAP_ID |
1115 | ; cmp bl, FLAP_ID |
1116 | ; jnz r_err |
1116 | ; jnz r_err |
1117 | ; |
1117 | ; |
1118 | ; mov eax, 53 |
1118 | ; mov eax, 53 |
1119 | ; mov ebx, 3 |
1119 | ; mov ebx, 3 |
1120 | ; int 40h |
1120 | ; int 40h |
1121 | ; mov [esi+1], bl ; flap.bCh |
1121 | ; mov [esi+1], bl ; flap.bCh |
1122 | ; |
1122 | ; |
1123 | ; mov eax, 53 |
1123 | ; mov eax, 53 |
1124 | ; mov ebx, 3 |
1124 | ; mov ebx, 3 |
1125 | ; int 40h |
1125 | ; int 40h |
1126 | ; mov [esi+3], bl ; flap.wSn áâ à訩 ¡ ©â |
1126 | ; mov [esi+3], bl ; flap.wSn áâ à訩 ¡ ©â |
1127 | ; |
1127 | ; |
1128 | ; mov eax, 53 |
1128 | ; mov eax, 53 |
1129 | ; mov ebx, 3 |
1129 | ; mov ebx, 3 |
1130 | ; int 40h |
1130 | ; int 40h |
1131 | ; mov [esi+2], bl ; flap.wSn ¬« ¤è¨© ¡ ©â |
1131 | ; mov [esi+2], bl ; flap.wSn ¬« ¤è¨© ¡ ©â |
1132 | ; |
1132 | ; |
1133 | ; mov eax, 53 |
1133 | ; mov eax, 53 |
1134 | ; mov ebx, 3 |
1134 | ; mov ebx, 3 |
1135 | ; int 40h |
1135 | ; int 40h |
1136 | ; mov [esi+5], bl ; flap.wDs áâ à訩 ¡ ©â |
1136 | ; mov [esi+5], bl ; flap.wDs áâ à訩 ¡ ©â |
1137 | ; |
1137 | ; |
1138 | ; mov eax, 53 |
1138 | ; mov eax, 53 |
1139 | ; mov ebx, 3 |
1139 | ; mov ebx, 3 |
1140 | ; int 40h |
1140 | ; int 40h |
1141 | ; mov [esi+4], bl ; flap.wDs ¬« ¤è¨© ¡ ©â |
1141 | ; mov [esi+4], bl ; flap.wDs ¬« ¤è¨© ¡ ©â |
1142 | ; |
1142 | ; |
1143 | ; r_check: |
1143 | ; r_check: |
1144 | ; mov eax, 53 ; ஢¥à塞 ç¨á«® ¯®«ãç¥ëå ¡ ©â |
1144 | ; mov eax, 53 ; ஢¥à塞 ç¨á«® ¯®«ãç¥ëå ¡ ©â |
1145 | ; mov eax, 2 |
1145 | ; mov eax, 2 |
1146 | ; int 40h |
1146 | ; int 40h |
1147 | ; |
1147 | ; |
1148 | ; xor ebx, ebx |
1148 | ; xor ebx, ebx |
1149 | ; mov bx, word [esi+4] ; flap.wDs |
1149 | ; mov bx, word [esi+4] ; flap.wDs |
1150 | ; cmp eax, ebx |
1150 | ; cmp eax, ebx |
1151 | ; jnc r_drr ;>= |
1151 | ; jnc r_drr ;>= |
1152 | ; |
1152 | ; |
1153 | ; mov eax, 68 ; wait |
1153 | ; mov eax, 68 ; wait |
1154 | ; mov ebx, 1 |
1154 | ; mov ebx, 1 |
1155 | ; int 40h |
1155 | ; int 40h |
1156 | ; jmp r_check |
1156 | ; jmp r_check |
1157 | ; |
1157 | ; |
1158 | ; r_drr: ; ready for data recive |
1158 | ; r_drr: ; ready for data recive |
1159 | ; |
1159 | ; |
1160 | ; |
1160 | ; |
1161 | ; xor edx, edx |
1161 | ; xor edx, edx |
1162 | ; mov dx, word [esi+4] ; flap.wDs |
1162 | ; mov dx, word [esi+4] ; flap.wDs |
1163 | ; xor esi, esi |
1163 | ; xor esi, esi |
1164 | ; |
1164 | ; |
1165 | ; rf_loop: |
1165 | ; rf_loop: |
1166 | ; mov eax, 53 |
1166 | ; mov eax, 53 |
1167 | ; mov ebx, 3 |
1167 | ; mov ebx, 3 |
1168 | ; int 40h |
1168 | ; int 40h |
1169 | ; mov [edi+esi], bl |
1169 | ; mov [edi+esi], bl |
1170 | ; inc esi |
1170 | ; inc esi |
1171 | ; cmp esi, edx |
1171 | ; cmp esi, edx |
1172 | ; jnz rf_loop |
1172 | ; jnz rf_loop |
1173 | ; mov eax, edx |
1173 | ; mov eax, edx |
1174 | ; jmp rf_fin |
1174 | ; jmp rf_fin |
1175 | ; |
1175 | ; |
1176 | ; r_err: |
1176 | ; r_err: |
1177 | ; ;pop ebx |
1177 | ; ;pop ebx |
1178 | ; ;pop eax |
1178 | ; ;pop eax |
1179 | ; mov eax, -1 |
1179 | ; mov eax, -1 |
1180 | ; jmp rf_fin |
1180 | ; jmp rf_fin |
1181 | ; |
1181 | ; |
1182 | ; |
1182 | ; |
1183 | ; rf_fin: |
1183 | ; rf_fin: |
1184 | ; pop edx |
1184 | ; pop edx |
1185 | ; pop edi |
1185 | ; pop edi |
1186 | ; pop esi |
1186 | ; pop esi |
1187 | ; pop ebx |
1187 | ; pop ebx |
1188 | ; ;pop eax |
1188 | ; ;pop eax |
1189 | ; popf |
1189 | ; popf |
1190 | ; ret |
1190 | ; ret |
1191 | 1191 | ||
1192 | ; |
1192 | ; |
1193 | ; eax - 㪠§ â¥«ì ¡ãä¥à |
1193 | ; eax - 㪠§ â¥«ì ¡ãä¥à |
1194 | ; ebx - § 票¥, ª®â®àë¬ ¥®¡å®¤¨¬® § ⮫¨âì. ᯮ«ì§ã¥âáï ⮫쪮 bl |
1194 | ; ebx - § 票¥, ª®â®àë¬ ¥®¡å®¤¨¬® § ⮫¨âì. ᯮ«ì§ã¥âáï ⮫쪮 bl |
1195 | ; ecx - à §¬¥à |
1195 | ; ecx - à §¬¥à |
1196 | ; |
1196 | ; |
1197 | 1197 | ||
1198 | memset: |
1198 | memset: |
1199 | pushf |
1199 | pushf |
1200 | push edi |
1200 | push edi |
1201 | push eax |
1201 | push eax |
1202 | push ebx |
1202 | push ebx |
1203 | push ecx |
1203 | push ecx |
1204 | 1204 | ||
1205 | cld |
1205 | cld |
1206 | mov edi, eax |
1206 | mov edi, eax |
1207 | mov eax, ebx |
1207 | mov eax, ebx |
1208 | rep stosb |
1208 | rep stosb |
1209 | 1209 | ||
1210 | pop ecx |
1210 | pop ecx |
1211 | pop ebx |
1211 | pop ebx |
1212 | pop eax |
1212 | pop eax |
1213 | pop edi |
1213 | pop edi |
1214 | popf |
1214 | popf |
1215 | ret |
1215 | ret |
1216 | 1216 | ||
1217 | ; |
1217 | ; |
1218 | ; àᨬ TLV |
1218 | ; àᨬ TLV |
1219 | ; <-- ¢ eax ¤à¥á TLV |
1219 | ; <-- ¢ eax ¤à¥á TLV |
1220 | ; <-- ¢ ebx ¤à¥á ¡ãä¥à , ª®â®àë© ã¦® § ¯®«¨âì |
1220 | ; <-- ¢ ebx ¤à¥á ¡ãä¥à , ª®â®àë© ã¦® § ¯®«¨âì |
1221 | ; --> ¢ ebx ¤«¨ ¯®«ãç¥ëå ¤ ëå |
1221 | ; --> ¢ ebx ¤«¨ ¯®«ãç¥ëå ¤ ëå |
1222 | ; --> ¢ eax ⨯ TLV |
1222 | ; --> ¢ eax ⨯ TLV |
1223 | ; |
1223 | ; |
1224 | 1224 | ||
1225 | tlvpar: |
1225 | tlvpar: |
1226 | pushf |
1226 | pushf |
1227 | ;push esi |
1227 | ;push esi |
1228 | ;push edi |
1228 | ;push edi |
1229 | push ecx |
1229 | push ecx |
1230 | xor ecx, ecx |
1230 | xor ecx, ecx |
1231 | 1231 | ||
1232 | mov cl, [eax+3] ;TLV.Length |
1232 | mov cl, [eax+3] ;TLV.Length |
1233 | mov ch, [eax+2] |
1233 | mov ch, [eax+2] |
1234 | call strcpy |
1234 | call strcpy |
1235 | 1235 | ||
1236 | xor eax, eax |
1236 | xor eax, eax |
1237 | mov al, [ebx+1] ;TLV.Type |
1237 | mov al, [ebx+1] ;TLV.Type |
1238 | mov ah, [ebx] |
1238 | mov ah, [ebx] |
1239 | mov ebx, ecx |
1239 | mov ebx, ecx |
1240 | 1240 | ||
1241 | 1241 | ||
1242 | pop ecx |
1242 | pop ecx |
1243 | ;pop edi |
1243 | ;pop edi |
1244 | ;pop esi |
1244 | ;pop esi |
1245 | popf |
1245 | popf |
1246 | ret |
1246 | ret |
1247 | 1247 | ||
1248 | ; |
1248 | ; |
1249 | ; <-- ECX - 奤« ᮪¥â , ª®â®àë© ã¦® § ªàëâì |
1249 | ; <-- ECX - 奤« ᮪¥â , ª®â®àë© ã¦® § ªàëâì |
1250 | ; --> ECX - ¥§ã«ìâ â (¥ ¤¥¦®) |
1250 | ; --> ECX - ¥§ã«ìâ â (¥ ¤¥¦®) |
1251 | ; |
1251 | ; |
1252 | closesocket: |
1252 | closesocket: |
1253 | push eax |
1253 | push eax |
1254 | push ebx |
1254 | push ebx |
1255 | 1255 | ||
1256 | mov eax, 53 |
1256 | mov eax, 53 |
1257 | mov ebx, 8 |
1257 | mov ebx, 8 |
1258 | int 40h |
1258 | int 40h |
1259 | 1259 | ||
1260 | mov ecx, eax |
1260 | mov ecx, eax |
1261 | 1261 | ||
1262 | pop ebx |
1262 | pop ebx |
1263 | pop eax |
1263 | pop eax |
1264 | ret |
1264 | ret |
1265 | 1265 | ||
1266 | ; |
1266 | ; |
1267 | ; ecx <-- 奤« ᮪¥â |
1267 | ; ecx <-- 奤« ᮪¥â |
1268 | ; |
1268 | ; |
1269 | ; |
1269 | ; |
1270 | 1270 | ||
1271 | srv_disconnect: |
1271 | srv_disconnect: |
1272 | pushf |
1272 | pushf |
1273 | push eax |
1273 | push eax |
1274 | push ebx |
1274 | push ebx |
1275 | mov [flap.bId], FLAP_ID |
1275 | mov [flap.bId], FLAP_ID |
1276 | mov [flap.bCh], 4 ;Disconnect |
1276 | mov [flap.bCh], 4 ;Disconnect |
1277 | xor eax, eax |
1277 | xor eax, eax |
1278 | mov ax, [seq] |
1278 | mov ax, [seq] |
1279 | mov [flap.wSn], ax |
1279 | mov [flap.wSn], ax |
1280 | mov [flap.wDs], 0 |
1280 | mov [flap.wDs], 0 |
1281 | mov eax, flap |
1281 | mov eax, flap |
1282 | mov ebx, buff |
1282 | mov ebx, buff |
1283 | call sendflap |
1283 | call sendflap |
1284 | 1284 | ||
1285 | 1285 | ||
1286 | pop ebx |
1286 | pop ebx |
1287 | pop eax |
1287 | pop eax |
1288 | popf |
1288 | popf |
1289 | ret |
1289 | ret |
1290 | 1290 | ||
1291 | ; |
1291 | ; |
1292 | ; <-- eax [bos_address] |
1292 | ; <-- eax [bos_address] |
1293 | ; --> eax = IP ADDRESS |
1293 | ; --> eax = IP ADDRESS |
1294 | ; --> ebx = port number |
1294 | ; --> ebx = port number |
1295 | ; |
1295 | ; |
1296 | par_buff db 9 dup 0 |
1296 | par_buff db 9 dup 0 |
1297 | 1297 | ||
1298 | ip_parser: |
1298 | ip_parser: |
1299 | pushf |
1299 | pushf |
1300 | push ecx |
1300 | push ecx |
1301 | push edx |
1301 | push edx |
1302 | push esi |
1302 | push esi |
1303 | push edi |
1303 | push edi |
1304 | 1304 | ||
1305 | xor ecx, ecx |
1305 | xor ecx, ecx |
1306 | ;xor eax, eax |
1306 | ;xor eax, eax |
1307 | xor ebx, ebx |
1307 | xor ebx, ebx |
1308 | xor edx, edx |
1308 | xor edx, edx |
1309 | xor esi, esi |
1309 | xor esi, esi |
1310 | xor edi, edi |
1310 | xor edi, edi |
1311 | 1311 | ||
1312 | ip_loop: |
1312 | ip_loop: |
1313 | xor eax, eax |
1313 | xor eax, eax |
1314 | ;xor edx, edx |
1314 | ;xor edx, edx |
1315 | mov al, [bos_address+ecx] |
1315 | mov al, [bos_address+ecx] |
1316 | cmp al, '.' |
1316 | cmp al, '.' |
1317 | jz ip_dot |
1317 | jz ip_dot |
1318 | 1318 | ||
1319 | cmp al, 0 |
1319 | cmp al, 0 |
1320 | jz ip_end_str |
1320 | jz ip_end_str |
1321 | 1321 | ||
1322 | cmp al, ':' |
1322 | cmp al, ':' |
1323 | jz ip_colon |
1323 | jz ip_colon |
1324 | 1324 | ||
1325 | ;sub al, 30h |
1325 | ;sub al, 30h |
1326 | ;cmp al, 9 |
1326 | ;cmp al, 9 |
1327 | ;ja ip_err ; ¥ æ¨äà |
1327 | ;ja ip_err ; ¥ æ¨äà |
1328 | 1328 | ||
1329 | mov [par_buff+edx], al |
1329 | mov [par_buff+edx], al |
1330 | inc ecx |
1330 | inc ecx |
1331 | inc edx |
1331 | inc edx |
1332 | jmp ip_loop |
1332 | jmp ip_loop |
1333 | 1333 | ||
1334 | ip_dot: |
1334 | ip_dot: |
1335 | ;xor eax, eax |
1335 | ;xor eax, eax |
1336 | mov [par_buff+edx], 0 ; ®¥æ áâப¨ |
1336 | mov [par_buff+edx], 0 ; ®¥æ áâப¨ |
1337 | mov eax, par_buff |
1337 | mov eax, par_buff |
1338 | call ascitoint |
1338 | call ascitoint |
1339 | 1339 | ||
1340 | ;data_debug 'Debug eax: ', eax |
1340 | ;data_debug 'Debug eax: ', eax |
1341 | 1341 | ||
1342 | cmp ecx, 0 ; ¥ ¬®¦¥â ç¨ âìáï á â®çª¨ |
1342 | cmp ecx, 0 ; ¥ ¬®¦¥â ç¨ âìáï á â®çª¨ |
1343 | jz ip_err |
1343 | jz ip_err |
1344 | shl esi, 8 ; ¤¢¨£ ¥¬ ¯à¥¤ë¤ã騩 ¡ ©â |
1344 | shl esi, 8 ; ¤¢¨£ ¥¬ ¯à¥¤ë¤ã騩 ¡ ©â |
1345 | add esi, eax |
1345 | add esi, eax |
1346 | inc ecx |
1346 | inc ecx |
1347 | xor edx, edx ; ç¥â稪 ¡ãä¥à = 0 |
1347 | xor edx, edx ; ç¥â稪 ¡ãä¥à = 0 |
1348 | jmp ip_loop |
1348 | jmp ip_loop |
1349 | 1349 | ||
1350 | 1350 | ||
1351 | ip_colon: ; : áâப¥ ¤à¥á |
1351 | ip_colon: ; : áâப¥ ¤à¥á |
1352 | inc edi ; ë«® : |
1352 | inc edi ; ë«® : |
1353 | jmp ip_dot |
1353 | jmp ip_dot |
1354 | 1354 | ||
1355 | ip_end_str: |
1355 | ip_end_str: |
1356 | cmp edi, 1 |
1356 | cmp edi, 1 |
1357 | jz @f |
1357 | jz @f |
1358 | ; : ¥ ¡ë«® |
1358 | ; : ¥ ¡ë«® |
1359 | mov [par_buff+edx], 0 ; ®¥æ áâப¨ |
1359 | mov [par_buff+edx], 0 ; ®¥æ áâப¨ |
1360 | mov eax, par_buff |
1360 | mov eax, par_buff |
1361 | call ascitoint |
1361 | call ascitoint |
1362 | shl esi, 8 ; ¤¢¨£ ¥¬ ¯à¥¤ë¤ã騩 ¡ ©â |
1362 | shl esi, 8 ; ¤¢¨£ ¥¬ ¯à¥¤ë¤ã騩 ¡ ©â |
1363 | add esi, eax |
1363 | add esi, eax |
1364 | ;mov eax, esi ; IP ¢ 16 à¨ç®© ä®à¬¥ |
1364 | ;mov eax, esi ; IP ¢ 16 à¨ç®© ä®à¬¥ |
1365 | ;xor ebx, ebx ; ®¬¥à ¯®àâ ¥â |
1365 | ;xor ebx, ebx ; ®¬¥à ¯®àâ ¥â |
1366 | jmp ip_end |
1366 | jmp ip_end |
1367 | 1367 | ||
1368 | @@: ; ë«® : |
1368 | @@: ; ë«® : |
1369 | mov [par_buff+edx], 0 |
1369 | mov [par_buff+edx], 0 |
1370 | mov eax, par_buff |
1370 | mov eax, par_buff |
1371 | call ascitoint |
1371 | call ascitoint |
1372 | mov ebx, eax |
1372 | mov ebx, eax |
1373 | jmp ip_end |
1373 | jmp ip_end |
1374 | 1374 | ||
1375 | ip_err: |
1375 | ip_err: |
1376 | xor esi, esi |
1376 | xor esi, esi |
1377 | 1377 | ||
1378 | ip_end: |
1378 | ip_end: |
1379 | mov eax, esi |
1379 | mov eax, esi |
1380 | 1380 | ||
1381 | pop edi |
1381 | pop edi |
1382 | pop esi |
1382 | pop esi |
1383 | pop edx |
1383 | pop edx |
1384 | pop ecx |
1384 | pop ecx |
1385 | popf |
1385 | popf |
1386 | ret |
1386 | ret |
1387 | 1387 | ||
1388 | ; |
1388 | ; |
1389 | ; <-- eax 㪠§ ⥫ì asci |
1389 | ; <-- eax 㪠§ ⥫ì asci |
1390 | ; --> eax int |
1390 | ; --> eax int |
1391 | ; |
1391 | ; |
1392 | ascitoint: |
1392 | ascitoint: |
1393 | pushf |
1393 | pushf |
1394 | push ebx |
1394 | push ebx |
1395 | push ecx |
1395 | push ecx |
1396 | push edx |
1396 | push edx |
1397 | push esi |
1397 | push esi |
1398 | push edi |
1398 | push edi |
1399 | 1399 | ||
1400 | xor ebx, ebx |
1400 | xor ebx, ebx |
1401 | xor ecx, ecx |
1401 | xor ecx, ecx |
1402 | xor edx, edx |
1402 | xor edx, edx |
1403 | ;xor esi, esi |
1403 | ;xor esi, esi |
1404 | xor edi, edi |
1404 | xor edi, edi |
1405 | 1405 | ||
1406 | ati_loop: |
1406 | ati_loop: |
1407 | mov bl, [eax+ecx] |
1407 | mov bl, [eax+ecx] |
1408 | cmp bl, 0 ; ®¥æ áâப¨ |
1408 | cmp bl, 0 ; ®¥æ áâப¨ |
1409 | jz ati_str_end |
1409 | jz ati_str_end |
1410 | cmp bl, 39h |
1410 | cmp bl, 39h |
1411 | ja ati_err ; ¥ æ¨äà |
1411 | ja ati_err ; ¥ æ¨äà |
1412 | cmp bl, 30h |
1412 | cmp bl, 30h |
1413 | jb ati_err |
1413 | jb ati_err |
1414 | 1414 | ||
1415 | inc ecx |
1415 | inc ecx |
1416 | jmp ati_loop |
1416 | jmp ati_loop |
1417 | 1417 | ||
1418 | ati_str_end: ; ecx ¤«¨ áâப¨ |
1418 | ati_str_end: ; ecx ¤«¨ áâப¨ |
1419 | ;dec ecx ; áâ ®¢¨¬ ¯®á«¥¤¨© ᨬ¢®« |
1419 | ;dec ecx ; áâ ®¢¨¬ ¯®á«¥¤¨© ᨬ¢®« |
1420 | add eax, ecx ; ª § ⥫ì áâபã + «¨ áâப¨ |
1420 | add eax, ecx ; ª § ⥫ì áâபã + «¨ áâப¨ |
1421 | dec eax |
1421 | dec eax |
1422 | 1422 | ||
1423 | ati_loop2: |
1423 | ati_loop2: |
1424 | cmp edx, ecx |
1424 | cmp edx, ecx |
1425 | jz ati_all |
1425 | jz ati_all |
1426 | push eax |
1426 | push eax |
1427 | sub eax, edx ; ëç¥áâì áç¥â稪 |
1427 | sub eax, edx ; ëç¥áâì áç¥â稪 |
1428 | movzx ebx, byte [eax] ; bl ᨬ¢®« |
1428 | movzx ebx, byte [eax] ; bl ᨬ¢®« |
1429 | ;pop eax |
1429 | ;pop eax |
1430 | sub bl, 30h ; ëç¨á«ï¥¬ 10â¨çãî æ¨äàã |
1430 | sub bl, 30h ; ëç¨á«ï¥¬ 10â¨çãî æ¨äàã |
1431 | 1431 | ||
1432 | ;push eax |
1432 | ;push eax |
1433 | mov eax, ebx ; eax - æ¨äà |
1433 | mov eax, ebx ; eax - æ¨äà |
1434 | mov ebx, 10 ; ®¦¨â¥«ì |
1434 | mov ebx, 10 ; ®¦¨â¥«ì |
1435 | 1435 | ||
1436 | xor esi, esi |
1436 | xor esi, esi |
1437 | 1437 | ||
1438 | ati_mul: |
1438 | ati_mul: |
1439 | 1439 | ||
1440 | cmp esi, edx ; ¬®¦ ¥¬ 10 n à § |
1440 | cmp esi, edx ; ¬®¦ ¥¬ 10 n à § |
1441 | jz ati_mul_end |
1441 | jz ati_mul_end |
1442 | ;push eax |
1442 | ;push eax |
1443 | ;mov eax, ebx |
1443 | ;mov eax, ebx |
1444 | imul eax, ebx |
1444 | imul eax, ebx |
1445 | ;mov ebx, eax |
1445 | ;mov ebx, eax |
1446 | ;pop eax |
1446 | ;pop eax |
1447 | inc esi |
1447 | inc esi |
1448 | jmp ati_mul |
1448 | jmp ati_mul |
1449 | 1449 | ||
1450 | 1450 | ||
1451 | ati_mul_end: |
1451 | ati_mul_end: |
1452 | mov ebx, eax ; ebx ¢ëç¨á«¥®¥ ç¨á«® |
1452 | mov ebx, eax ; ebx ¢ëç¨á«¥®¥ ç¨á«® |
1453 | pop eax |
1453 | pop eax |
1454 | 1454 | ||
1455 | add edi, ebx |
1455 | add edi, ebx |
1456 | inc edx |
1456 | inc edx |
1457 | jmp ati_loop2 |
1457 | jmp ati_loop2 |
1458 | 1458 | ||
1459 | ati_all: |
1459 | ati_all: |
1460 | mov eax, edi |
1460 | mov eax, edi |
1461 | jmp ati_end |
1461 | jmp ati_end |
1462 | 1462 | ||
1463 | ati_err: |
1463 | ati_err: |
1464 | 1464 | ||
1465 | ;ati_str_end: |
1465 | ;ati_str_end: |
1466 | xor eax, eax |
1466 | xor eax, eax |
1467 | 1467 | ||
1468 | ati_end: |
1468 | ati_end: |
1469 | pop edi |
1469 | pop edi |
1470 | pop esi |
1470 | pop esi |
1471 | pop edx |
1471 | pop edx |
1472 | pop ecx |
1472 | pop ecx |
1473 | pop ebx |
1473 | pop ebx |
1474 | popf |
1474 | popf |
1475 | ret |
1475 | ret |
1476 | 1476 | ||
1477 | ; |
1477 | ; |
1478 | ; |
1478 | ; |
1479 | ; <-- ecx 奤« ᮪¥â |
1479 | ; <-- ecx 奤« ᮪¥â |
1480 | ; <-- eax 㪠§ ⥫ì áâàãªâãàã SNAC_head |
1480 | ; <-- eax 㪠§ ⥫ì áâàãªâãàã SNAC_head |
1481 | ; <-- ebx 㪠§ â¥«ì ¤ ë¥ |
1481 | ; <-- ebx 㪠§ â¥«ì ¤ ë¥ |
1482 | ; <-- edx à §¬¥à ¤ ëå |
1482 | ; <-- edx à §¬¥à ¤ ëå |
1483 | ; --> eax १ã«ìâ â § ¯¨á¨ ¢ ᮪¥â |
1483 | ; --> eax १ã«ìâ â § ¯¨á¨ ¢ ᮪¥â |
1484 | ; |
1484 | ; |
1485 | 1485 | ||
1486 | snac_buff db 1024 dup 0 |
1486 | snac_buff db 1024 dup 0 |
1487 | 1487 | ||
1488 | sendsnac: |
1488 | sendsnac: |
1489 | pushf |
1489 | pushf |
1490 | push esi |
1490 | push esi |
1491 | push edi |
1491 | push edi |
1492 | push ebx |
1492 | push ebx |
1493 | push edx |
1493 | push edx |
1494 | ;xor ebx, ebx |
1494 | ;xor ebx, ebx |
1495 | mov esi, ecx ; 奤« ᮪¥â |
1495 | mov esi, ecx ; 奤« ᮪¥â |
1496 | mov edi, ebx ; ª § â¥«ì ¤ ë¥ |
1496 | mov edi, ebx ; ª § â¥«ì ¤ ë¥ |
1497 | 1497 | ||
1498 | xor ebx, ebx |
1498 | xor ebx, ebx |
1499 | mov bl, [eax] ; |
1499 | mov bl, [eax] ; |
1500 | mov [snac_buff+1], bl ; Family ID |
1500 | mov [snac_buff+1], bl ; Family ID |
1501 | mov bl, [eax+1] ; ®¢¥àâ¨àã¥âáï ¢ BigEndian |
1501 | mov bl, [eax+1] ; ®¢¥àâ¨àã¥âáï ¢ BigEndian |
1502 | mov [snac_buff], bl ; |
1502 | mov [snac_buff], bl ; |
1503 | 1503 | ||
1504 | mov bl, [eax+2] ; |
1504 | mov bl, [eax+2] ; |
1505 | mov [snac_buff+3], bl ; Subtype ID |
1505 | mov [snac_buff+3], bl ; Subtype ID |
1506 | mov bl, [eax+3] ; |
1506 | mov bl, [eax+3] ; |
1507 | mov [snac_buff+2], bl ; |
1507 | mov [snac_buff+2], bl ; |
1508 | 1508 | ||
1509 | mov bl, [eax+4] ; |
1509 | mov bl, [eax+4] ; |
1510 | mov [snac_buff+5], bl ; |
1510 | mov [snac_buff+5], bl ; |
1511 | mov bl, [eax+5] ; Flags |
1511 | mov bl, [eax+5] ; Flags |
1512 | mov [snac_buff+4], bl ; |
1512 | mov [snac_buff+4], bl ; |
1513 | 1513 | ||
1514 | mov bl, [eax+6] ; |
1514 | mov bl, [eax+6] ; |
1515 | mov [snac_buff+9], bl ; |
1515 | mov [snac_buff+9], bl ; |
1516 | mov bl, [eax+7] ; |
1516 | mov bl, [eax+7] ; |
1517 | mov [snac_buff+8], bl ; |
1517 | mov [snac_buff+8], bl ; |
1518 | mov bl, [eax+8] ; Reqest ID |
1518 | mov bl, [eax+8] ; Reqest ID |
1519 | mov [snac_buff+7], bl ; |
1519 | mov [snac_buff+7], bl ; |
1520 | mov bl, [eax+9] ; |
1520 | mov bl, [eax+9] ; |
1521 | mov [snac_buff+6], bl ; |
1521 | mov [snac_buff+6], bl ; |
1522 | 1522 | ||
1523 | lea ebx, [snac_buff+10] |
1523 | lea ebx, [snac_buff+10] |
1524 | 1524 | ||
1525 | mov eax, edi ; ª § â¥«ì ¤ ë¥ |
1525 | mov eax, edi ; ª § â¥«ì ¤ ë¥ |
1526 | ;add ebx, 10 ; + à §¬¥à § £®«®¢ª SNAC |
1526 | ;add ebx, 10 ; + à §¬¥à § £®«®¢ª SNAC |
1527 | mov ecx, edx ; à §¬¥à ¤ ëå |
1527 | mov ecx, edx ; à §¬¥à ¤ ëå |
1528 | call strcpy |
1528 | call strcpy |
1529 | 1529 | ||
1530 | 1530 | ||
1531 | mov ecx, esi ; ¥¤« ᮪¥â |
1531 | mov ecx, esi ; ¥¤« ᮪¥â |
1532 | mov [flap.bId], FLAP_ID |
1532 | mov [flap.bId], FLAP_ID |
1533 | mov [flap.bCh], 2 ; « ¤«ï ¯®á뫪¨ SNAC |
1533 | mov [flap.bCh], 2 ; « ¤«ï ¯®á뫪¨ SNAC |
1534 | xor ebx, ebx |
1534 | xor ebx, ebx |
1535 | inc [seq] ; seq ¢¥«¨ç¨¢ ¥âáï 1 ¯à¨ ª ¦¤®© ¯®á뫪¥ |
1535 | inc [seq] ; seq ¢¥«¨ç¨¢ ¥âáï 1 ¯à¨ ª ¦¤®© ¯®á뫪¥ |
1536 | mov bx, [seq] |
1536 | mov bx, [seq] |
1537 | mov [flap.wSn], bx |
1537 | mov [flap.wSn], bx |
1538 | add edx, 10 ; à §¬¥à ¤ ëå + à §¬¥à § £®«®¢ª SNAC |
1538 | add edx, 10 ; à §¬¥à ¤ ëå + à §¬¥à § £®«®¢ª SNAC |
1539 | mov [flap.wDs], dx |
1539 | mov [flap.wDs], dx |
1540 | mov eax, flap |
1540 | mov eax, flap |
1541 | mov ebx, snac_buff |
1541 | mov ebx, snac_buff |
1542 | call sendflap |
1542 | call sendflap |
1543 | 1543 | ||
1544 | pop edx |
1544 | pop edx |
1545 | pop ebx |
1545 | pop ebx |
1546 | pop edi |
1546 | pop edi |
1547 | pop esi |
1547 | pop esi |
1548 | popf |
1548 | popf |
1549 | ret |
1549 | ret |
1550 | 1550 | ||
1551 | 1551 | ||
1552 | 1552 | ||
1553 | ; ¡à ¡®âª ¢á¥å ¯ ªâ®¢, ¯à¨å®¤ïé¨å ®â á¥à¢¥à |
1553 | ; ¡à ¡®âª ¢á¥å ¯ ªâ®¢, ¯à¨å®¤ïé¨å ®â á¥à¢¥à |
1554 | ; ECX <-- ¥¤« ᮪¥â |
1554 | ; ECX <-- ¥¤« ᮪¥â |
1555 | ; |
1555 | ; |
1556 | ; |
1556 | ; |
1557 | ; |
1557 | ; |
1558 | ; |
1558 | ; |
1559 | ; |
1559 | ; |
1560 | main_loop: |
1560 | main_loop: |
1561 | pushf |
1561 | pushf |
1562 | ;push eax |
1562 | ;push eax |
1563 | ;push ebx |
1563 | ;push ebx |
1564 | ;push edx |
1564 | ;push edx |
1565 | pushad |
1565 | pushad |
1566 | 1566 | ||
1567 | mov ecx, [socket] |
1567 | mov ecx, [socket] |
1568 | ; |
1568 | ; |
1569 | ; ¦¤¥¬ ¯ ª¥â |
1569 | ; ¦¤¥¬ ¯ ª¥â |
1570 | ; |
1570 | ; |
1571 | ;m_loop: |
1571 | ;m_loop: |
1572 | ;mov eax, 53 |
1572 | ;mov eax, 53 |
1573 | ;mov ebx, 2 |
1573 | ;mov ebx, 2 |
1574 | ;int 40h |
1574 | ;int 40h |
1575 | ;cmp eax, 6 ; à §¬¥à § £®«® ª FLAP |
1575 | ;cmp eax, 6 ; à §¬¥à § £®«® ª FLAP |
1576 | ;jnc recived ; >= |
1576 | ;jnc recived ; >= |
1577 | ; |
1577 | ; |
1578 | ; 室¨¬ |
1578 | ; 室¨¬ |
1579 | ; |
1579 | ; |
1580 | ;jmp m_fin |
1580 | ;jmp m_fin |
1581 | ;mov eax, 5 |
1581 | ;mov eax, 5 |
1582 | ;mov ebx, 5 |
1582 | ;mov ebx, 5 |
1583 | ;int 40h |
1583 | ;int 40h |
1584 | ;jmp m_loop |
1584 | ;jmp m_loop |
1585 | ; |
1585 | ; |
1586 | ; ¥áâì ¯ ª¥â |
1586 | ; ¥áâì ¯ ª¥â |
1587 | ; |
1587 | ; |
1588 | ;recived: |
1588 | ;recived: |
1589 | ;mov eax, rflap |
1589 | ;mov eax, rflap |
1590 | ;mov ebx, rbuff |
1590 | ;mov ebx, rbuff |
1591 | ;call recvflap |
1591 | ;call recvflap |
1592 | ; |
1592 | ; |
1593 | ; ¯à¥¤¥«ï¥¬ ⨯ ¯à¨ï⮣® FLAP |
1593 | ; ¯à¥¤¥«ï¥¬ ⨯ ¯à¨ï⮣® FLAP |
1594 | ; |
1594 | ; |
1595 | xor ebx, ebx |
1595 | xor ebx, ebx |
1596 | mov bl, [rflap.bCh] |
1596 | mov bl, [rflap.bCh] |
1597 | cmp bl, 1 ; áâ ®¢ª ᮥ¤¨¥¨ï |
1597 | cmp bl, 1 ; áâ ®¢ª ᮥ¤¨¥¨ï |
1598 | jz m_login |
1598 | jz m_login |
1599 | cmp bl, 2 |
1599 | cmp bl, 2 |
1600 | jz m_snac ; ®«ãç¥ SNAC |
1600 | jz m_snac ; ®«ãç¥ SNAC |
1601 | cmp bl, 3 |
1601 | cmp bl, 3 |
1602 | jz m_flap_err ; FLAP-level error |
1602 | jz m_flap_err ; FLAP-level error |
1603 | cmp bl, 4 |
1603 | cmp bl, 4 |
1604 | jz m_close_conn ; ªàë⨥ ᮥ¤¨¥¨ï |
1604 | jz m_close_conn ; ªàë⨥ ᮥ¤¨¥¨ï |
1605 | cmp bl, 5 |
1605 | cmp bl, 5 |
1606 | jz m_keep_alive ; |
1606 | jz m_keep_alive ; |
1607 | ; |
1607 | ; |
1608 | ; ¡à ¡®âª à áᮥ¤¨¥¨ï |
1608 | ; ¡à ¡®âª à áᮥ¤¨¥¨ï |
1609 | ; |
1609 | ; |
1610 | m_close_conn: |
1610 | m_close_conn: |
1611 | write_debug 'Another Computer Use YOUR UIN!' |
1611 | write_debug 'Another Computer is Useing YOUR UIN!' |
1612 | call srv_disconnect |
1612 | call srv_disconnect |
1613 | call closesocket |
1613 | call closesocket |
1614 | jmp m_fin |
1614 | jmp m_fin |
1615 | ; |
1615 | ; |
1616 | ; ®¡à ¡®âª ᮥ¤¨¥¨ï |
1616 | ; ®¡à ¡®âª ᮥ¤¨¥¨ï |
1617 | ; |
1617 | ; |
1618 | m_login: |
1618 | m_login: |
1619 | ; |
1619 | ; |
1620 | ; ¯à®¢¥à塞 ¢¥àá¨î ¯à®â®ª®« |
1620 | ; ¯à®¢¥à塞 ¢¥àá¨î ¯à®â®ª®« |
1621 | ; |
1621 | ; |
1622 | xor eax, eax |
1622 | xor eax, eax |
1623 | mov al, [mbuff+3] |
1623 | mov al, [mbuff+3] |
1624 | cmp eax, 1 |
1624 | cmp eax, 1 |
1625 | jnz m_login_other ; ¥ ¯®¤å®¤¨â |
1625 | jnz m_login_other ; ¥ ¯®¤å®¤¨â |
1626 | 1626 | ||
1627 | 1627 | ||
1628 | ; |
1628 | ; |
1629 | ; £¥¥à¨à㥬 á«ãç ©ë© seq |
1629 | ; £¥¥à¨à㥬 á«ãç ©ë© seq |
1630 | ; «ï í⮣® ¡¥à¥¬ ¢à¥¬ï, ¯à®è¥¤è¥¥ á ¬®¬¥â § ¯ã᪠á¨á⥬ë |
1630 | ; «ï í⮣® ¡¥à¥¬ ¢à¥¬ï, ¯à®è¥¤è¥¥ á ¬®¬¥â § ¯ã᪠á¨á⥬ë |
1631 | ; |
1631 | ; |
1632 | mov eax, 26 |
1632 | mov eax, 26 |
1633 | mov ebx, 9 |
1633 | mov ebx, 9 |
1634 | int 40h |
1634 | int 40h |
1635 | mov [seq], ax |
1635 | mov [seq], ax |
1636 | ; |
1636 | ; |
1637 | ; ⤠¥¬ á¥à¢¥àã cookie |
1637 | ; ⤠¥¬ á¥à¢¥àã cookie |
1638 | ; |
1638 | ; |
1639 | mov [flap.bCh], 1 |
1639 | mov [flap.bCh], 1 |
1640 | mov [flap.wSn], ax |
1640 | mov [flap.wSn], ax |
1641 | xor eax, eax |
1641 | xor eax, eax |
1642 | mov ax, [cookie_len] |
1642 | mov ax, [cookie_len] |
1643 | add eax, 8 ; TLV len + protocol version len |
1643 | add eax, 8 ; TLV len + protocol version len |
1644 | mov [flap.wDs], ax |
1644 | mov [flap.wDs], ax |
1645 | mov dword [buff], 01000000h ; 00 00 00 01 ®¬¥à ¯à®â®ª®« |
1645 | mov dword [buff], 01000000h ; 00 00 00 01 ®¬¥à ¯à®â®ª®« |
1646 | mov word [buff+4], 0600h ; 00 06 TLV.Type |
1646 | mov word [buff+4], 0600h ; 00 06 TLV.Type |
1647 | 1647 | ||
1648 | mov ax, [cookie_len] |
1648 | mov ax, [cookie_len] |
1649 | mov [buff+6], ah ; |
1649 | mov [buff+6], ah ; |
1650 | mov [buff+7], al ; TLV.Length |
1650 | mov [buff+7], al ; TLV.Length |
1651 | 1651 | ||
1652 | mov edx, ecx ; edx <-- socket handle |
1652 | mov edx, ecx ; edx <-- socket handle |
1653 | 1653 | ||
1654 | mov ecx, eax ; ecx <-- cookie len |
1654 | mov ecx, eax ; ecx <-- cookie len |
1655 | mov eax, srv_cookie ; Src |
1655 | mov eax, srv_cookie ; Src |
1656 | lea ebx, [buff+8] |
1656 | lea ebx, [buff+8] |
1657 | call strcpy |
1657 | call strcpy |
1658 | 1658 | ||
1659 | mov ecx, edx ; ecx <-- socket handle |
1659 | mov ecx, edx ; ecx <-- socket handle |
1660 | mov eax, flap |
1660 | mov eax, flap |
1661 | mov ebx, buff |
1661 | mov ebx, buff |
1662 | call sendflap |
1662 | call sendflap |
1663 | jmp m_fin |
1663 | jmp m_fin |
1664 | 1664 | ||
1665 | m_login_other: |
1665 | m_login_other: |
1666 | jmp m_fin |
1666 | jmp m_fin |
1667 | 1667 | ||
1668 | ; |
1668 | ; |
1669 | ; ª ®¡à ¡®â âì ®è¨¡ªã, ï ¥ § î |
1669 | ; ª ®¡à ¡®â âì ®è¨¡ªã, ï ¥ § î |
1670 | ; |
1670 | ; |
1671 | m_flap_err: |
1671 | m_flap_err: |
1672 | jmp m_fin |
1672 | jmp m_fin |
1673 | 1673 | ||
1674 | ; |
1674 | ; |
1675 | ; ®ª ¥ ®¡à ¡ âë¢ ¥âáï |
1675 | ; ®ª ¥ ®¡à ¡ âë¢ ¥âáï |
1676 | ; |
1676 | ; |
1677 | m_keep_alive: |
1677 | m_keep_alive: |
1678 | jmp m_fin |
1678 | jmp m_fin |
1679 | 1679 | ||
1680 | 1680 | ||
1681 | ; |
1681 | ; |
1682 | ; ®«ãç¥ SNAC |
1682 | ; ®«ãç¥ SNAC |
1683 | ; ᯮ§ ¥¬ ¥£® ⨯ |
1683 | ; ᯮ§ ¥¬ ¥£® ⨯ |
1684 | ; |
1684 | ; |
1685 | m_snac: |
1685 | m_snac: |
1686 | mov eax, rsnac |
1686 | mov eax, rsnac |
1687 | mov ebx, mbuff |
1687 | mov ebx, mbuff |
1688 | call snacpar |
1688 | call snacpar |
1689 | xor ebx, ebx |
1689 | xor ebx, ebx |
1690 | xor edx, edx |
1690 | xor edx, edx |
1691 | mov bx, [rsnac.wFid] |
1691 | mov bx, [rsnac.wFid] |
1692 | mov dx, [rsnac.wSid] |
1692 | mov dx, [rsnac.wSid] |
1693 | 1693 | ||
1694 | cmp bx, 1 |
1694 | cmp bx, 1 |
1695 | jz m_snac_1 ;Generic service controls |
1695 | jz m_snac_1 ;Generic service controls |
1696 | cmp bx, 2 |
1696 | cmp bx, 2 |
1697 | jz m_snac_2 ;Location services |
1697 | jz m_snac_2 ;Location services |
1698 | cmp bx, 3 |
1698 | cmp bx, 3 |
1699 | jz m_snac_3 ;Buddy List management service |
1699 | jz m_snac_3 ;Buddy List management service |
1700 | cmp bx, 4 |
1700 | cmp bx, 4 |
1701 | jz m_snac_4 ;ICBM (messages) service |
1701 | jz m_snac_4 ;ICBM (messages) service |
1702 | cmp bx, 9 |
1702 | cmp bx, 9 |
1703 | jz m_snac_9 ;Privacy management service |
1703 | jz m_snac_9 ;Privacy management service |
1704 | cmp bx, 015h |
1704 | cmp bx, 015h |
1705 | jz m_snac_15 ;ICQ specific extensions service |
1705 | jz m_snac_15 ;ICQ specific extensions service |
1706 | cmp bx, 013h |
1706 | cmp bx, 013h |
1707 | jz m_snac_13 ;Server Side Information (SSI) service |
1707 | jz m_snac_13 ;Server Side Information (SSI) service |
1708 | 1708 | ||
1709 | jmp m_other_snac |
1709 | jmp m_other_snac |
1710 | ; |
1710 | ; |
1711 | ; FAMILY 1 |
1711 | ; FAMILY 1 |
1712 | ; |
1712 | ; |
1713 | m_snac_1: |
1713 | m_snac_1: |
1714 | cmp dx, 7 |
1714 | cmp dx, 7 |
1715 | jz m_snac_1_7 |
1715 | jz m_snac_1_7 |
1716 | cmp dx, 3 |
1716 | cmp dx, 3 |
1717 | jz m_snac_1_3 |
1717 | jz m_snac_1_3 |
1718 | cmp dx, 018h |
1718 | cmp dx, 018h |
1719 | jz m_snac_1_18 |
1719 | jz m_snac_1_18 |
1720 | cmp dx, 01Fh |
1720 | cmp dx, 01Fh |
1721 | jz m_snac_1_f |
1721 | jz m_snac_1_f |
1722 | cmp dx, 13h |
1722 | cmp dx, 13h |
1723 | jz m_snac_13 |
1723 | jz m_snac_13 |
1724 | cmp dx, 1 |
1724 | cmp dx, 1 |
1725 | jz m_snac_1_1 |
1725 | jz m_snac_1_1 |
1726 | jmp m_snac_1_other |
1726 | jmp m_snac_1_other |
1727 | ; |
1727 | ; |
1728 | ; Rate limits information response |
1728 | ; Rate limits information response |
1729 | ; |
1729 | ; |
1730 | m_snac_1_7: ; â¢¥ç ¥¬ |
1730 | m_snac_1_7: ; â¢¥ç ¥¬ |
1731 | mov [ssnac.wFid], 1 ; Family |
1731 | mov [ssnac.wFid], 1 ; Family |
1732 | mov [ssnac.wSid], 8 ; Subtype |
1732 | mov [ssnac.wSid], 8 ; Subtype |
1733 | mov [ssnac.dRi], 8 |
1733 | mov [ssnac.dRi], 8 |
1734 | mov word [buff], 0100h ; 0001 |
1734 | mov word [buff], 0100h ; 0001 |
1735 | mov word [buff+2], 0200h ; 0002 |
1735 | mov word [buff+2], 0200h ; 0002 |
1736 | mov word [buff+4], 0300h ; 0003 |
1736 | mov word [buff+4], 0300h ; 0003 |
1737 | mov word [buff+6], 0400h ; 0004 |
1737 | mov word [buff+6], 0400h ; 0004 |
1738 | mov word [buff+8], 0500h ; 0005 |
1738 | mov word [buff+8], 0500h ; 0005 |
1739 | mov eax, ssnac |
1739 | mov eax, ssnac |
1740 | mov ebx, buff |
1740 | mov ebx, buff |
1741 | mov edx, 10 ; §¬¥à ¤ ëå |
1741 | mov edx, 10 ; §¬¥à ¤ ëå |
1742 | call sendsnac |
1742 | call sendsnac |
1743 | ; |
1743 | ; |
1744 | ; Client ask server location service limitations |
1744 | ; Client ask server location service limitations |
1745 | ; |
1745 | ; |
1746 | mov [ssnac.wFid], 2 ; Family |
1746 | mov [ssnac.wFid], 2 ; Family |
1747 | mov [ssnac.wSid], 2 ; Subtype |
1747 | mov [ssnac.wSid], 2 ; Subtype |
1748 | mov [ssnac.dRi], 2 |
1748 | mov [ssnac.dRi], 2 |
1749 | mov eax, ssnac |
1749 | mov eax, ssnac |
1750 | mov ebx, buff |
1750 | mov ebx, buff |
1751 | xor edx, edx |
1751 | xor edx, edx |
1752 | call sendsnac |
1752 | call sendsnac |
1753 | 1753 | ||
1754 | jmp m_fin |
1754 | jmp m_fin |
1755 | 1755 | ||
1756 | ; |
1756 | ; |
1757 | ; Server supported snac families list |
1757 | ; Server supported snac families list |
1758 | ; |
1758 | ; |
1759 | m_snac_1_3: |
1759 | m_snac_1_3: |
1760 | ; |
1760 | ; |
1761 | ; Server sends supported services list |
1761 | ; Server sends supported services list |
1762 | ; |
1762 | ; |
1763 | 1763 | ||
1764 | ; |
1764 | ; |
1765 | ; SNAC(01,17) |
1765 | ; SNAC(01,17) |
1766 | ; Client ask for services version numbers |
1766 | ; Client ask for services version numbers |
1767 | ; |
1767 | ; |
1768 | mov [ssnac.wFid], 1 ; Family |
1768 | mov [ssnac.wFid], 1 ; Family |
1769 | mov [ssnac.wSid], 17h ; Subtype |
1769 | mov [ssnac.wSid], 17h ; Subtype |
1770 | mov [ssnac.dRi], 17h |
1770 | mov [ssnac.dRi], 17h |
1771 | ; |
1771 | ; |
1772 | ; ¯¨á®ª á¥à¢¨á®¢, ª®â®àë¥ ¬ ã¦ë |
1772 | ; ¯¨á®ª á¥à¢¨á®¢, ª®â®àë¥ ¬ ã¦ë |
1773 | ; |
1773 | ; |
1774 | ; xx xx word family number #1 |
1774 | ; xx xx word family number #1 |
1775 | ; xx xx word family version |
1775 | ; xx xx word family version |
1776 | ; ... ... ... |
1776 | ; ... ... ... |
1777 | ; |
1777 | ; |
1778 | 1778 | ||
1779 | ; |
1779 | ; |
1780 | ; ®¯à ¢¨« ¨§ ¤ ¬¯ &RQ |
1780 | ; ®¯à ¢¨« ¨§ ¤ ¬¯ &RQ |
1781 | ; |
1781 | ; |
1782 | mov word [buff], 0100h ; 0001 |
1782 | mov word [buff], 0100h ; 0001 |
1783 | mov word [buff+2], 0300h ; 0003 |
1783 | mov word [buff+2], 0300h ; 0003 |
1784 | 1784 | ||
1785 | mov word [buff+4], 1300h ; 0013 |
1785 | mov word [buff+4], 1300h ; 0013 |
1786 | mov word [buff+6], 0200h ; 0002 |
1786 | mov word [buff+6], 0200h ; 0002 |
1787 | 1787 | ||
1788 | mov word [buff+8], 0200h ; 0002 |
1788 | mov word [buff+8], 0200h ; 0002 |
1789 | mov word [buff+10], 0100h ; 0001 |
1789 | mov word [buff+10], 0100h ; 0001 |
1790 | 1790 | ||
1791 | mov word [buff+12], 0300h ; 0002 |
1791 | mov word [buff+12], 0300h ; 0002 |
1792 | mov word [buff+14], 0100h ; 0001 |
1792 | mov word [buff+14], 0100h ; 0001 |
1793 | 1793 | ||
1794 | mov word [buff+16], 1500h ; 0015 |
1794 | mov word [buff+16], 1500h ; 0015 |
1795 | mov word [buff+18], 0100h ; 0001 |
1795 | mov word [buff+18], 0100h ; 0001 |
1796 | 1796 | ||
1797 | mov word [buff+20], 0400h ; 0004 |
1797 | mov word [buff+20], 0400h ; 0004 |
1798 | mov word [buff+22], 0100h ; 0001 |
1798 | mov word [buff+22], 0100h ; 0001 |
1799 | 1799 | ||
1800 | mov word [buff+24], 0600h ; 0006 |
1800 | mov word [buff+24], 0600h ; 0006 |
1801 | mov word [buff+26], 0100h ; 0001 |
1801 | mov word [buff+26], 0100h ; 0001 |
1802 | 1802 | ||
1803 | mov word [buff+28], 0900h ; 0009 |
1803 | mov word [buff+28], 0900h ; 0009 |
1804 | mov word [buff+30], 0100h ; 0001 |
1804 | mov word [buff+30], 0100h ; 0001 |
1805 | 1805 | ||
1806 | mov word [buff+32], 1300h ; 0013 |
1806 | mov word [buff+32], 1300h ; 0013 |
1807 | mov word [buff+34], 0400h ; 0004 |
1807 | mov word [buff+34], 0400h ; 0004 |
1808 | 1808 | ||
1809 | mov word [buff+36], 1500h ; 0015 |
1809 | mov word [buff+36], 1500h ; 0015 |
1810 | mov word [buff+38], 0400h ; 0004 |
1810 | mov word [buff+38], 0400h ; 0004 |
1811 | 1811 | ||
1812 | mov word [buff+40], 1000h ; 0010 |
1812 | mov word [buff+40], 1000h ; 0010 |
1813 | mov word [buff+42], 0100h ; 0001 |
1813 | mov word [buff+42], 0100h ; 0001 |
1814 | 1814 | ||
1815 | 1815 | ||
1816 | 1816 | ||
1817 | mov eax, ssnac |
1817 | mov eax, ssnac |
1818 | mov ebx, buff |
1818 | mov ebx, buff |
1819 | mov edx, 44 |
1819 | mov edx, 44 |
1820 | call sendsnac |
1820 | call sendsnac |
1821 | 1821 | ||
1822 | jmp m_fin |
1822 | jmp m_fin |
1823 | 1823 | ||
1824 | 1824 | ||
1825 | ; |
1825 | ; |
1826 | ; Server services versions |
1826 | ; Server services versions |
1827 | ; |
1827 | ; |
1828 | m_snac_1_18: |
1828 | m_snac_1_18: |
1829 | ; |
1829 | ; |
1830 | ; ¡à ¡®âª¨ ¯®ª ¥â |
1830 | ; ¡à ¡®âª¨ ¯®ª ¥â |
1831 | ; |
1831 | ; |
1832 | 1832 | ||
1833 | ; |
1833 | ; |
1834 | ; Client ask server for rate limits info |
1834 | ; Client ask server for rate limits info |
1835 | ; SNAC(01,06) |
1835 | ; SNAC(01,06) |
1836 | ; |
1836 | ; |
1837 | mov [ssnac.wFid], 1 ; Family |
1837 | mov [ssnac.wFid], 1 ; Family |
1838 | mov [ssnac.wSid], 6 ; Subtype |
1838 | mov [ssnac.wSid], 6 ; Subtype |
1839 | mov [ssnac.dRi], 6 |
1839 | mov [ssnac.dRi], 6 |
1840 | mov eax, ssnac |
1840 | mov eax, ssnac |
1841 | mov ebx, buff |
1841 | mov ebx, buff |
1842 | xor edx, edx |
1842 | xor edx, edx |
1843 | call sendsnac |
1843 | call sendsnac |
1844 | 1844 | ||
1845 | 1845 | ||
1846 | 1846 | ||
1847 | jmp m_fin |
1847 | jmp m_fin |
1848 | 1848 | ||
1849 | ; |
1849 | ; |
1850 | ; Requested online info response |
1850 | ; Requested online info response |
1851 | ; |
1851 | ; |
1852 | m_snac_1_f: |
1852 | m_snac_1_f: |
1853 | ; |
1853 | ; |
1854 | ;ãâ ¤®«¦ ¡ëâì è ¨ä®à¬ æ¨ï, ¯®ª ®¡à ¡®âª¨ ¥â |
1854 | ;ãâ ¤®«¦ ¡ëâì è ¨ä®à¬ æ¨ï, ¯®ª ®¡à ¡®âª¨ ¥â |
1855 | ; |
1855 | ; |
1856 | 1856 | ||
1857 | 1857 | ||
1858 | jmp m_fin |
1858 | jmp m_fin |
1859 | 1859 | ||
1860 | ; |
1860 | ; |
1861 | ; Message of the day (MOTD) |
1861 | ; Message of the day (MOTD) |
1862 | ; |
1862 | ; |
1863 | m_snac_1_13: |
1863 | m_snac_1_13: |
1864 | ; |
1864 | ; |
1865 | ; ¥ç¥£® ®¡à ¡ âë¢ âì :-)) |
1865 | ; ¥ç¥£® ®¡à ¡ âë¢ âì :-)) |
1866 | ; |
1866 | ; |
1867 | jmp m_fin |
1867 | jmp m_fin |
1868 | 1868 | ||
1869 | ; |
1869 | ; |
1870 | ; ®®¡é¥¨¥ ®¡ ®è¨¡ª¥ |
1870 | ; ®®¡é¥¨¥ ®¡ ®è¨¡ª¥ |
1871 | ; |
1871 | ; |
1872 | 1872 | ||
1873 | m_snac_1_1: |
1873 | m_snac_1_1: |
1874 | xor eax, eax |
1874 | xor eax, eax |
1875 | mov ax, word [mbuff+10] |
1875 | mov ax, word [mbuff+10] |
1876 | call ntohs |
1876 | call ntohs |
1877 | data_debug 'SERVER SEND ERROR #', eax |
1877 | data_debug 'SERVER SEND ERROR #', eax |
1878 | 1878 | ||
1879 | 1879 | ||
1880 | jmp m_fin |
1880 | jmp m_fin |
1881 | 1881 | ||
1882 | 1882 | ||
1883 | m_snac_1_other: |
1883 | m_snac_1_other: |
1884 | data_debug 'Unknown SNAC Family 1 recived, type ', edx |
1884 | data_debug 'Unknown SNAC Family 1 received, type ', edx |
1885 | jmp m_fin |
1885 | jmp m_fin |
1886 | 1886 | ||
1887 | 1887 | ||
1888 | 1888 | ||
1889 | ; |
1889 | ; |
1890 | ; Family 2 |
1890 | ; Family 2 |
1891 | ; |
1891 | ; |
1892 | m_snac_2: |
1892 | m_snac_2: |
1893 | cmp dx, 3 |
1893 | cmp dx, 3 |
1894 | jz m_snac_2_3 |
1894 | jz m_snac_2_3 |
1895 | jmp m_snac_2_other |
1895 | jmp m_snac_2_other |
1896 | ; |
1896 | ; |
1897 | ; Server replies via location service limitations |
1897 | ; Server replies via location service limitations |
1898 | ; |
1898 | ; |
1899 | m_snac_2_3: |
1899 | m_snac_2_3: |
1900 | ; |
1900 | ; |
1901 | ; ¡à ¡®âª¨ ¯®ª ¥â |
1901 | ; ¡à ¡®âª¨ ¯®ª ¥â |
1902 | ; |
1902 | ; |
1903 | 1903 | ||
1904 | ; |
1904 | ; |
1905 | ; ¯®áë« ¥¬ capabilities / profile |
1905 | ; ¯®áë« ¥¬ capabilities / profile |
1906 | ; |
1906 | ; |
1907 | mov [ssnac.wFid], 2 ; Family |
1907 | mov [ssnac.wFid], 2 ; Family |
1908 | mov [ssnac.wSid], 4 ; Subtype |
1908 | mov [ssnac.wSid], 4 ; Subtype |
1909 | mov [ssnac.dRi], 4 |
1909 | mov [ssnac.dRi], 4 |
1910 | 1910 | ||
1911 | ;mov eax, CAPABILITIES |
1911 | ;mov eax, CAPABILITIES |
1912 | ;mov ebx, buff |
1912 | ;mov ebx, buff |
1913 | ;push ecx |
1913 | ;push ecx |
1914 | ;mov ecx, 5 ; TLV.Type(0x05) - CLSID values |
1914 | ;mov ecx, 5 ; TLV.Type(0x05) - CLSID values |
1915 | ;mov edx, C_LEN |
1915 | ;mov edx, C_LEN |
1916 | ;call tlvstr |
1916 | ;call tlvstr |
1917 | ;pop ecx |
1917 | ;pop ecx |
1918 | mov word [buff], 0500h ; 00 05 |
1918 | mov word [buff], 0500h ; 00 05 |
1919 | mov eax, C_LEN |
1919 | mov eax, C_LEN |
1920 | call htons |
1920 | call htons |
1921 | mov word [buff+2], ax |
1921 | mov word [buff+2], ax |
1922 | 1922 | ||
1923 | 1923 | ||
1924 | 1924 | ||
1925 | push ecx |
1925 | push ecx |
1926 | 1926 | ||
1927 | mov eax, CAPABILITIES |
1927 | mov eax, CAPABILITIES |
1928 | lea ebx, [buff+4] |
1928 | lea ebx, [buff+4] |
1929 | mov ecx, C_LEN |
1929 | mov ecx, C_LEN |
1930 | call strcpy |
1930 | call strcpy |
1931 | 1931 | ||
1932 | pop ecx |
1932 | pop ecx |
1933 | 1933 | ||
1934 | 1934 | ||
1935 | mov eax, ssnac |
1935 | mov eax, ssnac |
1936 | mov ebx, buff |
1936 | mov ebx, buff |
1937 | mov edx, C_LEN+4 ; «¨ ¤ ëå+à §¬¥à § £®«®¢ª TLV |
1937 | mov edx, C_LEN+4 ; «¨ ¤ ëå+à §¬¥à § £®«®¢ª TLV |
1938 | call sendsnac |
1938 | call sendsnac |
1939 | 1939 | ||
1940 | ; |
1940 | ; |
1941 | ; § ¯à 訢 ¥¬ server BLM service limitations |
1941 | ; § ¯à 訢 ¥¬ server BLM service limitations |
1942 | ; |
1942 | ; |
1943 | mov [ssnac.wFid], 3 ; Family |
1943 | mov [ssnac.wFid], 3 ; Family |
1944 | mov [ssnac.wSid], 2 ; Subtype |
1944 | mov [ssnac.wSid], 2 ; Subtype |
1945 | mov [ssnac.dRi], 2 |
1945 | mov [ssnac.dRi], 2 |
1946 | mov eax, ssnac |
1946 | mov eax, ssnac |
1947 | mov ebx, buff |
1947 | mov ebx, buff |
1948 | xor edx, edx |
1948 | xor edx, edx |
1949 | call sendsnac |
1949 | call sendsnac |
1950 | 1950 | ||
1951 | 1951 | ||
1952 | jmp m_fin |
1952 | jmp m_fin |
1953 | 1953 | ||
1954 | m_snac_2_other: |
1954 | m_snac_2_other: |
1955 | write_debug 'Unknown SNAC Family 2 Recived' |
1955 | write_debug 'Unknown SNAC Family 2 Recived' |
1956 | jmp m_fin |
1956 | jmp m_fin |
1957 | 1957 | ||
1958 | 1958 | ||
1959 | 1959 | ||
1960 | ; |
1960 | ; |
1961 | ; FAMILY 3 |
1961 | ; FAMILY 3 |
1962 | ; |
1962 | ; |
1963 | m_snac_3: |
1963 | m_snac_3: |
1964 | cmp dx, 3 |
1964 | cmp dx, 3 |
1965 | jz m_snac_3_3 |
1965 | jz m_snac_3_3 |
1966 | cmp dx, 0Bh |
1966 | cmp dx, 0Bh |
1967 | jz m_snac_3_b |
1967 | jz m_snac_3_b |
1968 | cmp dx, 0Ch |
1968 | cmp dx, 0Ch |
1969 | jz m_snac_3_c |
1969 | jz m_snac_3_c |
1970 | jmp m_snac_3_other |
1970 | jmp m_snac_3_other |
1971 | 1971 | ||
1972 | ; |
1972 | ; |
1973 | ; Server replies via BLM service limitations |
1973 | ; Server replies via BLM service limitations |
1974 | ; |
1974 | ; |
1975 | m_snac_3_3: |
1975 | m_snac_3_3: |
1976 | ; |
1976 | ; |
1977 | ; ¡à ¡®âª¨ ¯®ª ¥â |
1977 | ; ¡à ¡®âª¨ ¯®ª ¥â |
1978 | ; |
1978 | ; |
1979 | 1979 | ||
1980 | ; |
1980 | ; |
1981 | ; Client ask server for ICBM service parameters |
1981 | ; Client ask server for ICBM service parameters |
1982 | ; |
1982 | ; |
1983 | mov [ssnac.wFid], 4 ; Family |
1983 | mov [ssnac.wFid], 4 ; Family |
1984 | mov [ssnac.wSid], 4 ; Subtype |
1984 | mov [ssnac.wSid], 4 ; Subtype |
1985 | mov [ssnac.dRi], 4 ; request-id |
1985 | mov [ssnac.dRi], 4 ; request-id |
1986 | mov eax, ssnac |
1986 | mov eax, ssnac |
1987 | mov ebx, buff |
1987 | mov ebx, buff |
1988 | xor edx, edx |
1988 | xor edx, edx |
1989 | call sendsnac |
1989 | call sendsnac |
1990 | 1990 | ||
1991 | 1991 | ||
1992 | 1992 | ||
1993 | jmp m_fin |
1993 | jmp m_fin |
1994 | 1994 | ||
1995 | ; |
1995 | ; |
1996 | ; User online notification |
1996 | ; User online notification |
1997 | ; |
1997 | ; |
1998 | m_snac_3_b: |
1998 | m_snac_3_b: |
1999 | ; |
1999 | ; |
2000 | ; § ¢á¥© ¨ä®à¬ 樨 ¯®ª 㦥 ⮫쪮 áâ âãá |
2000 | ; § ¢á¥© ¨ä®à¬ 樨 ¯®ª 㦥 ⮫쪮 áâ âãá |
2001 | ; |
2001 | ; |
2002 | xor edx, edx ; ç¥â稪 |
2002 | xor edx, edx ; ç¥â稪 |
2003 | xor ecx, ecx |
2003 | xor ecx, ecx |
2004 | xor eax, eax |
2004 | xor eax, eax |
2005 | cld ; ¯à ¢«¥¨¨ 㢥«¨ç¥¨ï ¤à¥á®¢ |
2005 | cld ; ¯à ¢«¥¨¨ 㢥«¨ç¥¨ï ¤à¥á®¢ |
2006 | 2006 | ||
2007 | dec edx |
2007 | dec edx |
2008 | m_snac_3_b_loop: |
2008 | m_snac_3_b_loop: |
2009 | inc edx |
2009 | inc edx |
2010 | cmp edx, UINS |
2010 | cmp edx, UINS |
2011 | jnc m_snac_3_b_end ;>= |
2011 | jnc m_snac_3_b_end ;>= |
2012 | 2012 | ||
2013 | mov cl, [mbuff+10] ; Ǭ |
2013 | mov cl, [mbuff+10] ; Ǭ |
2014 | mov eax, ecx |
2014 | mov eax, ecx |
2015 | mov edi, UIN_LEN |
2015 | mov edi, UIN_LEN |
2016 | imul edi ,edx |
2016 | imul edi ,edx |
2017 | lea edi, [uins+edi] |
2017 | lea edi, [uins+edi] |
2018 | lea esi, [mbuff+11] |
2018 | lea esi, [mbuff+11] |
2019 | repe cmpsb |
2019 | repe cmpsb |
2020 | 2020 | ||
2021 | jnz m_snac_3_b_loop |
2021 | jnz m_snac_3_b_loop |
2022 | ; |
2022 | ; |
2023 | ; UIN ¯à¥¤¥«¥ |
2023 | ; UIN ¯à¥¤¥«¥ |
2024 | ; |
2024 | ; |
2025 | 2025 | ||
2026 | lea ecx, [eax+10+11] ; +sizeof SNAC_head + offset #2 TLV |
2026 | lea ecx, [eax+10+11] ; +sizeof SNAC_head + offset #2 TLV |
2027 | mov ax, word [mbuff+ecx] ;#2 TLV.Type |
2027 | mov ax, word [mbuff+ecx] ;#2 TLV.Type |
2028 | cmp ax, 0C00h ;dc info (optional) |
2028 | cmp ax, 0C00h ;dc info (optional) |
2029 | jz m_snac_3_b_dc |
2029 | jz m_snac_3_b_dc |
2030 | cmp ax, 0A00h ;external ip address |
2030 | cmp ax, 0A00h ;external ip address |
2031 | jz m_snac_3_b_extip |
2031 | jz m_snac_3_b_extip |
2032 | jmp m_snac_3_b_bad_tlv |
2032 | jmp m_snac_3_b_bad_tlv |
2033 | 2033 | ||
2034 | 2034 | ||
2035 | m_snac_3_b_dc: |
2035 | m_snac_3_b_dc: |
2036 | ; |
2036 | ; |
2037 | ; யã᪠¥¬ íâ®â TLV |
2037 | ; யã᪠¥¬ íâ®â TLV |
2038 | ; |
2038 | ; |
2039 | lea ecx, [ecx+41] |
2039 | lea ecx, [ecx+41] |
2040 | m_snac_3_b_extip: |
2040 | m_snac_3_b_extip: |
2041 | ; |
2041 | ; |
2042 | ; íâ®â :-) |
2042 | ; íâ®â :-) |
2043 | lea ecx, [ecx+8] |
2043 | lea ecx, [ecx+8] |
2044 | mov ax, word [mbuff+ecx] |
2044 | mov ax, word [mbuff+ecx] |
2045 | cmp ax, 0600h ;TLV.Type(0x0A) - external ip address |
2045 | cmp ax, 0600h ;TLV.Type(0x0A) - external ip address |
2046 | jz m_snac_3_b_status |
2046 | jz m_snac_3_b_status |
2047 | jmp m_snac_3_b_bad_tlv |
2047 | jmp m_snac_3_b_bad_tlv |
2048 | 2048 | ||
2049 | m_snac_3_b_status: |
2049 | m_snac_3_b_status: |
2050 | ; |
2050 | ; |
2051 | ; ª®¥æ-â® áâ âãá 8-) |
2051 | ; ª®¥æ-â® áâ âãá 8-) |
2052 | ; |
2052 | ; |
2053 | mov eax, dword [mbuff+ecx+4] |
2053 | mov eax, dword [mbuff+ecx+4] |
2054 | call ntohl |
2054 | call ntohl |
2055 | ;mov ebx, 4 |
2055 | ;mov ebx, 4 |
2056 | ;imul ebx, edx |
2056 | ;imul ebx, edx |
2057 | ;mov [stats+ebx], eax |
2057 | ;mov [stats+ebx], eax |
2058 | mov ecx, eax |
2058 | mov ecx, eax |
2059 | mov ebx, NAME_LEN |
2059 | mov ebx, NAME_LEN |
2060 | imul ebx, edx |
2060 | imul ebx, edx |
2061 | lea ebx, [names+ebx] |
2061 | lea ebx, [names+ebx] |
2062 | mov eax, edx |
2062 | mov eax, edx |
2063 | call loadbb |
2063 | call loadbb |
2064 | jmp m_fin |
2064 | jmp m_fin |
2065 | 2065 | ||
2066 | 2066 | ||
2067 | m_snac_3_b_bad_tlv: |
2067 | m_snac_3_b_bad_tlv: |
2068 | write_debug 'TLV Type Mismatch in SNAC(3,b)' |
2068 | write_debug 'TLV Type Mismatch in SNAC(3,b)' |
2069 | jmp m_fin |
2069 | jmp m_fin |
2070 | 2070 | ||
2071 | m_snac_3_b_end: |
2071 | m_snac_3_b_end: |
2072 | write_debug 'UIN not in local Contact List' |
2072 | write_debug 'UIN not in local Contact List' |
2073 | jmp m_fin |
2073 | jmp m_fin |
2074 | 2074 | ||
2075 | 2075 | ||
2076 | 2076 | ||
2077 | m_snac_3_c: |
2077 | m_snac_3_c: |
2078 | ; |
2078 | ; |
2079 | ; User offline notification |
2079 | ; User offline notification |
2080 | ; |
2080 | ; |
2081 | xor edx, edx |
2081 | xor edx, edx |
2082 | xor ecx, ecx |
2082 | xor ecx, ecx |
2083 | 2083 | ||
2084 | dec edx |
2084 | dec edx |
2085 | m_snac_3_c_loop: |
2085 | m_snac_3_c_loop: |
2086 | inc edx |
2086 | inc edx |
2087 | cmp edx, UINS |
2087 | cmp edx, UINS |
2088 | jnc m_snac_3_b_end ;>= |
2088 | jnc m_snac_3_b_end ;>= |
2089 | 2089 | ||
2090 | mov cl, [mbuff+10] ; Ǭ |
2090 | mov cl, [mbuff+10] ; Ǭ |
2091 | mov edi, UIN_LEN |
2091 | mov edi, UIN_LEN |
2092 | imul edi ,edx |
2092 | imul edi ,edx |
2093 | lea edi, [uins+edi] |
2093 | lea edi, [uins+edi] |
2094 | lea esi, [mbuff+11] |
2094 | lea esi, [mbuff+11] |
2095 | repe cmpsb |
2095 | repe cmpsb |
2096 | jnz m_snac_3_c_loop |
2096 | jnz m_snac_3_c_loop |
2097 | ; |
2097 | ; |
2098 | ; UIN ¯à¥¤¥«¥ |
2098 | ; UIN ¯à¥¤¥«¥ |
2099 | ; |
2099 | ; |
2100 | ;mov eax, -1 |
2100 | ;mov eax, -1 |
2101 | ;mov ebx, 4 |
2101 | ;mov ebx, 4 |
2102 | ;imul ebx, edx |
2102 | ;imul ebx, edx |
2103 | ;mov [stats+ebx], eax |
2103 | ;mov [stats+ebx], eax |
2104 | mov ecx, -1 |
2104 | mov ecx, -1 |
2105 | mov ebx, NAME_LEN |
2105 | mov ebx, NAME_LEN |
2106 | imul ebx, edx |
2106 | imul ebx, edx |
2107 | lea ebx, [names+ebx] |
2107 | lea ebx, [names+ebx] |
2108 | mov eax, edx |
2108 | mov eax, edx |
2109 | call loadbb |
2109 | call loadbb |
2110 | jmp m_fin |
2110 | jmp m_fin |
2111 | 2111 | ||
2112 | 2112 | ||
2113 | 2113 | ||
2114 | 2114 | ||
2115 | 2115 | ||
2116 | 2116 | ||
2117 | m_snac_3_other: |
2117 | m_snac_3_other: |
2118 | write_debug 'Unknown SNAC Family 3 Recived' |
2118 | write_debug 'Unknown SNAC Family 3 Received' |
2119 | jmp m_fin |
2119 | jmp m_fin |
2120 | 2120 | ||
2121 | 2121 | ||
2122 | ; |
2122 | ; |
2123 | ; FAMILY 4 |
2123 | ; FAMILY 4 |
2124 | ; |
2124 | ; |
2125 | m_snac_4: |
2125 | m_snac_4: |
2126 | cmp dx, 5 |
2126 | cmp dx, 5 |
2127 | jz m_snac_4_5 |
2127 | jz m_snac_4_5 |
2128 | cmp dx, 7 |
2128 | cmp dx, 7 |
2129 | jz m_snac_4_7 |
2129 | jz m_snac_4_7 |
2130 | jmp m_snac_4_other |
2130 | jmp m_snac_4_other |
2131 | 2131 | ||
2132 | ; |
2132 | ; |
2133 | ; Server sends ICBM service parameters to client |
2133 | ; Server sends ICBM service parameters to client |
2134 | ; |
2134 | ; |
2135 | m_snac_4_5: |
2135 | m_snac_4_5: |
2136 | ; |
2136 | ; |
2137 | ; ¡à ¡®âª¨ ¯®ª ¥â |
2137 | ; ¡à ¡®âª¨ ¯®ª ¥â |
2138 | ; |
2138 | ; |
2139 | 2139 | ||
2140 | ; |
2140 | ; |
2141 | ; Client change default ICBM parameters command |
2141 | ; Client change default ICBM parameters command |
2142 | ; |
2142 | ; |
2143 | mov [ssnac.wFid], 4 ; Family |
2143 | mov [ssnac.wFid], 4 ; Family |
2144 | mov [ssnac.wSid], 2 ; Subtype |
2144 | mov [ssnac.wSid], 2 ; Subtype |
2145 | mov [ssnac.dRi], 2 ; request-id |
2145 | mov [ssnac.dRi], 2 ; request-id |
2146 | 2146 | ||
2147 | mov eax, ICBM_PARAMS |
2147 | mov eax, ICBM_PARAMS |
2148 | mov ebx, buff |
2148 | mov ebx, buff |
2149 | push ecx |
2149 | push ecx |
2150 | mov ecx, ICBMP_LEN |
2150 | mov ecx, ICBMP_LEN |
2151 | call strcpy |
2151 | call strcpy |
2152 | pop ecx |
2152 | pop ecx |
2153 | 2153 | ||
2154 | mov eax, ssnac |
2154 | mov eax, ssnac |
2155 | mov ebx, buff |
2155 | mov ebx, buff |
2156 | mov edx, ICBMP_LEN |
2156 | mov edx, ICBMP_LEN |
2157 | call sendsnac |
2157 | call sendsnac |
2158 | 2158 | ||
2159 | ; |
2159 | ; |
2160 | ; Client ask server PRM service limitations |
2160 | ; Client ask server PRM service limitations |
2161 | ; |
2161 | ; |
2162 | mov [ssnac.wFid], 9 ; Family |
2162 | mov [ssnac.wFid], 9 ; Family |
2163 | mov [ssnac.wSid], 2 ; Subtype |
2163 | mov [ssnac.wSid], 2 ; Subtype |
2164 | mov [ssnac.dRi], 2 ; request-id |
2164 | mov [ssnac.dRi], 2 ; request-id |
2165 | mov eax, ssnac |
2165 | mov eax, ssnac |
2166 | mov ebx, buff |
2166 | mov ebx, buff |
2167 | xor edx, edx |
2167 | xor edx, edx |
2168 | call sendsnac |
2168 | call sendsnac |
2169 | 2169 | ||
2170 | 2170 | ||
2171 | jmp m_fin |
2171 | jmp m_fin |
2172 | 2172 | ||
2173 | ; |
2173 | ; |
2174 | ; Message for client from server |
2174 | ; Message for client from server |
2175 | ; |
2175 | ; |
2176 | m_snac_4_7: |
2176 | m_snac_4_7: |
2177 | ; |
2177 | ; |
2178 | ; ¯à¥¤¥«ï¥¬ ⨯ á®®¡é¥¨ï ¯® ¯®«î message channel |
2178 | ; ¯à¥¤¥«ï¥¬ ⨯ á®®¡é¥¨ï ¯® ¯®«î message channel |
2179 | ; |
2179 | ; |
2180 | xor eax, eax |
2180 | xor eax, eax |
2181 | mov ax, word [mbuff+10+8] ; +10 - à §¬¥à SNAC |
2181 | mov ax, word [mbuff+10+8] ; +10 - à §¬¥à SNAC |
2182 | ; +8 ᬥ饨¥ ¤® message channel |
2182 | ; +8 ᬥ饨¥ ¤® message channel |
2183 | cmp ax, 0100h ; 00 01 |
2183 | cmp ax, 0100h ; 00 01 |
2184 | jz m_snac_ch1 |
2184 | jz m_snac_ch1 |
2185 | cmp ax, 0200h |
2185 | cmp ax, 0200h |
2186 | jz m_snac_ch2 |
2186 | jz m_snac_ch2 |
2187 | cmp ax, 0400h |
2187 | cmp ax, 0400h |
2188 | jz m_snac_ch4 |
2188 | jz m_snac_ch4 |
2189 | jmp m_ch_other |
2189 | jmp m_ch_other |
2190 | ; |
2190 | ; |
2191 | ; channel 1 plain text |
2191 | ; channel 1 plain text |
2192 | ; |
2192 | ; |
2193 | m_snac_ch1: |
2193 | m_snac_ch1: |
2194 | ; |
2194 | ; |
2195 | ; .ª ¢ ®ç¥à¥¤®© à § ®¯¨á ¨¥ ¯à®â®ª®« ¥ ᮢ¯ ¤ ¥â á ॠ«ì®áâìî |
2195 | ; .ª ¢ ®ç¥à¥¤®© à § ®¯¨á ¨¥ ¯à®â®ª®« ¥ ᮢ¯ ¤ ¥â á ॠ«ì®áâìî |
2196 | ; à §¡¨à ¥¬ ¢á¥ TLV ¯® ¯®à浪ã |
2196 | ; à §¡¨à ¥¬ ¢á¥ TLV ¯® ¯®à浪ã |
2197 | 2197 | ||
2198 | mov eax, dword [mbuff+10] ; cookie |
2198 | mov eax, dword [mbuff+10] ; cookie |
2199 | mov [msg_cookie1], eax |
2199 | mov [msg_cookie1], eax |
2200 | mov eax, dword [mbuff+10+4] |
2200 | mov eax, dword [mbuff+10+4] |
2201 | mov [msg_cookie2], eax ; ᯮ«ì§ãîâáï ¤«ï ¯®â¢¥à¦¤¥¨ï ¯à¨¥¬ á®®¡é¥¨© |
2201 | mov [msg_cookie2], eax ; ᯮ«ì§ãîâáï ¤«ï ¯®â¢¥à¦¤¥¨ï ¯à¨¥¬ á®®¡é¥¨© |
2202 | 2202 | ||
2203 | mov al, [mbuff+10+10] ; Sender UIN length |
2203 | mov al, [mbuff+10+10] ; Sender UIN length |
2204 | mov [ui.bUinLength], al |
2204 | mov [ui.bUinLength], al |
2205 | 2205 | ||
2206 | push ecx |
2206 | push ecx |
2207 | movzx ecx, al |
2207 | movzx ecx, al |
2208 | 2208 | ||
2209 | lea eax, [mbuff+10+11] ; UIN string |
2209 | lea eax, [mbuff+10+11] ; UIN string |
2210 | lea ebx, [ui.bUin] ; Dest |
2210 | lea ebx, [ui.bUin] ; Dest |
2211 | call strcpy |
2211 | call strcpy |
2212 | 2212 | ||
2213 | lea ecx, [ecx+10+15] ; ¯¥à¢ë© TLV |
2213 | lea ecx, [ecx+10+15] ; ¯¥à¢ë© TLV |
2214 | 2214 | ||
2215 | 2215 | ||
2216 | m_snac_ch1_loop: |
2216 | m_snac_ch1_loop: |
2217 | 2217 | ||
2218 | movzx eax, word [mbuff+ecx] |
2218 | movzx eax, word [mbuff+ecx] |
2219 | cmp eax, 0100h ;TLV.Type(0x01) - user class |
2219 | cmp eax, 0100h ;TLV.Type(0x01) - user class |
2220 | jz m_snac_ch1_1 |
2220 | jz m_snac_ch1_1 |
2221 | cmp eax, 0600h ;TLV.Type(0x06) - user status |
2221 | cmp eax, 0600h ;TLV.Type(0x06) - user status |
2222 | jz m_snac_ch1_6 |
2222 | jz m_snac_ch1_6 |
2223 | cmp eax, 0800h ; Unknown type |
2223 | cmp eax, 0800h ; Unknown type |
2224 | jz m_snac_ch1_8 |
2224 | jz m_snac_ch1_8 |
2225 | cmp eax, 0500h ; Unknown type |
2225 | cmp eax, 0500h ; Unknown type |
2226 | jz m_snac_ch1_5 |
2226 | jz m_snac_ch1_5 |
2227 | cmp eax, 0F00h ; TLV.Type(0x0f) - user idle time |
2227 | cmp eax, 0F00h ; TLV.Type(0x0f) - user idle time |
2228 | jz m_snac_ch1_f |
2228 | jz m_snac_ch1_f |
2229 | cmp eax, 0300h ; TLV.Type(0x03) - account creation time |
2229 | cmp eax, 0300h ; TLV.Type(0x03) - account creation time |
2230 | jz m_snac_ch1_3 |
2230 | jz m_snac_ch1_3 |
2231 | cmp eax, 0400h ; TLV.Type(0x04) - automated response flag |
2231 | cmp eax, 0400h ; TLV.Type(0x04) - automated response flag |
2232 | jz m_snac_ch1_4 |
2232 | jz m_snac_ch1_4 |
2233 | cmp eax, 0200h ; TLV.Type(0x02) - message data |
2233 | cmp eax, 0200h ; TLV.Type(0x02) - message data |
2234 | jz m_snac_ch1_mess |
2234 | jz m_snac_ch1_mess |
2235 | jmp m_snac_msg_tlv_err |
2235 | jmp m_snac_msg_tlv_err |
2236 | 2236 | ||
2237 | ; |
2237 | ; |
2238 | ; ®§¬®¦®, ¤®¯®«¨â¥«ì ï ¨¨ä®à¬ æ¨ï ¡ã¤¥â ®¡à ¡ âë¢ âìáï |
2238 | ; ®§¬®¦®, ¤®¯®«¨â¥«ì ï ¨¨ä®à¬ æ¨ï ¡ã¤¥â ®¡à ¡ âë¢ âìáï |
2239 | ; ® ¯®ª ¥â |
2239 | ; ® ¯®ª ¥â |
2240 | 2240 | ||
2241 | m_snac_ch1_1: |
2241 | m_snac_ch1_1: |
2242 | movzx eax, word [mbuff+ecx+2] ; TLV.Length |
2242 | movzx eax, word [mbuff+ecx+2] ; TLV.Length |
2243 | call ntohs |
2243 | call ntohs |
2244 | lea ecx, [eax+ecx+4] |
2244 | lea ecx, [eax+ecx+4] |
2245 | jmp m_snac_ch1_loop |
2245 | jmp m_snac_ch1_loop |
2246 | 2246 | ||
2247 | m_snac_ch1_6: |
2247 | m_snac_ch1_6: |
2248 | 2248 | ||
2249 | mov eax, dword [mbuff+ecx+4] ; User status |
2249 | mov eax, dword [mbuff+ecx+4] ; User status |
2250 | call ntohl |
2250 | call ntohl |
2251 | mov [ui.dUserStatus], eax |
2251 | mov [ui.dUserStatus], eax |
2252 | 2252 | ||
2253 | 2253 | ||
2254 | movzx eax, word [mbuff+ecx+2] ; TLV.Length |
2254 | movzx eax, word [mbuff+ecx+2] ; TLV.Length |
2255 | call ntohs |
2255 | call ntohs |
2256 | lea ecx, [eax+ecx+4] |
2256 | lea ecx, [eax+ecx+4] |
2257 | ; |
2257 | ; |
2258 | ; |
2258 | ; |
2259 | 2259 | ||
2260 | 2260 | ||
2261 | jmp m_snac_ch1_loop |
2261 | jmp m_snac_ch1_loop |
2262 | 2262 | ||
2263 | m_snac_ch1_8: |
2263 | m_snac_ch1_8: |
2264 | movzx eax, word [mbuff+ecx+2] ; TLV.Length |
2264 | movzx eax, word [mbuff+ecx+2] ; TLV.Length |
2265 | call ntohs |
2265 | call ntohs |
2266 | lea ecx, [eax+ecx+4] |
2266 | lea ecx, [eax+ecx+4] |
2267 | jmp m_snac_ch1_loop |
2267 | jmp m_snac_ch1_loop |
2268 | 2268 | ||
2269 | m_snac_ch1_5: |
2269 | m_snac_ch1_5: |
2270 | movzx eax, word [mbuff+ecx+2] ; TLV.Length |
2270 | movzx eax, word [mbuff+ecx+2] ; TLV.Length |
2271 | call ntohs |
2271 | call ntohs |
2272 | lea ecx, [eax+ecx+4] |
2272 | lea ecx, [eax+ecx+4] |
2273 | jmp m_snac_ch1_loop |
2273 | jmp m_snac_ch1_loop |
2274 | 2274 | ||
2275 | m_snac_ch1_f: |
2275 | m_snac_ch1_f: |
2276 | movzx eax, word [mbuff+ecx+2] ; TLV.Length |
2276 | movzx eax, word [mbuff+ecx+2] ; TLV.Length |
2277 | call ntohs |
2277 | call ntohs |
2278 | lea ecx, [eax+ecx+4] |
2278 | lea ecx, [eax+ecx+4] |
2279 | jmp m_snac_ch1_loop |
2279 | jmp m_snac_ch1_loop |
2280 | 2280 | ||
2281 | m_snac_ch1_3: |
2281 | m_snac_ch1_3: |
2282 | movzx eax, word [mbuff+ecx+2] ; TLV.Length |
2282 | movzx eax, word [mbuff+ecx+2] ; TLV.Length |
2283 | call ntohs |
2283 | call ntohs |
2284 | lea ecx, [eax+ecx+4] |
2284 | lea ecx, [eax+ecx+4] |
2285 | jmp m_snac_ch1_loop |
2285 | jmp m_snac_ch1_loop |
2286 | 2286 | ||
2287 | 2287 | ||
2288 | m_snac_ch1_4: |
2288 | m_snac_ch1_4: |
2289 | ;movzx eax, word [buff+ecx+2] ; TLV.Length |
2289 | ;movzx eax, word [buff+ecx+2] ; TLV.Length |
2290 | lea ecx, [ecx+4] |
2290 | lea ecx, [ecx+4] |
2291 | jmp m_snac_ch1_loop |
2291 | jmp m_snac_ch1_loop |
2292 | 2292 | ||
2293 | 2293 | ||
2294 | 2294 | ||
2295 | m_snac_ch1_mess: |
2295 | m_snac_ch1_mess: |
2296 | ; |
2296 | ; |
2297 | ; |
2297 | ; |
2298 | movzx eax, word [mbuff+ecx+4] ; |
2298 | movzx eax, word [mbuff+ecx+4] ; |
2299 | cmp eax, 0105h ; 05 fragment identifier (array of required capabilities) |
2299 | cmp eax, 0105h ; 05 fragment identifier (array of required capabilities) |
2300 | jnz m_snac_ch1_fr_err ; 01 fragment version |
2300 | jnz m_snac_ch1_fr_err ; 01 fragment version |
2301 | 2301 | ||
2302 | movzx eax, word [mbuff+ecx+6] ; Length |
2302 | movzx eax, word [mbuff+ecx+6] ; Length |
2303 | call ntohs |
2303 | call ntohs |
2304 | 2304 | ||
2305 | lea ecx, [ecx+eax+8] ; யã᪠¥¬ byte array of required capabilities (1 - text) |
2305 | lea ecx, [ecx+eax+8] ; யã᪠¥¬ byte array of required capabilities (1 - text) |
2306 | 2306 | ||
2307 | movzx eax, word [mbuff+ecx] ; fragment identifier (message text) |
2307 | movzx eax, word [mbuff+ecx] ; fragment identifier (message text) |
2308 | cmp eax, 0101h ; fragment version |
2308 | cmp eax, 0101h ; fragment version |
2309 | jnz m_snac_ch1_fr_err |
2309 | jnz m_snac_ch1_fr_err |
2310 | 2310 | ||
2311 | movzx eax, word [mbuff+ecx+2] ; TLV Length |
2311 | movzx eax, word [mbuff+ecx+2] ; TLV Length |
2312 | call ntohs |
2312 | call ntohs |
2313 | xchg eax, ecx |
2313 | xchg eax, ecx |
2314 | 2314 | ||
2315 | lea eax, [eax+8] ; ç «® ⥪á⮢®£® á®®¡é¥¨ï |
2315 | lea eax, [eax+8] ; ç «® ⥪á⮢®£® á®®¡é¥¨ï |
2316 | lea ecx, [ecx-4] ; - sizeof Message charset number, Message charset subset |
2316 | lea ecx, [ecx-4] ; - sizeof Message charset number, Message charset subset |
2317 | 2317 | ||
2318 | push eax |
2318 | push eax |
2319 | push ecx |
2319 | push ecx |
2320 | 2320 | ||
2321 | ; |
2321 | ; |
2322 | ; 뢮¤¨¬ Message From UIN |
2322 | ; 뢮¤¨¬ Message From UIN |
2323 | ; |
2323 | ; |
2324 | 2324 | ||
2325 | mov eax, MESS |
2325 | mov eax, MESS |
2326 | call strlen |
2326 | call strlen |
2327 | mov ecx, eax |
2327 | mov ecx, eax |
2328 | 2328 | ||
2329 | mov eax, MESS |
2329 | mov eax, MESS |
2330 | mov ebx, buff |
2330 | mov ebx, buff |
2331 | call strcpy |
2331 | call strcpy |
2332 | 2332 | ||
2333 | lea ebx, [ebx+ecx] |
2333 | lea ebx, [ebx+ecx] |
2334 | lea eax, [ui.bUin] |
2334 | lea eax, [ui.bUin] |
2335 | movzx ecx, byte [ui.bUinLength] |
2335 | movzx ecx, byte [ui.bUinLength] |
2336 | call strcpy |
2336 | call strcpy |
2337 | 2337 | ||
2338 | mov [ebx+ecx], byte 0 |
2338 | mov [ebx+ecx], byte 0 |
2339 | 2339 | ||
2340 | mov eax, buff |
2340 | mov eax, buff |
2341 | xor ebx, ebx |
2341 | xor ebx, ebx |
2342 | 2342 | ||
2343 | call writemsg |
2343 | call writemsg |
2344 | ; |
2344 | ; |
2345 | ; ¬® á®®¡é¥¨¥ |
2345 | ; ¬® á®®¡é¥¨¥ |
2346 | ; |
2346 | ; |
2347 | 2347 | ||
2348 | pop ecx |
2348 | pop ecx |
2349 | pop eax |
2349 | pop eax |
2350 | lea eax, [mbuff+eax] |
2350 | lea eax, [mbuff+eax] |
2351 | 2351 | ||
2352 | mov ebx, buff |
2352 | mov ebx, buff |
2353 | call strcpy |
2353 | call strcpy |
2354 | mov [ebx+ecx], byte 0 |
2354 | mov [ebx+ecx], byte 0 |
2355 | 2355 | ||
2356 | mov eax, buff |
2356 | mov eax, buff |
2357 | call win2dos |
2357 | call win2dos |
2358 | mov ebx, 00FF0000h |
2358 | mov ebx, 00FF0000h |
2359 | call writemsg |
2359 | call writemsg |
2360 | 2360 | ||
2361 | ; |
2361 | ; |
2362 | ; ®¤â¢¥à¦¤ ¥¬ ¯à¨¥¬ |
2362 | ; ®¤â¢¥à¦¤ ¥¬ ¯à¨¥¬ |
2363 | ; |
2363 | ; |
2364 | 2364 | ||
2365 | pop ecx |
2365 | pop ecx |
2366 | ; |
2366 | ; |
2367 | ; ®ª ¥ ॠ«¨§®¢ ®, â.ª. ¥ ¬®£ã ©â¨ ª«¨¥â, ª®â®àë© íâ® ¨á¯®«ì§ã¥â :-) |
2367 | ; ®ª ¥ ॠ«¨§®¢ ®, â.ª. ¥ ¬®£ã ©â¨ ª«¨¥â, ª®â®àë© íâ® ¨á¯®«ì§ã¥â :-) |
2368 | ; |
2368 | ; |
2369 | 2369 | ||
2370 | jmp m_fin |
2370 | jmp m_fin |
2371 | 2371 | ||
2372 | m_snac_msg_tlv_err: |
2372 | m_snac_msg_tlv_err: |
2373 | write_debug 'TLV TYPE MISMATCH' |
2373 | write_debug 'TLV TYPE MISMATCH' |
2374 | pop ecx |
2374 | pop ecx |
2375 | jmp m_fin |
2375 | jmp m_fin |
2376 | 2376 | ||
2377 | m_snac_ch1_fr_err: |
2377 | m_snac_ch1_fr_err: |
2378 | write_debug 'UNKNOWN FRAGMENT IDENTIFIER OR FRAGMENT VERSION' |
2378 | write_debug 'UNKNOWN FRAGMENT IDENTIFIER OR FRAGMENT VERSION' |
2379 | 2379 | ||
2380 | ;m_snac_ch1_end: |
2380 | ;m_snac_ch1_end: |
2381 | pop ecx |
2381 | pop ecx |
2382 | 2382 | ||
2383 | jmp m_fin |
2383 | jmp m_fin |
2384 | 2384 | ||
2385 | ; |
2385 | ; |
2386 | ; Channel 2 message format (rtf messages, rendezvous) |
2386 | ; Channel 2 message format (rtf messages, rendezvous) |
2387 | ; |
2387 | ; |
2388 | m_snac_ch2: |
2388 | m_snac_ch2: |
2389 | ; |
2389 | ; |
2390 | ; ®â¯à ¢¨¬ á®®¡é¥¨¥, çâ® ª « ¥ ¯®¤¤¥à¦¨¢ ¥âáï |
2390 | ; ®â¯à ¢¨¬ á®®¡é¥¨¥, çâ® ª « ¥ ¯®¤¤¥à¦¨¢ ¥âáï |
2391 | ; ã¦ë ªãª¨ ¨ 㨠|
2391 | ; ã¦ë ªãª¨ ¨ 㨠|
2392 | mov eax, dword [mbuff+10] |
2392 | mov eax, dword [mbuff+10] |
2393 | mov [msg_cookie1], eax |
2393 | mov [msg_cookie1], eax |
2394 | mov eax, dword [mbuff+10+4] |
2394 | mov eax, dword [mbuff+10+4] |
2395 | mov [msg_cookie2], eax |
2395 | mov [msg_cookie2], eax |
2396 | 2396 | ||
2397 | mov al, [mbuff+10+10] ; Sender UIN length |
2397 | mov al, [mbuff+10+10] ; Sender UIN length |
2398 | mov [ui.bUinLength], al |
2398 | mov [ui.bUinLength], al |
2399 | 2399 | ||
2400 | push ecx |
2400 | push ecx |
2401 | movzx ecx, al |
2401 | movzx ecx, al |
2402 | 2402 | ||
2403 | lea eax, [mbuff+10+11] ; UIN string |
2403 | lea eax, [mbuff+10+11] ; UIN string |
2404 | lea ebx, [ui.bUin] ; Dest |
2404 | lea ebx, [ui.bUin] ; Dest |
2405 | call strcpy |
2405 | call strcpy |
2406 | 2406 | ||
2407 | 2407 | ||
2408 | mov [ssnac.wFid], 4 ; Family |
2408 | mov [ssnac.wFid], 4 ; Family |
2409 | mov [ssnac.wSid], 0Bh ; Subtype |
2409 | mov [ssnac.wSid], 0Bh ; Subtype |
2410 | mov [ssnac.dRi], 0Bh |
2410 | mov [ssnac.dRi], 0Bh |
2411 | 2411 | ||
2412 | mov eax, [msg_cookie1] |
2412 | mov eax, [msg_cookie1] |
2413 | mov dword [buff], eax |
2413 | mov dword [buff], eax |
2414 | mov eax, [msg_cookie2] |
2414 | mov eax, [msg_cookie2] |
2415 | mov dword [buff+4], eax |
2415 | mov dword [buff+4], eax |
2416 | mov word [buff+8], 0200h ; Channel 2 |
2416 | mov word [buff+8], 0200h ; Channel 2 |
2417 | 2417 | ||
2418 | mov al, [ui.bUinLength] |
2418 | mov al, [ui.bUinLength] |
2419 | mov [buff+10], al |
2419 | mov [buff+10], al |
2420 | lea eax, [ui.bUin] |
2420 | lea eax, [ui.bUin] |
2421 | lea ebx, [buff+11] |
2421 | lea ebx, [buff+11] |
2422 | call strcpy |
2422 | call strcpy |
2423 | lea ecx, [ecx+11] |
2423 | lea ecx, [ecx+11] |
2424 | 2424 | ||
2425 | mov word [buff+ecx], 0100h ; reason code (1 - unsupported channel, 2 - busted payload, 3 - channel specific) |
2425 | mov word [buff+ecx], 0100h ; reason code (1 - unsupported channel, 2 - busted payload, 3 - channel specific) |
2426 | mov edx, ecx |
2426 | mov edx, ecx |
2427 | 2427 | ||
2428 | pop ecx |
2428 | pop ecx |
2429 | mov eax, ssnac |
2429 | mov eax, ssnac |
2430 | mov ebx, buff |
2430 | mov ebx, buff |
2431 | call sendsnac |
2431 | call sendsnac |
2432 | 2432 | ||
2433 | 2433 | ||
2434 | jmp m_fin |
2434 | jmp m_fin |
2435 | 2435 | ||
2436 | ; |
2436 | ; |
2437 | ; Channel 4 message format (typed old-style messages) |
2437 | ; Channel 4 message format (typed old-style messages) |
2438 | ; |
2438 | ; |
2439 | m_snac_ch4: |
2439 | m_snac_ch4: |
2440 | 2440 | ||
2441 | 2441 | ||
2442 | 2442 | ||
2443 | m_ch_other: |
2443 | m_ch_other: |
2444 | write_debug 'Unknown message channel' |
2444 | write_debug 'Unknown message channel' |
2445 | 2445 | ||
2446 | jmp m_fin |
2446 | jmp m_fin |
2447 | 2447 | ||
2448 | 2448 | ||
2449 | m_snac_4_other: |
2449 | m_snac_4_other: |
2450 | write_debug 'Unknown SNAC Family 4 recived' |
2450 | write_debug 'Unknown SNAC Family 4 received' |
2451 | jmp m_fin |
2451 | jmp m_fin |
2452 | 2452 | ||
2453 | 2453 | ||
2454 | 2454 | ||
2455 | ; |
2455 | ; |
2456 | ; FAMILY 9 |
2456 | ; FAMILY 9 |
2457 | ; |
2457 | ; |
2458 | m_snac_9: |
2458 | m_snac_9: |
2459 | cmp dx, 3 |
2459 | cmp dx, 3 |
2460 | jz m_snac_9_3 |
2460 | jz m_snac_9_3 |
2461 | jmp m_snac_9_other |
2461 | jmp m_snac_9_other |
2462 | 2462 | ||
2463 | ; |
2463 | ; |
2464 | ; Server sends PRM service limitations to client |
2464 | ; Server sends PRM service limitations to client |
2465 | ; |
2465 | ; |
2466 | m_snac_9_3: |
2466 | m_snac_9_3: |
2467 | ; |
2467 | ; |
2468 | ; ¡à ¡®âª¨ ¯®ª ¥â |
2468 | ; ¡à ¡®âª¨ ¯®ª ¥â |
2469 | ; |
2469 | ; |
2470 | 2470 | ||
2471 | 2471 | ||
2472 | ; ⪫î祮, ⪠¥ ¯®¤¤¥à¦¨¢ ¥âáï SIQ |
2472 | ; ⪫î祮, ⪠¥ ¯®¤¤¥à¦¨¢ ¥âáï SIQ |
2473 | ; |
2473 | ; |
2474 | 2474 | ||
2475 | ; |
2475 | ; |
2476 | ; Client ask server for SSI service limitations |
2476 | ; Client ask server for SSI service limitations |
2477 | ; |
2477 | ; |
2478 | ;mov [ssnac.wFid], 13h ; Family |
2478 | ;mov [ssnac.wFid], 13h ; Family |
2479 | ;mov [ssnac.wSid], 2 ; Subtype |
2479 | ;mov [ssnac.wSid], 2 ; Subtype |
2480 | ;mov [ssnac.dRi], 2 ; request-id |
2480 | ;mov [ssnac.dRi], 2 ; request-id |
2481 | ;mov eax, ssnac |
2481 | ;mov eax, ssnac |
2482 | ;mov ebx, buff |
2482 | ;mov ebx, buff |
2483 | ;xor edx, edx |
2483 | ;xor edx, edx |
2484 | ;call sendsnac |
2484 | ;call sendsnac |
2485 | 2485 | ||
2486 | ; |
2486 | ; |
2487 | ; ¯®á«¥¤ïï áâ ¤¨ï ᮥ¤¨¥¨ï |
2487 | ; ¯®á«¥¤ïï áâ ¤¨ï ᮥ¤¨¥¨ï |
2488 | ; |
2488 | ; |
2489 | 2489 | ||
2490 | ; |
2490 | ; |
2491 | ; ¯à 訢 ¥¬ á¢®î ¨ä®à¬ æ¨î |
2491 | ; ¯à 訢 ¥¬ á¢®î ¨ä®à¬ æ¨î |
2492 | ; |
2492 | ; |
2493 | mov [ssnac.wFid], 1 ; Family |
2493 | mov [ssnac.wFid], 1 ; Family |
2494 | mov [ssnac.wSid], 0Eh ; Subtype |
2494 | mov [ssnac.wSid], 0Eh ; Subtype |
2495 | mov [ssnac.dRi], 0Eh ; request-id |
2495 | mov [ssnac.dRi], 0Eh ; request-id |
2496 | 2496 | ||
2497 | mov eax, ssnac |
2497 | mov eax, ssnac |
2498 | mov ebx, buff |
2498 | mov ebx, buff |
2499 | xor edx, edx ; TLV head len |
2499 | xor edx, edx ; TLV head len |
2500 | call sendsnac |
2500 | call sendsnac |
2501 | 2501 | ||
2502 | 2502 | ||
2503 | ; |
2503 | ; |
2504 | ; Client sends its DC info and status to server |
2504 | ; Client sends its DC info and status to server |
2505 | ; |
2505 | ; |
2506 | mov [ssnac.wFid], 1 ; Family |
2506 | mov [ssnac.wFid], 1 ; Family |
2507 | mov [ssnac.wSid], 1Eh ; Subtype |
2507 | mov [ssnac.wSid], 1Eh ; Subtype |
2508 | mov [ssnac.dRi], 1Eh ; request-id |
2508 | mov [ssnac.dRi], 1Eh ; request-id |
2509 | 2509 | ||
2510 | mov [buff], 0 ; TLV type 06 |
2510 | mov [buff], 0 ; TLV type 06 |
2511 | mov [buff+1], 6h ; |
2511 | mov [buff+1], 6h ; |
2512 | mov [buff+2], 0 ; TLV data length |
2512 | mov [buff+2], 0 ; TLV data length |
2513 | mov [buff+3], 4 ; |
2513 | mov [buff+3], 4 ; |
2514 | ; |
2514 | ; |
2515 | ; |
2515 | ; |
2516 | mov ax, STATUS_DCDISABLED ; DC disabled |
2516 | mov ax, STATUS_DCDISABLED ; DC disabled |
2517 | call htons |
2517 | call htons |
2518 | mov word [buff+4], ax |
2518 | mov word [buff+4], ax |
2519 | mov ax, STATUS_ONLINE |
2519 | mov ax, STATUS_ONLINE |
2520 | mov [status], ax |
2520 | mov [status], ax |
2521 | mov word [buff+6], ax |
2521 | mov word [buff+6], ax |
2522 | 2522 | ||
2523 | mov eax, ssnac |
2523 | mov eax, ssnac |
2524 | mov ebx, buff |
2524 | mov ebx, buff |
2525 | mov edx, 8 ; TLV head len+ data len |
2525 | mov edx, 8 ; TLV head len+ data len |
2526 | call sendsnac |
2526 | call sendsnac |
2527 | 2527 | ||
2528 | 2528 | ||
2529 | ; |
2529 | ; |
2530 | ; ë£à㦠¥¬ á¥à¢¥à |
2530 | ; ë£à㦠¥¬ á¥à¢¥à |
2531 | ; |
2531 | ; |
2532 | call uploadkl |
2532 | call uploadkl |
2533 | 2533 | ||
2534 | ; |
2534 | ; |
2535 | ; ë£à㦠¥¬ ¨¢¨§¨¡« «¨áâ, ¯®ª ¯ãá⮩ |
2535 | ; ë£à㦠¥¬ ¨¢¨§¨¡« «¨áâ, ¯®ª ¯ãá⮩ |
2536 | ; |
2536 | ; |
2537 | mov [ssnac.wFid], 9 ; Family |
2537 | mov [ssnac.wFid], 9 ; Family |
2538 | mov [ssnac.wSid], 7 ; Subtype |
2538 | mov [ssnac.wSid], 7 ; Subtype |
2539 | mov [ssnac.dRi], 7 |
2539 | mov [ssnac.dRi], 7 |
2540 | 2540 | ||
2541 | mov eax, ssnac |
2541 | mov eax, ssnac |
2542 | mov ebx, buff |
2542 | mov ebx, buff |
2543 | xor edx, edx |
2543 | xor edx, edx |
2544 | call sendsnac |
2544 | call sendsnac |
2545 | 2545 | ||
2546 | ; |
2546 | ; |
2547 | ; &RQ áâì ¯ ª¥â ãáâ ®¢ª¨ à §à¥è¥¨©. ï ¨á¯®«ì§ãî ¥£® ¡¥§ ¨§¬¥¥¨ï |
2547 | ; &RQ áâì ¯ ª¥â ãáâ ®¢ª¨ à §à¥è¥¨©. ï ¨á¯®«ì§ãî ¥£® ¡¥§ ¨§¬¥¥¨ï |
2548 | ; â.ª. ¥ § î, çâ® ® ᮤ¥à¦¨â |
2548 | ; â.ª. ¥ § î, çâ® ® ᮤ¥à¦¨â |
2549 | ; |
2549 | ; |
2550 | 2550 | ||
2551 | mov [ssnac.wFid], 15 ; Family |
2551 | mov [ssnac.wFid], 15 ; Family |
2552 | mov [ssnac.wSid], 2 ; Subtype |
2552 | mov [ssnac.wSid], 2 ; Subtype |
2553 | mov [ssnac.dRi], 2 |
2553 | mov [ssnac.dRi], 2 |
2554 | 2554 | ||
2555 | mov word [buff], 0100h ; 00 01 encapsulated META_DATA |
2555 | mov word [buff], 0100h ; 00 01 encapsulated META_DATA |
2556 | mov word [buff+2], 1000h ; 00 10 Len |
2556 | mov word [buff+2], 1000h ; 00 10 Len |
2557 | mov word [buff+4], 000Eh ; LE Len |
2557 | mov word [buff+4], 000Eh ; LE Len |
2558 | mov word [buff+10], 07D0h ; META_DATA_REQ |
2558 | mov word [buff+10], 07D0h ; META_DATA_REQ |
2559 | 2559 | ||
2560 | 2560 | ||
2561 | mov eax, UIN |
2561 | mov eax, UIN |
2562 | call ascitoint |
2562 | call ascitoint |
2563 | mov dword [buff+6], eax |
2563 | mov dword [buff+6], eax |
2564 | 2564 | ||
2565 | mov word [buff+12], 0102h ; request sequence number (incrementing) |
2565 | mov word [buff+12], 0102h ; request sequence number (incrementing) |
2566 | mov word [buff+14], 0424h ; META_SET_PERMS_USERINFO |
2566 | mov word [buff+14], 0424h ; META_SET_PERMS_USERINFO |
2567 | mov [buff+16], 1 ; authorization (1-required, 0-not required) |
2567 | mov [buff+16], 1 ; authorization (1-required, 0-not required) |
2568 | mov [buff+17], byte 0 ; webaware (0-no, 1-yes) |
2568 | mov [buff+17], byte 0 ; webaware (0-no, 1-yes) |
2569 | mov [buff+18], 1 ; dc_perms (0-any, 1-contact, 2-authorization) |
2569 | mov [buff+18], 1 ; dc_perms (0-any, 1-contact, 2-authorization) |
2570 | mov [buff+19], 0 ;unknown |
2570 | mov [buff+19], 0 ;unknown |
2571 | 2571 | ||
2572 | mov eax, ssnac |
2572 | mov eax, ssnac |
2573 | mov ebx, buff |
2573 | mov ebx, buff |
2574 | mov edx, 20 |
2574 | mov edx, 20 |
2575 | 2575 | ||
2576 | 2576 | ||
2577 | ; |
2577 | ; |
2578 | ; Client READY command |
2578 | ; Client READY command |
2579 | ; |
2579 | ; |
2580 | mov [ssnac.wFid], 1 ; Family |
2580 | mov [ssnac.wFid], 1 ; Family |
2581 | mov [ssnac.wSid], 2 ; Subtype |
2581 | mov [ssnac.wSid], 2 ; Subtype |
2582 | mov [ssnac.dRi], 2 ; request-id |
2582 | mov [ssnac.dRi], 2 ; request-id |
2583 | 2583 | ||
2584 | mov eax, FAMILY_ARR |
2584 | mov eax, FAMILY_ARR |
2585 | mov ebx, buff |
2585 | mov ebx, buff |
2586 | push ecx |
2586 | push ecx |
2587 | mov ecx, FA_LEN |
2587 | mov ecx, FA_LEN |
2588 | call strcpy |
2588 | call strcpy |
2589 | pop ecx |
2589 | pop ecx |
2590 | 2590 | ||
2591 | mov eax, ssnac |
2591 | mov eax, ssnac |
2592 | mov ebx, buff |
2592 | mov ebx, buff |
2593 | mov edx, FA_LEN |
2593 | mov edx, FA_LEN |
2594 | call sendsnac |
2594 | call sendsnac |
2595 | 2595 | ||
2596 | 2596 | ||
2597 | ; |
2597 | ; |
2598 | ; ¯à 訢 ¥¬ offline á®®¡é¥¨ï |
2598 | ; ¯à 訢 ¥¬ offline á®®¡é¥¨ï |
2599 | ; |
2599 | ; |
2600 | mov [ssnac.wFid], 15h ; Family |
2600 | mov [ssnac.wFid], 15h ; Family |
2601 | mov [ssnac.wSid], 2 ; Subtype |
2601 | mov [ssnac.wSid], 2 ; Subtype |
2602 | mov [ssnac.dRi], 2 ; request-id |
2602 | mov [ssnac.dRi], 2 ; request-id |
2603 | 2603 | ||
2604 | mov word [buff], 0100h ; TLV type 01 |
2604 | mov word [buff], 0100h ; TLV type 01 |
2605 | mov word [buff+2], 0A00h ; 00 0a Ǭ |
2605 | mov word [buff+2], 0A00h ; 00 0a Ǭ |
2606 | mov word [buff+4], 0008h ; 08 00 |
2606 | mov word [buff+4], 0008h ; 08 00 |
2607 | mov eax, UIN |
2607 | mov eax, UIN |
2608 | call ascitoint |
2608 | call ascitoint |
2609 | mov dword [buff+6], eax |
2609 | mov dword [buff+6], eax |
2610 | 2610 | ||
2611 | mov [buff+10], 003Ch ; 3C 00 - ¯à®á ®ää« ©®¢ë¥ á®®¡é¥¨ï |
2611 | mov [buff+10], 003Ch ; 3C 00 - ¯à®á ®ää« ©®¢ë¥ á®®¡é¥¨ï |
2612 | mov [buff+12], 0002 ; 02 00 - request sequence number |
2612 | mov [buff+12], 0002 ; 02 00 - request sequence number |
2613 | 2613 | ||
2614 | mov edx, 14 ; ¡é¨© à §¬¥à ¤ ëå ¢ ¡ãä¥à¥ |
2614 | mov edx, 14 ; ¡é¨© à §¬¥à ¤ ëå ¢ ¡ãä¥à¥ |
2615 | 2615 | ||
2616 | mov eax, ssnac |
2616 | mov eax, ssnac |
2617 | mov ebx, buff |
2617 | mov ebx, buff |
2618 | call sendsnac |
2618 | call sendsnac |
2619 | 2619 | ||
2620 | 2620 | ||
2621 | 2621 | ||
2622 | ; |
2622 | ; |
2623 | ; ¯à 訢 ¥¬ ¨ä®à¬ æ¨î ¢á¥å UIN |
2623 | ; ¯à 訢 ¥¬ ¨ä®à¬ æ¨î ¢á¥å UIN |
2624 | ; |
2624 | ; |
2625 | call getinfo |
2625 | call getinfo |
2626 | ; |
2626 | ; |
2627 | ; § ¢¥à襮 ᮥ¤¨¥¨¥ |
2627 | ; § ¢¥à襮 ᮥ¤¨¥¨¥ |
2628 | ; |
2628 | ; |
2629 | mov [login], 2 |
2629 | mov [login], 2 |
2630 | 2630 | ||
2631 | jmp m_fin |
2631 | jmp m_fin |
2632 | 2632 | ||
2633 | m_snac_9_other: |
2633 | m_snac_9_other: |
2634 | write_debug 'Unknown SNAC Family 9 Recived' |
2634 | write_debug 'Unknown SNAC Family 9 Received' |
2635 | jmp m_fin |
2635 | jmp m_fin |
2636 | 2636 | ||
2637 | 2637 | ||
2638 | ; |
2638 | ; |
2639 | ; FAMILY 13 |
2639 | ; FAMILY 13 |
2640 | ; |
2640 | ; |
2641 | m_snac_13: |
2641 | m_snac_13: |
2642 | cmp dx, 3 |
2642 | cmp dx, 3 |
2643 | jz m_snac_13_3 |
2643 | jz m_snac_13_3 |
2644 | cmp dx, 0fh |
2644 | cmp dx, 0fh |
2645 | jz m_snac_13_F |
2645 | jz m_snac_13_F |
2646 | 2646 | ||
2647 | jmp m_snac_13_other |
2647 | jmp m_snac_13_other |
2648 | 2648 | ||
2649 | ; |
2649 | ; |
2650 | ; Server sends SSI service limitations to client |
2650 | ; Server sends SSI service limitations to client |
2651 | ; |
2651 | ; |
2652 | m_snac_13_3: |
2652 | m_snac_13_3: |
2653 | ; |
2653 | ; |
2654 | ; ¡à ¡®âª¨ ¯®ª ¥â |
2654 | ; ¡à ¡®âª¨ ¯®ª ¥â |
2655 | ; |
2655 | ; |
2656 | 2656 | ||
2657 | ; |
2657 | ; |
2658 | ; SNAC(13,05) Client check if its local SSI copy is up-to-date |
2658 | ; SNAC(13,05) Client check if its local SSI copy is up-to-date |
2659 | ; |
2659 | ; |
2660 | mov [ssnac.wFid], 13h ; Family |
2660 | mov [ssnac.wFid], 13h ; Family |
2661 | mov [ssnac.wSid], 5 ; Subtype |
2661 | mov [ssnac.wSid], 5 ; Subtype |
2662 | mov [ssnac.dRi], 5 ; request-id |
2662 | mov [ssnac.dRi], 5 ; request-id |
2663 | mov eax, ssnac |
2663 | mov eax, ssnac |
2664 | ; 3D E7 48 17 |
2664 | ; 3D E7 48 17 |
2665 | mov [buff], 03Dh ; |
2665 | mov [buff], 03Dh ; |
2666 | mov [buff+1], 0E7h ; modification date/time of client local SSI copy |
2666 | mov [buff+1], 0E7h ; modification date/time of client local SSI copy |
2667 | mov [buff+2], 48h ; |
2667 | mov [buff+2], 48h ; |
2668 | mov [buff+3], 17h ; |
2668 | mov [buff+3], 17h ; |
2669 | ; 00 10 |
2669 | ; 00 10 |
2670 | mov [buff+4], 00 ; |
2670 | mov [buff+4], 00 ; |
2671 | mov [buff+5], 10h ; number of items in client local SSI copy |
2671 | mov [buff+5], 10h ; number of items in client local SSI copy |
2672 | 2672 | ||
2673 | mov ebx, buff |
2673 | mov ebx, buff |
2674 | mov edx, 5 |
2674 | mov edx, 5 |
2675 | call sendsnac |
2675 | call sendsnac |
2676 | 2676 | ||
2677 | jmp m_fin |
2677 | jmp m_fin |
2678 | 2678 | ||
2679 | ; |
2679 | ; |
2680 | ; Server tell client its local copy up-to-date |
2680 | ; Server tell client its local copy up-to-date |
2681 | ; |
2681 | ; |
2682 | m_snac_13_F: |
2682 | m_snac_13_F: |
2683 | ; |
2683 | ; |
2684 | ; ¡à ¡®âª¨ ¥â |
2684 | ; ¡à ¡®âª¨ ¥â |
2685 | ; |
2685 | ; |
2686 | 2686 | ||
2687 | ; |
2687 | ; |
2688 | ; Client activates server SSI data |
2688 | ; Client activates server SSI data |
2689 | ; |
2689 | ; |
2690 | mov [ssnac.wFid], 13h ; Family |
2690 | mov [ssnac.wFid], 13h ; Family |
2691 | mov [ssnac.wSid], 7 ; Subtype |
2691 | mov [ssnac.wSid], 7 ; Subtype |
2692 | mov [ssnac.dRi], 7 ; request-id |
2692 | mov [ssnac.dRi], 7 ; request-id |
2693 | mov eax, ssnac |
2693 | mov eax, ssnac |
2694 | mov ebx, buff |
2694 | mov ebx, buff |
2695 | xor edx, edx |
2695 | xor edx, edx |
2696 | call sendsnac |
2696 | call sendsnac |
2697 | 2697 | ||
2698 | ; |
2698 | ; |
2699 | ; ¯®á«¥¤ïï áâ ¤¨ï ᮥ¤¨¥¨ï |
2699 | ; ¯®á«¥¤ïï áâ ¤¨ï ᮥ¤¨¥¨ï |
2700 | ; |
2700 | ; |
2701 | 2701 | ||
2702 | ; |
2702 | ; |
2703 | ; Client sends its DC info and status to server |
2703 | ; Client sends its DC info and status to server |
2704 | ; |
2704 | ; |
2705 | mov [ssnac.wFid], 1 ; Family |
2705 | mov [ssnac.wFid], 1 ; Family |
2706 | mov [ssnac.wSid], 1Eh ; Subtype |
2706 | mov [ssnac.wSid], 1Eh ; Subtype |
2707 | mov [ssnac.dRi], 1Eh ; request-id |
2707 | mov [ssnac.dRi], 1Eh ; request-id |
2708 | 2708 | ||
2709 | mov [buff], 0 ; TLV type 06 |
2709 | mov [buff], 0 ; TLV type 06 |
2710 | mov [buff+1], 6h ; |
2710 | mov [buff+1], 6h ; |
2711 | mov [buff+2], 0 ; TLV data length |
2711 | mov [buff+2], 0 ; TLV data length |
2712 | mov [buff+3], 4 ; |
2712 | mov [buff+3], 4 ; |
2713 | ; |
2713 | ; |
2714 | ; |
2714 | ; |
2715 | mov ax, STATUS_DCDISABLED ; DC disabled |
2715 | mov ax, STATUS_DCDISABLED ; DC disabled |
2716 | call htons |
2716 | call htons |
2717 | mov word [buff+4], ax |
2717 | mov word [buff+4], ax |
2718 | mov ax, STATUS_ONLINE |
2718 | mov ax, STATUS_ONLINE |
2719 | mov [status], ax |
2719 | mov [status], ax |
2720 | mov word [buff+6], ax |
2720 | mov word [buff+6], ax |
2721 | 2721 | ||
2722 | mov eax, ssnac |
2722 | mov eax, ssnac |
2723 | mov ebx, buff |
2723 | mov ebx, buff |
2724 | mov edx, 8 ; TLV head len+ data len |
2724 | mov edx, 8 ; TLV head len+ data len |
2725 | call sendsnac |
2725 | call sendsnac |
2726 | 2726 | ||
2727 | ; |
2727 | ; |
2728 | ; Client READY command |
2728 | ; Client READY command |
2729 | ; |
2729 | ; |
2730 | mov [ssnac.wFid], 1 ; Family |
2730 | mov [ssnac.wFid], 1 ; Family |
2731 | mov [ssnac.wSid], 2 ; Subtype |
2731 | mov [ssnac.wSid], 2 ; Subtype |
2732 | mov [ssnac.dRi], 2 ; request-id |
2732 | mov [ssnac.dRi], 2 ; request-id |
2733 | 2733 | ||
2734 | mov eax, FAMILY_ARR |
2734 | mov eax, FAMILY_ARR |
2735 | mov ebx, buff |
2735 | mov ebx, buff |
2736 | push ecx |
2736 | push ecx |
2737 | mov ecx, FA_LEN |
2737 | mov ecx, FA_LEN |
2738 | call strcpy |
2738 | call strcpy |
2739 | pop ecx |
2739 | pop ecx |
2740 | 2740 | ||
2741 | mov eax, ssnac |
2741 | mov eax, ssnac |
2742 | mov ebx, buff |
2742 | mov ebx, buff |
2743 | mov edx, FA_LEN |
2743 | mov edx, FA_LEN |
2744 | call sendsnac |
2744 | call sendsnac |
2745 | 2745 | ||
2746 | 2746 | ||
2747 | ; |
2747 | ; |
2748 | ; ¯à 訢 ¥¬ offline á®®¡é¥¨ï |
2748 | ; ¯à 訢 ¥¬ offline á®®¡é¥¨ï |
2749 | ; |
2749 | ; |
2750 | mov [ssnac.wFid], 15h ; Family |
2750 | mov [ssnac.wFid], 15h ; Family |
2751 | mov [ssnac.wSid], 2 ; Subtype |
2751 | mov [ssnac.wSid], 2 ; Subtype |
2752 | mov [ssnac.dRi], 2 ; request-id |
2752 | mov [ssnac.dRi], 2 ; request-id |
2753 | 2753 | ||
2754 | mov word [buff], 0100h ; TLV type 01 |
2754 | mov word [buff], 0100h ; TLV type 01 |
2755 | mov word [buff+2], 0A00h ; 00 0a Ǭ |
2755 | mov word [buff+2], 0A00h ; 00 0a Ǭ |
2756 | mov word [buff+4], 0008h ; 08 00 |
2756 | mov word [buff+4], 0008h ; 08 00 |
2757 | mov eax, UIN |
2757 | mov eax, UIN |
2758 | call ascitoint |
2758 | call ascitoint |
2759 | mov dword [buff+6], eax |
2759 | mov dword [buff+6], eax |
2760 | 2760 | ||
2761 | mov [buff+10], 003Ch ; 3C 00 - ¯à®á ®ää« ©®¢ë¥ á®®¡é¥¨ï |
2761 | mov [buff+10], 003Ch ; 3C 00 - ¯à®á ®ää« ©®¢ë¥ á®®¡é¥¨ï |
2762 | mov [buff+12], 0002 ; 02 00 - request sequence number |
2762 | mov [buff+12], 0002 ; 02 00 - request sequence number |
2763 | 2763 | ||
2764 | mov edx, 14 ; ¡é¨© à §¬¥à ¤ ëå ¢ ¡ãä¥à¥ |
2764 | mov edx, 14 ; ¡é¨© à §¬¥à ¤ ëå ¢ ¡ãä¥à¥ |
2765 | 2765 | ||
2766 | mov eax, ssnac |
2766 | mov eax, ssnac |
2767 | mov ebx, buff |
2767 | mov ebx, buff |
2768 | call sendsnac |
2768 | call sendsnac |
2769 | 2769 | ||
2770 | 2770 | ||
2771 | 2771 | ||
2772 | jmp m_fin |
2772 | jmp m_fin |
2773 | 2773 | ||
2774 | m_snac_13_other: |
2774 | m_snac_13_other: |
2775 | write_debug 'Unknown SNAC Family 13 Recived' |
2775 | write_debug 'Unknown SNAC Family 13 Received' |
2776 | jmp m_fin |
2776 | jmp m_fin |
2777 | 2777 | ||
2778 | 2778 | ||
2779 | 2779 | ||
2780 | 2780 | ||
2781 | ; |
2781 | ; |
2782 | ; Family 15 |
2782 | ; Family 15 |
2783 | ; |
2783 | ; |
2784 | 2784 | ||
2785 | m_snac_15: |
2785 | m_snac_15: |
2786 | 2786 | ||
2787 | cmp dx, 3 |
2787 | cmp dx, 3 |
2788 | jz m_snac_15_3 |
2788 | jz m_snac_15_3 |
2789 | 2789 | ||
2790 | jmp m_snac_15_other |
2790 | jmp m_snac_15_other |
2791 | 2791 | ||
2792 | 2792 | ||
2793 | ; |
2793 | ; |
2794 | ; Server sends message #N |
2794 | ; Server sends message #N |
2795 | ; |
2795 | ; |
2796 | m_snac_15_3: |
2796 | m_snac_15_3: |
2797 | ; |
2797 | ; |
2798 | ; ¯à¥¤¥«ï¥¬ ¯®¤â¨¯ ¯à¨ï⮣® ¯ ª¥â |
2798 | ; ¯à¥¤¥«ï¥¬ ¯®¤â¨¯ ¯à¨ï⮣® ¯ ª¥â |
2799 | ; |
2799 | ; |
2800 | 2800 | ||
2801 | ;write_debug 'SNAC 15, 3' |
2801 | ;write_debug 'SNAC 15, 3' |
2802 | 2802 | ||
2803 | xor eax, eax |
2803 | xor eax, eax |
2804 | mov ax, word [mbuff+10] ; + SNAC.head size |
2804 | mov ax, word [mbuff+10] ; + SNAC.head size |
2805 | cmp ax, 0100h ; 00 01 TLV type |
2805 | cmp ax, 0100h ; 00 01 TLV type |
2806 | jnz m_snac_tlv_err |
2806 | jnz m_snac_tlv_err |
2807 | 2807 | ||
2808 | mov ax, word [mbuff+10+10] |
2808 | mov ax, word [mbuff+10+10] |
2809 | cmp ax, 0041h ; Offline Message |
2809 | cmp ax, 0041h ; Offline Message |
2810 | jz m_snac_offline_mes |
2810 | jz m_snac_offline_mes |
2811 | cmp ax, 0042h ; End messages |
2811 | cmp ax, 0042h ; End messages |
2812 | jz m_snac_offline_end |
2812 | jz m_snac_offline_end |
2813 | cmp ax, 07DAh |
2813 | cmp ax, 07DAh |
2814 | jz m_snac_meta_data |
2814 | jz m_snac_meta_data |
2815 | 2815 | ||
2816 | 2816 | ||
2817 | write_debug 'Unknown Subtype SNAC (15,3)' |
2817 | write_debug 'Unknown Subtype SNAC (15,3)' |
2818 | jmp m_fin |
2818 | jmp m_fin |
2819 | 2819 | ||
2820 | m_snac_offline_mes: |
2820 | m_snac_offline_mes: |
2821 | mov eax, MESS ; |
2821 | mov eax, MESS ; |
2822 | call strlen ; 뢮¤¨¬ áâபã á á®®¡é¥¨¥¬ ® ®â¯à ¢¨â¥«¥ ¨ ¢à¥¬¥¨ ®â¯à ¢ª¨ |
2822 | call strlen ; 뢮¤¨¬ áâபã á á®®¡é¥¨¥¬ ® ®â¯à ¢¨â¥«¥ ¨ ¢à¥¬¥¨ ®â¯à ¢ª¨ |
2823 | push ecx ; |
2823 | push ecx ; |
2824 | mov ecx, eax ; |
2824 | mov ecx, eax ; |
2825 | mov eax, MESS |
2825 | mov eax, MESS |
2826 | mov ebx, buff |
2826 | mov ebx, buff |
2827 | call strcpy |
2827 | call strcpy |
2828 | 2828 | ||
2829 | mov eax, dword [mbuff+14+10] ; Sender UIN |
2829 | mov eax, dword [mbuff+14+10] ; Sender UIN |
2830 | lea ebx, [buff+ecx] ; ®á«¥ áâà®çª¨ ® á®®¡é¥¨¨ |
2830 | lea ebx, [buff+ecx] ; ®á«¥ áâà®çª¨ ® á®®¡é¥¨¨ |
2831 | call int2strd |
2831 | call int2strd |
2832 | 2832 | ||
2833 | lea ebx, [ebx+eax] |
2833 | lea ebx, [ebx+eax] |
2834 | mov [ebx], byte ' ' |
2834 | mov [ebx], byte ' ' |
2835 | inc ebx |
2835 | inc ebx |
2836 | 2836 | ||
2837 | ; + Ǭ UIN |
2837 | ; + Ǭ UIN |
2838 | movzx eax, byte [mbuff+21+10] ; Day |
2838 | movzx eax, byte [mbuff+21+10] ; Day |
2839 | call int2strd |
2839 | call int2strd |
2840 | 2840 | ||
2841 | lea ebx, [ebx+eax] |
2841 | lea ebx, [ebx+eax] |
2842 | mov [ebx], byte '.' |
2842 | mov [ebx], byte '.' |
2843 | inc ebx |
2843 | inc ebx |
2844 | 2844 | ||
2845 | 2845 | ||
2846 | movzx eax, byte [mbuff+20+10] ;Mounth |
2846 | movzx eax, byte [mbuff+20+10] ;Mounth |
2847 | call int2strd |
2847 | call int2strd |
2848 | 2848 | ||
2849 | lea ebx, [ebx+eax] |
2849 | lea ebx, [ebx+eax] |
2850 | mov [ebx], byte ' ' |
2850 | mov [ebx], byte ' ' |
2851 | inc ebx |
2851 | inc ebx |
2852 | 2852 | ||
2853 | movzx eax, [mbuff+22+10] ; Hour |
2853 | movzx eax, [mbuff+22+10] ; Hour |
2854 | call int2strd |
2854 | call int2strd |
2855 | 2855 | ||
2856 | lea ebx, [ebx+eax] |
2856 | lea ebx, [ebx+eax] |
2857 | mov [ebx], byte ':' |
2857 | mov [ebx], byte ':' |
2858 | inc ebx |
2858 | inc ebx |
2859 | 2859 | ||
2860 | movzx eax, [mbuff+23+10] ; Minute |
2860 | movzx eax, [mbuff+23+10] ; Minute |
2861 | call int2strd |
2861 | call int2strd |
2862 | 2862 | ||
2863 | lea ebx, [ebx+eax] |
2863 | lea ebx, [ebx+eax] |
2864 | ;mov [ebx], byte ' ' |
2864 | ;mov [ebx], byte ' ' |
2865 | ;inc ebx |
2865 | ;inc ebx |
2866 | 2866 | ||
2867 | mov [ebx], byte 0 ; Str end |
2867 | mov [ebx], byte 0 ; Str end |
2868 | mov eax, buff |
2868 | mov eax, buff |
2869 | xor ebx, ebx |
2869 | xor ebx, ebx |
2870 | 2870 | ||
2871 | call writemsg |
2871 | call writemsg |
2872 | 2872 | ||
2873 | movzx ecx, word [mbuff+26+10] ; «¨ á®®®¡é¥¨ï |
2873 | movzx ecx, word [mbuff+26+10] ; «¨ á®®®¡é¥¨ï |
2874 | lea eax, [mbuff+28+10] |
2874 | lea eax, [mbuff+28+10] |
2875 | mov ebx, buff |
2875 | mov ebx, buff |
2876 | call strcpy |
2876 | call strcpy |
2877 | 2877 | ||
2878 | mov [ebx+ecx], byte 0 |
2878 | mov [ebx+ecx], byte 0 |
2879 | 2879 | ||
2880 | mov eax, buff |
2880 | mov eax, buff |
2881 | call win2dos ;¯¥à¥ª®¤¨à㥬 |
2881 | call win2dos ;¯¥à¥ª®¤¨à㥬 |
2882 | 2882 | ||
2883 | mov ebx, 00FF0000h ;¢¥â |
2883 | mov ebx, 00FF0000h ;¢¥â |
2884 | 2884 | ||
2885 | call writemsg |
2885 | call writemsg |
2886 | 2886 | ||
2887 | 2887 | ||
2888 | pop ecx |
2888 | pop ecx |
2889 | 2889 | ||
2890 | jmp m_fin |
2890 | jmp m_fin |
2891 | 2891 | ||
2892 | 2892 | ||
2893 | m_snac_offline_end: |
2893 | m_snac_offline_end: |
2894 | ; |
2894 | ; |
2895 | ; ¤ «ï¥¬ á®®¡é¥¨ï á¥à¢¥à¥ |
2895 | ; ¤ «ï¥¬ á®®¡é¥¨ï á¥à¢¥à¥ |
2896 | ; |
2896 | ; |
2897 | mov [ssnac.wFid], 15h ; Family |
2897 | mov [ssnac.wFid], 15h ; Family |
2898 | mov [ssnac.wSid], 2 ; Subtype |
2898 | mov [ssnac.wSid], 2 ; Subtype |
2899 | mov [ssnac.dRi], 0602h ; request-id |
2899 | mov [ssnac.dRi], 0602h ; request-id |
2900 | 2900 | ||
2901 | mov word [buff], 0100h ; 00 01 TLV.Type(1) - encapsulated META_DATA1 |
2901 | mov word [buff], 0100h ; 00 01 TLV.Type(1) - encapsulated META_DATA1 |
2902 | mov word [buff+2], 0A00h ; 00 0A TLV.Length |
2902 | mov word [buff+2], 0A00h ; 00 0A TLV.Length |
2903 | mov word [buff+4], 0008h ; 08 00 data chunk size (TLV.Length-2) |
2903 | mov word [buff+4], 0008h ; 08 00 data chunk size (TLV.Length-2) |
2904 | mov eax, UIN |
2904 | mov eax, UIN |
2905 | call ascitoint |
2905 | call ascitoint |
2906 | mov dword [buff+6], eax ; xx xx xx xx (LE) client uin |
2906 | mov dword [buff+6], eax ; xx xx xx xx (LE) client uin |
2907 | mov word [buff+10], 003Eh ; 3E 00 (LE) data type: delete offline msgs request cmd |
2907 | mov word [buff+10], 003Eh ; 3E 00 (LE) data type: delete offline msgs request cmd |
2908 | mov word [buff+12], 0007h ; xx xx (LE) request sequence number |
2908 | mov word [buff+12], 0007h ; xx xx (LE) request sequence number |
2909 | 2909 | ||
2910 | mov edx, 14 ; §¬¥à ¤ ëå |
2910 | mov edx, 14 ; §¬¥à ¤ ëå |
2911 | mov eax, ssnac |
2911 | mov eax, ssnac |
2912 | mov ebx, buff |
2912 | mov ebx, buff |
2913 | call sendsnac |
2913 | call sendsnac |
2914 | 2914 | ||
2915 | 2915 | ||
2916 | 2916 | ||
2917 | jmp m_fin |
2917 | jmp m_fin |
2918 | 2918 | ||
2919 | ; |
2919 | ; |
2920 | ; ⢥⠧ ¯à®á ® ¯®«ì§®¢ ⥫ïå |
2920 | ; ⢥⠧ ¯à®á ® ¯®«ì§®¢ ⥫ïå |
2921 | ; |
2921 | ; |
2922 | m_snac_meta_data: |
2922 | m_snac_meta_data: |
2923 | ; |
2923 | ; |
2924 | ; ¯à¥¤¥«ï¥¬ ®ç¥à¥¤®© ¯®¤â¨¯ :-) |
2924 | ; ¯à¥¤¥«ï¥¬ ®ç¥à¥¤®© ¯®¤â¨¯ :-) |
2925 | ; |
2925 | ; |
2926 | mov ax, word [mbuff+10+14] |
2926 | mov ax, word [mbuff+10+14] |
2927 | cmp ax, 0104h ;data subtype: META_SHORT_USERINFO |
2927 | cmp ax, 0104h ;data subtype: META_SHORT_USERINFO |
2928 | jz m_snac_short_userinfo |
2928 | jz m_snac_short_userinfo |
2929 | cmp ax, 00C8h |
2929 | cmp ax, 00C8h |
2930 | jz m_snac_basic_userinfo ;data subtype: META_BASIC_USERINFO |
2930 | jz m_snac_basic_userinfo ;data subtype: META_BASIC_USERINFO |
2931 | write_debug 'Unknown META DATA subtype' |
2931 | write_debug 'Unknown META DATA subtype' |
2932 | jmp m_fin |
2932 | jmp m_fin |
2933 | 2933 | ||
2934 | 2934 | ||
2935 | 2935 | ||
2936 | m_snac_short_userinfo: |
2936 | m_snac_short_userinfo: |
2937 | ; |
2937 | ; |
2938 | ; § ¢á¥© ¨ä®à¬ 樨 ¯®ª 㦥 ⮫쪮 ¨ª |
2938 | ; § ¢á¥© ¨ä®à¬ 樨 ¯®ª 㦥 ⮫쪮 ¨ª |
2939 | ; |
2939 | ; |
2940 | mov al, [mbuff+10+16] |
2940 | mov al, [mbuff+10+16] |
2941 | cmp al, 0Ah ;success byte |
2941 | cmp al, 0Ah ;success byte |
2942 | jnz m_fin |
2942 | jnz m_fin |
2943 | 2943 | ||
2944 | movzx eax, word [mbuff+10+12] ;request sequence number |
2944 | movzx eax, word [mbuff+10+12] ;request sequence number |
2945 | ; |
2945 | ; |
2946 | ; § ¯à®á¥ ï ¨á¯®«ì§®¢ « ¯®à浪®¢ë© ®¬¥à î§¥à ¢ |
2946 | ; § ¯à®á¥ ï ¨á¯®«ì§®¢ « ¯®à浪®¢ë© ®¬¥à î§¥à ¢ |
2947 | lea ebx, [mbuff+10+19] ;nickname string |
2947 | lea ebx, [mbuff+10+19] ;nickname string |
2948 | ; «¨ áâப¨ ¥ 㦠, â.ª. áâப Null-Terminated |
2948 | ; «¨ áâப¨ ¥ 㦠, â.ª. áâப Null-Terminated |
2949 | ;¯à¥¤¥«ï¥¬ áâ âãá |
2949 | ;¯à¥¤¥«ï¥¬ áâ âãá |
2950 | mov ecx, 4 |
2950 | mov ecx, 4 |
2951 | imul ecx, eax |
2951 | imul ecx, eax |
2952 | mov ecx, [stats+ecx] |
2952 | mov ecx, [stats+ecx] |
2953 | 2953 | ||
2954 | call loadbb |
2954 | call loadbb |
2955 | 2955 | ||
2956 | 2956 | ||
2957 | 2957 | ||
2958 | jmp m_fin |
2958 | jmp m_fin |
2959 | 2959 | ||
2960 | ; |
2960 | ; |
2961 | ; ⪠SIQ § ¯à®á ª®à®âª®© ¨äë ®â¢¥ç ¥â |
2961 | ; ⪠SIQ § ¯à®á ª®à®âª®© ¨äë ®â¢¥ç ¥â |
2962 | ; ¯ ª¥â®¬ ¡ §®¢®© ¨ä®à¬ 樨, ॠ«¨§ãî ¯®ª ⮫쪮 ¥£® |
2962 | ; ¯ ª¥â®¬ ¡ §®¢®© ¨ä®à¬ 樨, ॠ«¨§ãî ¯®ª ⮫쪮 ¥£® |
2963 | ; |
2963 | ; |
2964 | m_snac_basic_userinfo: |
2964 | m_snac_basic_userinfo: |
2965 | mov al, [mbuff+10+16] |
2965 | mov al, [mbuff+10+16] |
2966 | cmp al, 0Ah ;success byte |
2966 | cmp al, 0Ah ;success byte |
2967 | jnz m_fin |
2967 | jnz m_fin |
2968 | 2968 | ||
2969 | movzx eax, word [mbuff+10+12] ;request sequence number |
2969 | movzx eax, word [mbuff+10+12] ;request sequence number |
2970 | ; |
2970 | ; |
2971 | ; § ¯à®á¥ ï ¨á¯®«ì§®¢ « ¯®à浪®¢ë© ®¬¥à î§¥à ¢ |
2971 | ; § ¯à®á¥ ï ¨á¯®«ì§®¢ « ¯®à浪®¢ë© ®¬¥à î§¥à ¢ |
2972 | lea ebx, [mbuff+10+19] ;nickname string |
2972 | lea ebx, [mbuff+10+19] ;nickname string |
2973 | ; «¨ áâப¨ ¥ 㦠, â.ª. áâப Null-Terminated |
2973 | ; «¨ áâப¨ ¥ 㦠, â.ª. áâப Null-Terminated |
2974 | ;¯à¥¤¥«ï¥¬ áâ âãá |
2974 | ;¯à¥¤¥«ï¥¬ áâ âãá |
2975 | mov ecx, 4 |
2975 | mov ecx, 4 |
2976 | imul ecx, eax |
2976 | imul ecx, eax |
2977 | mov ecx, [stats+ecx] |
2977 | mov ecx, [stats+ecx] |
2978 | 2978 | ||
2979 | call loadbb |
2979 | call loadbb |
2980 | 2980 | ||
2981 | 2981 | ||
2982 | 2982 | ||
2983 | jmp m_fin |
2983 | jmp m_fin |
2984 | 2984 | ||
2985 | m_snac_tlv_err: |
2985 | m_snac_tlv_err: |
2986 | write_debug 'TLV TYPE MISMATCH' |
2986 | write_debug 'TLV TYPE MISMATCH' |
2987 | 2987 | ||
2988 | jmp m_fin |
2988 | jmp m_fin |
2989 | 2989 | ||
2990 | 2990 | ||
2991 | m_snac_15_other: |
2991 | m_snac_15_other: |
2992 | 2992 | ||
2993 | write_debug 'Unknown SNAC Family 15 Recived' |
2993 | write_debug 'Unknown SNAC Family 15 Received' |
2994 | 2994 | ||
2995 | jmp m_fin |
2995 | jmp m_fin |
2996 | 2996 | ||
2997 | 2997 | ||
2998 | m_other_snac: |
2998 | m_other_snac: |
2999 | write_debug 'Unknown SNAC recived' |
2999 | write_debug 'Unknown SNAC received' |
3000 | jmp m_fin |
3000 | jmp m_fin |
3001 | 3001 | ||
3002 | 3002 | ||
3003 | 3003 | ||
3004 | m_fin: |
3004 | m_fin: |
3005 | ;pop edx |
3005 | ;pop edx |
3006 | ;pop ebx |
3006 | ;pop ebx |
3007 | ;pop eax |
3007 | ;pop eax |
3008 | popad |
3008 | popad |
3009 | popf |
3009 | popf |
3010 | ret |
3010 | ret |
3011 | 3011 | ||
3012 | ; «ï ¯¥à¥¢®¤ DWORD ¨§ Little Endian ¢ Big Endian |
3012 | ; «ï ¯¥à¥¢®¤ DWORD ¨§ Little Endian ¢ Big Endian |
3013 | ; ¨ ®¡®à®â :-) |
3013 | ; ¨ ®¡®à®â :-) |
3014 | ; <--EAX DWORD |
3014 | ; <--EAX DWORD |
3015 | ; -->EAX |
3015 | ; -->EAX |
3016 | ; |
3016 | ; |
3017 | ntohl: |
3017 | ntohl: |
3018 | htonl: |
3018 | htonl: |
3019 | ;pushf |
3019 | ;pushf |
3020 | push ebx |
3020 | push ebx |
3021 | ;push ecx |
3021 | ;push ecx |
3022 | 3022 | ||
3023 | xor ebx, ebx |
3023 | xor ebx, ebx |
3024 | 3024 | ||
3025 | mov bl, ah |
3025 | mov bl, ah |
3026 | mov bh, al |
3026 | mov bh, al |
3027 | shl ebx, 16 |
3027 | shl ebx, 16 |
3028 | 3028 | ||
3029 | shr eax, 16 |
3029 | shr eax, 16 |
3030 | mov bl, ah |
3030 | mov bl, ah |
3031 | mov bh, al |
3031 | mov bh, al |
3032 | 3032 | ||
3033 | mov eax, ebx |
3033 | mov eax, ebx |
3034 | 3034 | ||
3035 | ;pop ecx |
3035 | ;pop ecx |
3036 | pop ebx |
3036 | pop ebx |
3037 | ;popf |
3037 | ;popf |
3038 | ret |
3038 | ret |
3039 | 3039 | ||
3040 | 3040 | ||
3041 | ; «ï ¯¥à¥¢®¤ WORD ¨§ Little Endian ¢ Big Endian |
3041 | ; «ï ¯¥à¥¢®¤ WORD ¨§ Little Endian ¢ Big Endian |
3042 | ; <--AX WORD |
3042 | ; <--AX WORD |
3043 | ; -->AX WORD |
3043 | ; -->AX WORD |
3044 | ; |
3044 | ; |
3045 | 3045 | ||
3046 | ntohs: |
3046 | ntohs: |
3047 | htons: |
3047 | htons: |
3048 | ;pushf |
3048 | ;pushf |
3049 | push ebx |
3049 | push ebx |
3050 | 3050 | ||
3051 | xor ebx, ebx |
3051 | xor ebx, ebx |
3052 | mov bl, ah |
3052 | mov bl, ah |
3053 | mov bh, al |
3053 | mov bh, al |
3054 | mov eax, ebx |
3054 | mov eax, ebx |
3055 | 3055 | ||
3056 | pop ebx |
3056 | pop ebx |
3057 | ;popf |
3057 | ;popf |
3058 | ret |
3058 | ret |
3059 | 3059 | ||
3060 | ; |
3060 | ; |
3061 | ; ¯ àá¨â SNAC |
3061 | ; ¯ àá¨â SNAC |
3062 | ; <--EAX 㪠§ ⥫ì SNAC_head |
3062 | ; <--EAX 㪠§ ⥫ì SNAC_head |
3063 | ; <--EBX 㪠§ â¥«ì ¡ãää¥à |
3063 | ; <--EBX 㪠§ â¥«ì ¡ãää¥à |
3064 | ; -->EAX 㪠§ ⥫ì ç «® ¤ ëå = buffer+sizeof SNAC_head |
3064 | ; -->EAX 㪠§ ⥫ì ç «® ¤ ëå = buffer+sizeof SNAC_head |
3065 | ; |
3065 | ; |
3066 | ; |
3066 | ; |
3067 | snacpar: |
3067 | snacpar: |
3068 | pushf |
3068 | pushf |
3069 | push ecx |
3069 | push ecx |
3070 | ;push edx |
3070 | ;push edx |
3071 | 3071 | ||
3072 | mov cl, [ebx+1] ; Family (service) id number ¬« ¤è¨© ¡ ©â |
3072 | mov cl, [ebx+1] ; Family (service) id number ¬« ¤è¨© ¡ ©â |
3073 | mov ch, [ebx] ; áâ à訩 |
3073 | mov ch, [ebx] ; áâ à訩 |
3074 | mov word [eax], cx |
3074 | mov word [eax], cx |
3075 | 3075 | ||
3076 | mov cl, [ebx+3] ; Family subtype id number |
3076 | mov cl, [ebx+3] ; Family subtype id number |
3077 | mov ch, [ebx+2] ; |
3077 | mov ch, [ebx+2] ; |
3078 | mov word [eax+2], cx |
3078 | mov word [eax+2], cx |
3079 | 3079 | ||
3080 | mov cl, [ebx+5] ; SNAC flags |
3080 | mov cl, [ebx+5] ; SNAC flags |
3081 | mov ch, [ebx+4] ; |
3081 | mov ch, [ebx+4] ; |
3082 | mov word [eax+4], cx ; |
3082 | mov word [eax+4], cx ; |
3083 | 3083 | ||
3084 | mov cl, [ebx+7] ; |
3084 | mov cl, [ebx+7] ; |
3085 | mov ch, [ebx+6] ; |
3085 | mov ch, [ebx+6] ; |
3086 | mov word [eax+8], cx ; SNAC request id |
3086 | mov word [eax+8], cx ; SNAC request id |
3087 | mov cl, [ebx+8] ; |
3087 | mov cl, [ebx+8] ; |
3088 | mov ch, [ebx+7] ; |
3088 | mov ch, [ebx+7] ; |
3089 | mov word [eax+6], cx ; |
3089 | mov word [eax+6], cx ; |
3090 | 3090 | ||
3091 | add ebx, 10 ; §¬¥à § £®«®¢ª |
3091 | add ebx, 10 ; §¬¥à § £®«®¢ª |
3092 | mov eax, ebx |
3092 | mov eax, ebx |
3093 | 3093 | ||
3094 | 3094 | ||
3095 | ;pop edx |
3095 | ;pop edx |
3096 | pop ecx |
3096 | pop ecx |
3097 | popf |
3097 | popf |
3098 | ret |
3098 | ret |
3099 | 3099 | ||
3100 | ; |
3100 | ; |
3101 | ; ¯ àá¨â userinfo block |
3101 | ; ¯ àá¨â userinfo block |
3102 | ; FIXIT |
3102 | ; FIXIT |
3103 | ; |
3103 | ; |
3104 | 3104 | ||
3105 | ; userinfopar: |
3105 | ; userinfopar: |
3106 | ; pushf |
3106 | ; pushf |
3107 | ; |
3107 | ; |
3108 | ; |
3108 | ; |
3109 | ; |
3109 | ; |
3110 | ; |
3110 | ; |
3111 | ; |
3111 | ; |
3112 | ; |
3112 | ; |
3113 | ; popf |
3113 | ; popf |
3114 | ; ret |
3114 | ; ret |
3115 | 3115 | ||
3116 | ; |
3116 | ; |
3117 | ; ¯®á뫪 á®®¡é¥¨ï |
3117 | ; ¯®á뫪 á®®¡é¥¨ï |
3118 | ; [eax] <-- ⥪áâ®¢ë© ¡ãä¥à \ |
3118 | ; [eax] <-- ⥪áâ®¢ë© ¡ãä¥à \ |
3119 | ; [ebx] <-- UIN / Null-terminated |
3119 | ; [ebx] <-- UIN / Null-terminated |
3120 | 3120 | ||
3121 | sendmsg: |
3121 | sendmsg: |
3122 | pushf |
3122 | pushf |
3123 | pushad |
3123 | pushad |
3124 | push eax |
3124 | push eax |
3125 | push ebx |
3125 | push ebx |
3126 | 3126 | ||
3127 | mov [ssnac.wFid], 4h ; Family |
3127 | mov [ssnac.wFid], 4h ; Family |
3128 | mov [ssnac.wSid], 6 ; Subtype |
3128 | mov [ssnac.wSid], 6 ; Subtype |
3129 | mov [ssnac.dRi], 106h ; request-id |
3129 | mov [ssnac.dRi], 106h ; request-id |
3130 | ; |
3130 | ; |
3131 | ; ®«ãç ¥¬ ¢à¥¬ï á § ¯ã᪠á¨á⥬ë, ¤«ï cookie |
3131 | ; ®«ãç ¥¬ ¢à¥¬ï á § ¯ã᪠á¨á⥬ë, ¤«ï cookie |
3132 | ; |
3132 | ; |
3133 | mov eax, 26 |
3133 | mov eax, 26 |
3134 | mov ebx, 9 |
3134 | mov ebx, 9 |
3135 | int 40h |
3135 | int 40h |
3136 | 3136 | ||
3137 | mov dword [buff], eax ; Cookie 1 |
3137 | mov dword [buff], eax ; Cookie 1 |
3138 | mov dword [buff+4], eax ; Cookie 2 |
3138 | mov dword [buff+4], eax ; Cookie 2 |
3139 | 3139 | ||
3140 | mov word [buff+8], 0100h ; Message channel 00 01 |
3140 | mov word [buff+8], 0100h ; Message channel 00 01 |
3141 | 3141 | ||
3142 | 3142 | ||
3143 | pop ebx |
3143 | pop ebx |
3144 | mov eax, ebx |
3144 | mov eax, ebx |
3145 | call strlen |
3145 | call strlen |
3146 | 3146 | ||
3147 | mov [buff+10], al |
3147 | mov [buff+10], al |
3148 | mov ecx, eax |
3148 | mov ecx, eax |
3149 | mov eax, ebx |
3149 | mov eax, ebx |
3150 | lea ebx, [buff+11] |
3150 | lea ebx, [buff+11] |
3151 | call strcpy |
3151 | call strcpy |
3152 | lea ecx, [ecx+11] |
3152 | lea ecx, [ecx+11] |
3153 | 3153 | ||
3154 | mov word [buff+ecx], 0200h ; TLV.Type(0x02) - message data |
3154 | mov word [buff+ecx], 0200h ; TLV.Type(0x02) - message data |
3155 | 3155 | ||
3156 | ;push ecx ; |
3156 | ;push ecx ; |
3157 | ; TLV.Length |
3157 | ; TLV.Length |
3158 | 3158 | ||
3159 | mov word [buff+ecx+4], 0105h ; 05 01 01 - fragment version, 05 - fragment identifier |
3159 | mov word [buff+ecx+4], 0105h ; 05 01 01 - fragment version, 05 - fragment identifier |
3160 | 3160 | ||
3161 | mov word [buff+ecx+6], 0100h ; data length |
3161 | mov word [buff+ecx+6], 0100h ; data length |
3162 | 3162 | ||
3163 | mov [buff+ecx+8], 01 ; byte array of required capabilities (1 - text) |
3163 | mov [buff+ecx+8], 01 ; byte array of required capabilities (1 - text) |
3164 | 3164 | ||
3165 | mov [buff+ecx+9], 01 ; fragment identifier (text message) |
3165 | mov [buff+ecx+9], 01 ; fragment identifier (text message) |
3166 | mov [buff+ecx+10], 01 ; fragment version |
3166 | mov [buff+ecx+10], 01 ; fragment version |
3167 | 3167 | ||
3168 | pop ebx |
3168 | pop ebx |
3169 | mov eax, ebx |
3169 | mov eax, ebx |
3170 | call strlen |
3170 | call strlen |
3171 | mov edx, eax |
3171 | mov edx, eax |
3172 | lea eax, [eax+4] ; «¨ á®®¡é¥¨ï + Message charset number+ Message language number |
3172 | lea eax, [eax+4] ; «¨ á®®¡é¥¨ï + Message charset number+ Message language number |
3173 | 3173 | ||
3174 | call htons |
3174 | call htons |
3175 | mov word [buff+ecx+11], ax |
3175 | mov word [buff+ecx+11], ax |
3176 | 3176 | ||
3177 | mov eax, edx |
3177 | mov eax, edx |
3178 | lea eax, [eax+13] ; + ¤«¨ á«ã¦¥¡ëå ¤ ëå |
3178 | lea eax, [eax+13] ; + ¤«¨ á«ã¦¥¡ëå ¤ ëå |
3179 | call htons |
3179 | call htons |
3180 | mov word [buff+ecx+2], ax |
3180 | mov word [buff+ecx+2], ax |
3181 | 3181 | ||
3182 | 3182 | ||
3183 | mov word [buff+ecx+13], 0700h ; Message charset number |
3183 | mov word [buff+ecx+13], 0700h ; Message charset number |
3184 | mov word [buff+ecx+15], 0300h ; Message language number |
3184 | mov word [buff+ecx+15], 0300h ; Message language number |
3185 | 3185 | ||
3186 | mov eax, ecx |
3186 | mov eax, ecx |
3187 | mov ecx, edx ; Len |
3187 | mov ecx, edx ; Len |
3188 | lea edx, [eax+17] |
3188 | lea edx, [eax+17] |
3189 | 3189 | ||
3190 | mov eax, ebx ;Source |
3190 | mov eax, ebx ;Source |
3191 | 3191 | ||
3192 | lea ebx, [buff+edx] ;Dest |
3192 | lea ebx, [buff+edx] ;Dest |
3193 | 3193 | ||
3194 | call strcpy |
3194 | call strcpy |
3195 | lea ecx, [ecx+edx] ; +String length |
3195 | lea ecx, [ecx+edx] ; +String length |
3196 | 3196 | ||
3197 | mov [buff+ecx], byte 0 |
3197 | mov [buff+ecx], byte 0 |
3198 | mov eax, ebx |
3198 | mov eax, ebx |
3199 | call dos2win |
3199 | call dos2win |
3200 | 3200 | ||
3201 | 3201 | ||
3202 | mov word [buff+ecx], 0600h ; TLV.Type(0x06) - store message if recipient offline |
3202 | mov word [buff+ecx], 0600h ; TLV.Type(0x06) - store message if recipient offline |
3203 | mov word [buff+ecx+2], 0 ; TLV.Length |
3203 | mov word [buff+ecx+2], 0 ; TLV.Length |
3204 | 3204 | ||
3205 | lea edx, [ecx+4] ; +TLV_head length |
3205 | lea edx, [ecx+4] ; +TLV_head length |
3206 | mov eax, ssnac |
3206 | mov eax, ssnac |
3207 | mov ebx, buff |
3207 | mov ebx, buff |
3208 | mov ecx, [socket] |
3208 | mov ecx, [socket] |
3209 | call sendsnac |
3209 | call sendsnac |
3210 | 3210 | ||
3211 | 3211 | ||
3212 | 3212 | ||
3213 | popad |
3213 | popad |
3214 | popf |
3214 | popf |
3215 | ret |
3215 | ret |
3216 | 3216 | ||
3217 | ; |
3217 | ; |
3218 | ; ¯à®á ¨ä®à¬ 樨 UIN®¢ |
3218 | ; ¯à®á ¨ä®à¬ 樨 UIN®¢ |
3219 | ; |
3219 | ; |
3220 | getinfo: |
3220 | getinfo: |
3221 | pushad |
3221 | pushad |
3222 | pushf |
3222 | pushf |
3223 | ; |
3223 | ; |
3224 | ; SNAC (15,2) - Meta information request |
3224 | ; SNAC (15,2) - Meta information request |
3225 | ; |
3225 | ; |
3226 | 3226 | ||
3227 | mov [ssnac.wFid], 15h ; Family |
3227 | mov [ssnac.wFid], 15h ; Family |
3228 | mov [ssnac.wSid], 2 ; Subtype |
3228 | mov [ssnac.wSid], 2 ; Subtype |
3229 | mov [ssnac.dRi], 702h ; request-id |
3229 | mov [ssnac.dRi], 702h ; request-id |
3230 | 3230 | ||
3231 | mov word [buff], 0100h ;TLV.Type(1) - encapsulated META_DATA |
3231 | mov word [buff], 0100h ;TLV.Type(1) - encapsulated META_DATA |
3232 | mov word [buff+2], 1000h ; 00 10 TLV.Length |
3232 | mov word [buff+2], 1000h ; 00 10 TLV.Length |
3233 | mov word [buff+4], 000Eh ; (LE) data chunk size (TLV.Length-2) |
3233 | mov word [buff+4], 000Eh ; (LE) data chunk size (TLV.Length-2) |
3234 | mov eax, UIN |
3234 | mov eax, UIN |
3235 | call ascitoint |
3235 | call ascitoint |
3236 | mov dword [buff+6], eax ;(LE) request owner uin |
3236 | mov dword [buff+6], eax ;(LE) request owner uin |
3237 | mov word [buff+10], 07D0h ;data type: META_DATA_REQ |
3237 | mov word [buff+10], 07D0h ;data type: META_DATA_REQ |
3238 | ;mov word [buff+12], 0008h ; request sequence number <<<-- ®¦¥â ¬¥ïâìáï FIXIT |
3238 | ;mov word [buff+12], 0008h ; request sequence number <<<-- ®¦¥â ¬¥ïâìáï FIXIT |
3239 | mov word [buff+14], 04BAh ; data subtype: META_SHORTINFO_REQUEST |
3239 | mov word [buff+14], 04BAh ; data subtype: META_SHORTINFO_REQUEST |
3240 | 3240 | ||
3241 | mov ecx, [socket] |
3241 | mov ecx, [socket] |
3242 | mov edx, 20 |
3242 | mov edx, 20 |
3243 | 3243 | ||
3244 | xor esi, esi ; ç¥â稪 |
3244 | xor esi, esi ; ç¥â稪 |
3245 | xor eax, eax |
3245 | xor eax, eax |
3246 | 3246 | ||
3247 | gi_loop: |
3247 | gi_loop: |
3248 | mov ebx, esi |
3248 | mov ebx, esi |
3249 | mov word [buff+12], bx ; request sequence number |
3249 | mov word [buff+12], bx ; request sequence number |
3250 | mov ebx, UIN_LEN |
3250 | mov ebx, UIN_LEN |
3251 | imul ebx, esi |
3251 | imul ebx, esi |
3252 | mov al, [uins+ebx] |
3252 | mov al, [uins+ebx] |
3253 | cmp al, 0 |
3253 | cmp al, 0 |
3254 | jz gi_end |
3254 | jz gi_end |
3255 | 3255 | ||
3256 | lea eax, [uins+ebx] |
3256 | lea eax, [uins+ebx] |
3257 | call ascitoint |
3257 | call ascitoint |
3258 | mov dword [buff+16], eax |
3258 | mov dword [buff+16], eax |
3259 | 3259 | ||
3260 | mov eax, ssnac |
3260 | mov eax, ssnac |
3261 | mov ebx, buff |
3261 | mov ebx, buff |
3262 | 3262 | ||
3263 | call sendsnac |
3263 | call sendsnac |
3264 | inc esi |
3264 | inc esi |
3265 | cmp esi, UINS |
3265 | cmp esi, UINS |
3266 | jnc gi_end |
3266 | jnc gi_end |
3267 | jmp gi_loop |
3267 | jmp gi_loop |
3268 | 3268 | ||
3269 | 3269 | ||
3270 | 3270 | ||
3271 | 3271 | ||
3272 | 3272 | ||
3273 | 3273 | ||
3274 | gi_end: |
3274 | gi_end: |
3275 | popf |
3275 | popf |
3276 | popad |
3276 | popad |
3277 | ret |
3277 | ret |
3278 | 3278 | ||
3279 | ; |
3279 | ; |
3280 | ; £à㦠¥¬ «®ª «ìë© á¥à¢¥à ¤«ï ¯®«ã票ï áâ âãá ஢ |
3280 | ; £à㦠¥¬ «®ª «ìë© á¥à¢¥à ¤«ï ¯®«ã票ï áâ âãá ஢ |
3281 | ; |
3281 | ; |
3282 | uploadkl: |
3282 | uploadkl: |
3283 | pushf |
3283 | pushf |
3284 | pushad |
3284 | pushad |
3285 | ; |
3285 | ; |
3286 | ; Add buddy(s) to contact list |
3286 | ; Add buddy(s) to contact list |
3287 | ; |
3287 | ; |
3288 | mov [ssnac.wFid], 3 ; Family |
3288 | mov [ssnac.wFid], 3 ; Family |
3289 | mov [ssnac.wSid], 4 ; Subtype |
3289 | mov [ssnac.wSid], 4 ; Subtype |
3290 | mov [ssnac.dRi], 4 ; request-id |
3290 | mov [ssnac.dRi], 4 ; request-id |
3291 | 3291 | ||
3292 | xor esi, esi ; ç¥â稪 |
3292 | xor esi, esi ; ç¥â稪 |
3293 | xor edx, edx ; ¯®«¥® ¡ ©â |
3293 | xor edx, edx ; ¯®«¥® ¡ ©â |
3294 | 3294 | ||
3295 | ukk_loop: |
3295 | ukk_loop: |
3296 | mov ebx, UIN_LEN |
3296 | mov ebx, UIN_LEN |
3297 | imul ebx, esi |
3297 | imul ebx, esi |
3298 | mov al, [uins+ebx] |
3298 | mov al, [uins+ebx] |
3299 | cmp al, 0 |
3299 | cmp al, 0 |
3300 | jz ukk_end |
3300 | jz ukk_end |
3301 | lea eax, [uins+ebx] |
3301 | lea eax, [uins+ebx] |
3302 | 3302 | ||
3303 | call strlen |
3303 | call strlen |
3304 | mov [buff+edx], al |
3304 | mov [buff+edx], al |
3305 | inc edx |
3305 | inc edx |
3306 | 3306 | ||
3307 | mov ecx, eax |
3307 | mov ecx, eax |
3308 | lea eax, [uins+ebx] ; Source |
3308 | lea eax, [uins+ebx] ; Source |
3309 | lea ebx, [buff+edx] |
3309 | lea ebx, [buff+edx] |
3310 | call strcpy |
3310 | call strcpy |
3311 | add edx, ecx |
3311 | add edx, ecx |
3312 | inc esi |
3312 | inc esi |
3313 | cmp esi, UINS |
3313 | cmp esi, UINS |
3314 | jz ukk_end |
3314 | jz ukk_end |
3315 | jmp ukk_loop |
3315 | jmp ukk_loop |
3316 | 3316 | ||
3317 | 3317 | ||
3318 | 3318 | ||
3319 | 3319 | ||
3320 | 3320 | ||
3321 | ukk_end: |
3321 | ukk_end: |
3322 | mov eax, ssnac |
3322 | mov eax, ssnac |
3323 | mov ebx, buff |
3323 | mov ebx, buff |
3324 | mov ecx, [socket] |
3324 | mov ecx, [socket] |
3325 | call sendsnac |
3325 | call sendsnac |
3326 | 3326 | ||
3327 | popad |
3327 | popad |
3328 | popf |
3328 | popf |
3329 | ret |
3329 | ret |
3330 | 3330 | ||
3331 | ; |
3331 | ; |
3332 | ; |
3332 | ; |
3333 | ; |
3333 | ; |
3334 | sendkeep: |
3334 | sendkeep: |
3335 | pushf |
3335 | pushf |
3336 | pushad |
3336 | pushad |
3337 | cmp [login], 2 |
3337 | cmp [login], 2 |
3338 | jnz @f |
3338 | jnz @f |
3339 | mov ax, [timer] |
3339 | mov ax, [timer] |
3340 | cmp ax, 300 ;60 c |
3340 | cmp ax, 300 ;60 c |
3341 | jb @f |
3341 | jb @f |
3342 | mov [timer], 0 |
3342 | mov [timer], 0 |
3343 | mov [flap.bId], FLAP_ID |
3343 | mov [flap.bId], FLAP_ID |
3344 | mov [flap.bCh], 5 ;Keep alive |
3344 | mov [flap.bCh], 5 ;Keep alive |
3345 | mov [flap.wDs], 0 |
3345 | mov [flap.wDs], 0 |
3346 | inc [seq] |
3346 | inc [seq] |
3347 | mov ax, [seq] |
3347 | mov ax, [seq] |
3348 | mov [flap.wSn], ax |
3348 | mov [flap.wSn], ax |
3349 | mov eax, flap |
3349 | mov eax, flap |
3350 | mov ebx, buff |
3350 | mov ebx, buff |
3351 | mov ecx, [socket] |
3351 | mov ecx, [socket] |
3352 | call sendflap |
3352 | call sendflap |
3353 | 3353 | ||
3354 | 3354 | ||
3355 | @@: |
3355 | @@: |
3356 | popad |
3356 | popad |
3357 | popf |
3357 | popf |
3358 | ret |
3358 | ret |
3359 | 3359 | ||
3360 | 3360 | ||
3361 | 3361 | ||
3362 | 3362 | ||
3363 | ; <--- initialised data ---> |
3363 | ; <--- initialised data ---> |
3364 | DATA |
3364 | DATA |
3365 | lsz header,\ |
3365 | lsz header,\ |
3366 | ru, "KI",\ |
3366 | ru, "KI",\ |
3367 | en, "KI",\ |
3367 | en, "KI",\ |
3368 | fr, "KI" |
3368 | fr, "KI" |
3369 | 3369 | ||
3370 | 3370 | ||
3371 | ; |
3371 | ; |
3372 | MESS db 'Message from ', 0 |
3372 | MESS db 'Message from ', 0 |
3373 | CUSER db 'Current user: ', 0 |
3373 | CUSER db 'Current user: ', 0 |
3374 | 3374 | ||
3375 | ; |
3375 | ; |
3376 | 3376 | ||
3377 | ;ICQ_IP = 0x0A00A8C0 ; 192.168.0.10 |
3377 | ;ICQ_IP = 0x0A00A8C0 ; 192.168.0.10 |
3378 | ICQ_IP = 0x99A10C40 |
3378 | ICQ_IP = 0x99A10C40 |
3379 | ; |
3379 | ; |
3380 | flap FLAP_head |
3380 | flap FLAP_head |
3381 | rflap FLAP_head |
3381 | rflap FLAP_head |
3382 | ; |
3382 | ; |
3383 | ssnac SNAC_head ; ¤«ï ¯¥à¥¤ ç¨ SNAC |
3383 | ssnac SNAC_head ; ¤«ï ¯¥à¥¤ ç¨ SNAC |
3384 | rsnac SNAC_head ; ¤«ï ¯à¨ï⮣® SNAC |
3384 | rsnac SNAC_head ; ¤«ï ¯à¨ï⮣® SNAC |
3385 | ; |
3385 | ; |
3386 | ui UI_head ; User info |
3386 | ui UI_head ; User info |
3387 | ; |
3387 | ; |
3388 | procinfo process_information |
3388 | procinfo process_information |
3389 | ; |
3389 | ; |
3390 | UIN db '123456789',0 |
3390 | UIN db '123456789',0 |
3391 | PASS db 'coolpass',0 |
3391 | PASS db 'coolpass',0 |
3392 | ID_STRING db 'ICQ Inc. - Product of ICQ (TM).2000b.4.65.1.3281.85',0 |
3392 | ID_STRING db 'ICQ Inc. - Product of ICQ (TM).2000b.4.65.1.3281.85',0 |
3393 | ;ID_STRING db 'ICQ Inc. - Product of ICQ (TM).2001b.5.17.1.3642.85',0 |
3393 | ;ID_STRING db 'ICQ Inc. - Product of ICQ (TM).2001b.5.17.1.3642.85',0 |
3394 | CAPABILITIES db 053h, 054h, 0, 0, 097h, 0B1h, 027h, 051h, 024h, 03Ch, 043h, 034h, 0ADh, 022h, 0D6h, 0ABh,\ |
3394 | CAPABILITIES db 053h, 054h, 0, 0, 097h, 0B1h, 027h, 051h, 024h, 03Ch, 043h, 034h, 0ADh, 022h, 0D6h, 0ABh,\ |
3395 | 0F7h, 03Fh, 014h, 092h, 02Eh, 07Ah, 064h, 075h, 0FAh, 0DFh, 04Dh, 0C8h, 088h, 06Fh, 0EAh, 035h,\ |
3395 | 0F7h, 03Fh, 014h, 092h, 02Eh, 07Ah, 064h, 075h, 0FAh, 0DFh, 04Dh, 0C8h, 088h, 06Fh, 0EAh, 035h,\ |
3396 | 095h, 0FDh, 0B6h, 0DFh, 09h, 046h, 013h, 044h, 04Ch, 07Fh, 011h, 0D1h, 082h, 022h, 044h, 045h,\ |
3396 | 095h, 0FDh, 0B6h, 0DFh, 09h, 046h, 013h, 044h, 04Ch, 07Fh, 011h, 0D1h, 082h, 022h, 044h, 045h,\ |
3397 | 053h, 054h, 0, 0 |
3397 | 053h, 054h, 0, 0 |
3398 | ; |
3398 | ; |
3399 | ; From &RQ |
3399 | ; From &RQ |
3400 | ; |
3400 | ; |
3401 | 3401 | ||
3402 | ;CAPABILITIES db 0x09, 0x46, 0x13, 0x49, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45,\ ;...P.F.IL.T"DE |
3402 | ;CAPABILITIES db 0x09, 0x46, 0x13, 0x49, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45,\ ;...P.F.IL.T"DE |
3403 | ; 0x53, 0x54, 0x00, 0x00, 0x09, 0x46, 0x13, 0x44, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45,\ ;ST...F.DL.T"DE |
3403 | ; 0x53, 0x54, 0x00, 0x00, 0x09, 0x46, 0x13, 0x44, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45,\ ;ST...F.DL.T"DE |
3404 | ; 0x53, 0x54, 0x00, 0x00, 0x09, 0x46, 0x13, 0x4E, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45,\ ;ST...F.NL.T"DE |
3404 | ; 0x53, 0x54, 0x00, 0x00, 0x09, 0x46, 0x13, 0x4E, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45,\ ;ST...F.NL.T"DE |
3405 | ; 0x53, 0x54, 0x00, 0x00, 0x09, 0x46, 0x00, 0x00, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45,\ ;ST...F..L.T"DE |
3405 | ; 0x53, 0x54, 0x00, 0x00, 0x09, 0x46, 0x00, 0x00, 0x4C, 0x7F, 0x11, 0xD1, 0x82, 0x22, 0x44, 0x45,\ ;ST...F..L.T"DE |
3406 | ; 0x53, 0x54, 0x00, 0x00, 0x26, 0x52, 0x51, 0x69, 0x6E, 0x73, 0x69, 0x64, 0x65, 0x02, 0x07, 0x09,\ ;ST..&RQinside... |
3406 | ; 0x53, 0x54, 0x00, 0x00, 0x26, 0x52, 0x51, 0x69, 0x6E, 0x73, 0x69, 0x64, 0x65, 0x02, 0x07, 0x09,\ ;ST..&RQinside... |
3407 | ; 0x00, 0x00, 0x00, 0x00 |
3407 | ; 0x00, 0x00, 0x00, 0x00 |
3408 | 3408 | ||
3409 | 3409 | ||
3410 | C_LEN = 40h |
3410 | C_LEN = 40h |
3411 | ;C_LEN = 80 |
3411 | ;C_LEN = 80 |
3412 | ICBM_PARAMS db 0, 0, 0, 0, 0, 0Bh, 01Fh, 040h, 3, 0E7h, 3, 0E7h, 0, 0, 0, 0 |
3412 | ICBM_PARAMS db 0, 0, 0, 0, 0, 0Bh, 01Fh, 040h, 3, 0E7h, 3, 0E7h, 0, 0, 0, 0 |
3413 | ICBMP_LEN = 16 ; ^^^ from &RQ |
3413 | ICBMP_LEN = 16 ; ^^^ from &RQ |
3414 | 3414 | ||
3415 | 3415 | ||
3416 | ; |
3416 | ; |
3417 | ; from &rq |
3417 | ; from &rq |
3418 | ; |
3418 | ; |
3419 | FAMILY_ARR db 0x00, 0x01, 0x00, 0x03, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x13, 0x00, 0x02, 0x01, 0x10, 0x04, 0x7B,\ |
3419 | FAMILY_ARR db 0x00, 0x01, 0x00, 0x03, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x13, 0x00, 0x02, 0x01, 0x10, 0x04, 0x7B,\ |
3420 | 0x00, 0x02, 0x00, 0x01, 0x01, 0x01, 0x04, 0x7B, 0x00, 0x03, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B,\ |
3420 | 0x00, 0x02, 0x00, 0x01, 0x01, 0x01, 0x04, 0x7B, 0x00, 0x03, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B,\ |
3421 | 0x00, 0x15, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x04, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B,\ |
3421 | 0x00, 0x15, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x04, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B,\ |
3422 | 0x00, 0x06, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x09, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B,\ |
3422 | 0x00, 0x06, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x09, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B,\ |
3423 | 0x00, 0x0A, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x10, 0x00, 0x01, 0x00, 0x10, 0x06, 0x6A |
3423 | 0x00, 0x0A, 0x00, 0x01, 0x01, 0x10, 0x04, 0x7B, 0x00, 0x10, 0x00, 0x01, 0x00, 0x10, 0x06, 0x6A |
3424 | 3424 | ||
3425 | 3425 | ||
3426 | 3426 | ||
3427 | 3427 | ||
3428 | 3428 | ||
3429 | FA_LEN = 50h |
3429 | FA_LEN = 50h |
3430 | 3430 | ||
3431 | ; |
3431 | ; |
3432 | ID_NUM = 010Ah |
3432 | ID_NUM = 010Ah |
3433 | MAJOR = 05h |
3433 | MAJOR = 05h |
3434 | ;MAJOR = 04h |
3434 | ;MAJOR = 04h |
3435 | ;MINOR = 041h |
3435 | ;MINOR = 041h |
3436 | MINOR = 011h |
3436 | MINOR = 011h |
3437 | LESSER = 01h |
3437 | LESSER = 01h |
3438 | ;BUILD = 0CD1h |
3438 | ;BUILD = 0CD1h |
3439 | BUILD = 0E3Ah |
3439 | BUILD = 0E3Ah |
3440 | DISTR = 055h |
3440 | DISTR = 055h |
3441 | TCB_ESTABLISHED = 4 |
3441 | TCB_ESTABLISHED = 4 |
3442 | TCB_CLOSED = 11 |
3442 | TCB_CLOSED = 11 |
3443 | ; |
3443 | ; |
3444 | CL_LANG db 'en',0 |
3444 | CL_LANG db 'en',0 |
3445 | CL_COUNTRY db 'us',0 |
3445 | CL_COUNTRY db 'us',0 |
3446 | 3446 | ||
3447 | 3447 | ||
3448 | sbuff db 1024 dup 0 ; ãä¥à ¤«ï ¯¥à¥¤ ç¨ ¨á¯®«ì§ã¥âáï ¢ãâਠsendflap |
3448 | sbuff db 1024 dup 0 ; ãä¥à ¤«ï ¯¥à¥¤ ç¨ ¨á¯®«ì§ã¥âáï ¢ãâਠsendflap |
3449 | 3449 | ||
3450 | rbuff db 1024 dup 0 ; ਥ¬ë© ¡ãä¥à |
3450 | rbuff db 1024 dup 0 ; ਥ¬ë© ¡ãä¥à |
3451 | tbuff db 512 dup 0 ; «ï TLV |
3451 | tbuff db 512 dup 0 ; «ï TLV |
3452 | srv_cookie db 512 dup 0 ; 㪨 ¤«ï ¢â®à¨§ 樨 |
3452 | srv_cookie db 512 dup 0 ; 㪨 ¤«ï ¢â®à¨§ 樨 |
3453 | bos_address db 128 dup 0 ; ¤à¥á BOS á¥à¢¥à |
3453 | bos_address db 128 dup 0 ; ¤à¥á BOS á¥à¢¥à |
3454 | cookie_len dw 0 ; «¨ ªãª¨ |
3454 | cookie_len dw 0 ; «¨ ªãª¨ |
3455 | seq dw 0 ; Sequence number |
3455 | seq dw 0 ; Sequence number |
3456 | bos_ip dd 0 |
3456 | bos_ip dd 0 |
3457 | bos_port dd 0 |
3457 | bos_port dd 0 |
3458 | status dw 0 ; status |
3458 | status dw 0 ; status |
3459 | 3459 | ||
3460 | mbuff db 2048 dup 0 ; «ï ¯à¨¥¬ |
3460 | mbuff db 2048 dup 0 ; «ï ¯à¨¥¬ |
3461 | MBUFF_SIZE = 2048 |
3461 | MBUFF_SIZE = 2048 |
3462 | 3462 | ||
3463 | hrf db 0 ; « £ ¯à¨¥¬ § £®«®¢ª |
3463 | hrf db 0 ; « £ ¯à¨¥¬ § £®«®¢ª |
3464 | 3464 | ||
3465 | mouse_flag dd 0 |
3465 | mouse_flag dd 0 |
3466 | socket dd 0 |
3466 | socket dd 0 |
3467 | login db 0 |
3467 | login db 0 |
3468 | 3468 | ||
3469 | msg_cookie1 dd 0 ; ᯮ«ì§ãîâáï ¤«ï ¯®â¢¥à¦¤¥¨ï ¯à¨¥¬ á®®¡é¥¨© |
3469 | msg_cookie1 dd 0 ; ᯮ«ì§ãîâáï ¤«ï ¯®â¢¥à¦¤¥¨ï ¯à¨¥¬ á®®¡é¥¨© |
3470 | msg_cookie2 dd 0 ; |
3470 | msg_cookie2 dd 0 ; |
3471 | 3471 | ||
3472 | curruser db 0 ; ⥪ã騩 ¯®«ì§®¢ ⥫ì, ª®â®à®¬ã ¡ã¤ãâ ®â¯à ¢«ïâìáï á®®¡é¥¨ï |
3472 | curruser db 0 ; ⥪ã騩 ¯®«ì§®¢ ⥫ì, ª®â®à®¬ã ¡ã¤ãâ ®â¯à ¢«ïâìáï á®®¡é¥¨ï |
3473 | ; - ®¬¥à ¢ ¯® ¯®à浪ã |
3473 | ; - ®¬¥à ¢ ¯® ¯®à浪ã |
3474 | 3474 | ||
3475 | 3475 | ||
3476 | timer dw 0 |
3476 | timer dw 0 |
3477 | 3477 | ||
3478 | ;ltest db "ADMIN",0 |
3478 | ;ltest db "ADMIN",0 |
3479 | 3479 | ||
3480 | 3480 | ||
3481 | 3481 | ||
3482 | ; |
3482 | ; |
3483 | ; EDITBOXES |
3483 | ; EDITBOXES |
3484 | ; |
3484 | ; |
3485 | inputbuff: |
3485 | inputbuff: |
3486 | rb 512 |
3486 | rb 512 |
3487 | 3487 | ||
3488 | inputbox edit_box 490,10,460,0xffffff,0x6a9480,0,0xAABBCC,0,511,inputbuff,ed_focus,0,0 |
3488 | inputbox edit_box 490,10,460,0xffffff,0x6a9480,0,0xAABBCC,0,511,inputbuff,ed_focus,0,0 |
3489 | 3489 | ||
3490 | 3490 | ||
3491 | ; <--- uninitialised data ---> |
3491 | ; <--- uninitialised data ---> |
3492 | UDATA |
3492 | UDATA |
3493 | 3493 | ||
3494 | 3494 | ||
3495 | MEOS_APP_END |
3495 | MEOS_APP_END |
3496 | ; <--- end of MenuetOS application --->--->--->--->--><--><<-->-->-->--EBX>--EAX>--AX>--EAX>-->-->-->-->-->-->-->-->-->-->-->-->-->-->=>--->--->--->---> |
3496 | ; <--- end of MenuetOS application --->--->--->--->--><--><<-->-->-->--EBX>--EAX>--AX>--EAX>-->-->-->-->-->-->-->-->-->-->-->-->-->-->=>--->--->--->---> |