Rev 9092 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9092 | Rev 9979 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;; Written by hidnplayr@kolibrios.org ;; |
6 | ;; Written by hidnplayr@kolibrios.org ;; |
7 | ;; ;; |
7 | ;; ;; |
8 | ;; GNU GENERAL PUBLIC LICENSE ;; |
8 | ;; GNU GENERAL PUBLIC LICENSE ;; |
Line 12... | Line 12... | ||
12 | 12 | ||
Line 13... | Line 13... | ||
13 | 13 | ||
- | 14 | server_parser: |
|
Line 14... | Line 15... | ||
14 | server_parser: |
15 | |
15 | 16 | mov esi, servercommand |
|
Line 16... | Line 17... | ||
16 | mov esi, servercommand |
17 | mov ebx, ecx |
Line 25... | Line 26... | ||
25 | cmp al, ' ' |
26 | cmp al, ' ' |
26 | jne .spaceloop |
27 | jne .spaceloop |
Line 27... | Line 28... | ||
27 | 28 | ||
28 | .parse: |
29 | .parse: |
29 | mov eax, [esi] |
30 | mov eax, [esi] |
30 | or eax, 0x20202020 |
31 | or eax, 0x20202020 ; convert to lowercase |
31 | mov edi, server_commands |
32 | mov edi, server_commands |
Line 32... | Line 33... | ||
32 | mov ecx, server_commands.number |
33 | mov ecx, server_commands.number |
33 | 34 | ||
Line 40... | Line 41... | ||
40 | 41 | ||
41 | .fail: |
42 | .fail: |
Line 42... | Line 43... | ||
42 | ret |
43 | ret |
- | 44 | ||
43 | 45 | .got_cmd: |
|
Line 44... | Line 46... | ||
44 | .got_cmd: |
46 | mov ecx, ebx |
Line 230... | Line 232... | ||
230 | cmd_ping: |
232 | cmd_ping: |
Line 231... | Line 233... | ||
231 | 233 | ||
232 | ; Just change PING to PONG |
234 | ; Just change PING to PONG |
Line 233... | Line 235... | ||
233 | mov dword[esi], 'PONG' |
235 | mov dword[esi], 'PONG' |
234 | 236 | ||
235 | ; Find the end of the command |
- | |
236 | lea edi, [esi + 5] |
- | |
Line 237... | Line 237... | ||
237 | xor al, al |
237 | ; Append \r\n |
238 | repne scasb |
238 | mov word[esi+ecx], 0x0a0d |
239 | - | ||
240 | ; Now send it back |
- | |
241 | mov edx, esi |
- | |
242 | mov esi, edi |
- | |
243 | mov word [esi], 0x0d0a |
239 | |
244 | inc esi |
240 | ; And send the response to the server |
Line 245... | Line 241... | ||
245 | inc esi |
241 | mov edx, esi |