From 008436f41e28857e8b9a34ccd4cf03d3d641513a Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Fri, 12 Jul 2013 09:58:26 +0000 Subject: [PATCH] FTPc: use after commands instead of just git-svn-id: svn://kolibrios.org@3814 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/network/ftpc/ftpc.asm | 7 +++--- programs/network/ftpc/usercommands.inc | 31 ++++++++++++++++---------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/programs/network/ftpc/ftpc.asm b/programs/network/ftpc/ftpc.asm index b93822e4aa..1c746d2881 100644 --- a/programs/network/ftpc/ftpc.asm +++ b/programs/network/ftpc/ftpc.asm @@ -271,7 +271,8 @@ wait_for_usercommand: mov ecx, 256 xor al, al repne scasb - lea esi, [edi-s-1] + lea esi, [edi-s] + mov word[edi-2], 0x0a0d ; and send it to the server mcall send, [socketnum], s, , 0 @@ -286,8 +287,8 @@ open_dataconnection: ; only passive for now.. jne .fail mov dword[s], "PASV" - mov byte[s+4], 10 - mcall send, [socketnum], s, 5, 0 + mov word[s+4], 0x0a0d + mcall send, [socketnum], s, 6, 0 ret .fail: diff --git a/programs/network/ftpc/usercommands.inc b/programs/network/ftpc/usercommands.inc index 8d25c746b9..27ccce1e85 100644 --- a/programs/network/ftpc/usercommands.inc +++ b/programs/network/ftpc/usercommands.inc @@ -14,8 +14,9 @@ cmd_bye: cmd_pwd: - mov dword[s], "PWD" + 10 shl 24 - mcall send, [socketnum], s, 4, 0 + mov dword[s], "PWD" + 13 shl 24 + mov byte[s+4], 10 + mcall send, [socketnum], s, 5, 0 jmp wait_for_servercommand @@ -27,7 +28,8 @@ cmd_cwd: xor al, al mov edi, s repne scasb - lea esi, [edi - s - 1] + lea esi, [edi - s] + mov word [edi - 2], 0x0a0d mcall send, [socketnum], s, , 0 @@ -42,7 +44,8 @@ cmd_dele: xor al, al mov edi, s repne scasb - lea esi, [edi - s - 1] + lea esi, [edi - s] + mov word [edi - 2], 0x0a0d mcall send, [socketnum], s, , 0 @@ -55,8 +58,8 @@ cmd_list: mov [operation], OPERATION_LIST mov dword[s], "LIST" - mov byte[s+4], 0x0a - mcall send, [socketnum], s, 5, 0 + mov word[s+4], 0x0a0d + mcall send, [socketnum], s, 6, 0 jmp wait_for_servercommand @@ -91,7 +94,8 @@ cmd_retr: xor al, al mov edi, s repne scasb - lea esi, [edi - s - 1] + lea esi, [edi - s] + mov word [edi - 2], 0x0a0d mcall send, [socketnum], s, , 0 jmp wait_for_servercommand @@ -121,7 +125,8 @@ cmd_stor: xor al, al mov edi, s repne scasb - lea esi, [edi - s - 1] + lea esi, [edi - s] + mov word [edi - 2], 0x0a0d mcall send, [socketnum], s, , 0 jmp wait_for_servercommand @@ -152,8 +157,8 @@ cmd_lcwd: cmd_cdup: mov dword[s], "CDUP" - mov byte[s+4], 0x0a - mcall send, [socketnum], s, 5, 0 + mov word[s+4], 0x0d0a + mcall send, [socketnum], s, 6, 0 jmp wait_for_servercommand @@ -165,7 +170,8 @@ cmd_rmd: xor al, al mov edi, s repne scasb - lea esi, [edi - s - 1] + lea esi, [edi - s] + mov word [edi - 2], 0x0a0d mcall send, [socketnum], s, , 0 @@ -179,7 +185,8 @@ cmd_mkd: xor al, al mov edi, s repne scasb - lea esi, [edi - s - 1] + lea esi, [edi - s] + mov word [edi - 2], 0x0a0d mcall send, [socketnum], s, , 0