Function at 0x46f4d0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get hostname
Resolve dns
Send data
Send data on socket

Disassembly:
sub esp, 0x614
push ebx
mov ebx, dword [esp + 0x61c]
push ebp
push esi
test ebx, ebx
push edi
mov ebp, ecx
mov dword [esp + 0x10], 0x15
je 0x46fa21
lea eax, [esp + 0x24]
push 0x1ff
push eax
call sub.WS2_32.dll_gethostname
lea ecx, [esp + 0x24]
push ecx
call sub.WS2_32.dll_gethostbyname
test eax, eax
je 0x46f52d
movsx ecx, word [eax + 0xa]
mov edx, dword [eax + 0xc]
mov eax, ecx
lea edi, [ebp + 0x108]
mov esi, dword [edx]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp + 0x114]
or esi, 0xffffffff
cmp eax, esi
je 0x46f554
push 2
push eax
call sub.WS2_32.dll_shutdown
mov ecx, dword [ebp + 0x114]
push ecx
call sub.WS2_32.dll_closesocket
mov dword [ebp + 0x114], esi
mov eax, dword [ebp + 0x118]
cmp eax, esi
je 0x46f578
push 2
push eax
call sub.WS2_32.dll_shutdown
mov edx, dword [ebp + 0x118]
push edx
call sub.WS2_32.dll_closesocket
mov dword [ebp + 0x118], esi
mov ecx, 0x41
mov esi, ebx
mov edi, ebp
mov dword [ebp + 0x128], 0
push 0x581840
push ebp
rep movsd dword es:[edi], dword [esi]
call dword [sym.imp.MSVCRT.dll_strstr]
add esp, 8
test eax, eax
je 0x46f5b4
mov edi, dword [sym.imp.MSVCRT.dll_atoi]
mov byte [eax], 0
inc eax
push eax
call edi
add esp, 4
mov esi, eax
jmp 0x46f5be
mov edi, dword [sym.imp.MSVCRT.dll_atoi]
mov esi, dword [esp + 0x10]
push 6
push 1
push 2
call sub.WS2_32.dll_socket
or ebx, 0xffffffff
mov dword [ebp + 0x114], eax
cmp eax, ebx
je 0x46fa21
xor eax, eax
push ebp
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
call sub.WS2_32.dll_inet_addr
cmp eax, ebx
jne 0x46f612
push ebp
call sub.WS2_32.dll_gethostbyname
test eax, eax
jne 0x46f60b
push ebp
push str.FTP:_cannot_determine_host_address___s_
jmp 0x46fa12
mov ecx, dword [eax + 0xc]
mov edx, dword [ecx]
mov eax, dword [edx]
push esi
mov dword [esp + 0x1c], eax
mov word [esp + 0x18], 2
call sub.WS2_32.dll_htons
mov edx, dword [ebp + 0x114]
lea ecx, [esp + 0x14]
push 0x10
push ecx
push edx
mov word [esp + 0x22], ax
call sub.WS2_32.dll_connect
test eax, eax
jge 0x46f64a
push ebp
push str.FTP:_no_connection___s_
jmp 0x46fa12
lea eax, [esp + 0x24]
push 0x1ff
push eax
mov ecx, ebp
call fcn.00470c70
cmp eax, 3
jle 0x46f68b
cmp byte [esp + 0x27], 0x2d
je 0x46f675
lea ecx, [esp + 0x24]
push ecx
call edi
add esp, 4
test eax, eax
jne 0x46f6f3
lea edx, [esp + 0x24]
push 0x1ff
push edx
mov ecx, ebp
call fcn.00470c70
cmp eax, 3
jg 0x46f660
mov eax, dword [ebp + 0x114]
cmp eax, ebx
je 0x46f6af
push 2
push eax
call sub.WS2_32.dll_shutdown
mov eax, dword [ebp + 0x114]
push eax
call sub.WS2_32.dll_closesocket
mov dword [ebp + 0x114], ebx
mov eax, dword [ebp + 0x118]
cmp eax, ebx
je 0x46f6d3
push 2
push eax
call sub.WS2_32.dll_shutdown
mov ecx, dword [ebp + 0x118]
push ecx
call sub.WS2_32.dll_closesocket
mov dword [ebp + 0x118], ebx
push str.FTP:_read_answer_error
push 1
push 0x596558
mov dword [ebp + 0x128], 0
call fcn.004aa400
add esp, 0xc
jmp 0x46f6fa
cmp eax, 0xdc
je 0x46f723
lea edx, [esp + 0x24]
push edx
push ebp
push str.FTP:_invalid_answer___s_____s
push 1
push 0x596558
call fcn.004aa400
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x614
ret 4
mov ecx, str.USER__s_r_n
lea eax, [ebp + 0x80]
test ecx, ecx
je 0x46fa21
test eax, eax
je 0x46fa21
push eax
push ecx
lea edx, [esp + 0x22c]
push 0x3ff
push edx
call dword [sym.imp.MSVCRT.dll__snprintf]
mov eax, dword [ebp + 0x114]
or ecx, 0xffffffff
add esp, 0x10
cmp eax, ecx
lea ebx, [esp + 0x224]
mov dword [esp + 0x10], 0xa
je 0x46fa21
lea eax, [esp + 0x224]
test eax, eax
je 0x46fa21
lea edi, [esp + 0x224]
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov esi, ecx
test esi, esi
jle 0x46f7db
mov ecx, dword [ebp + 0x114]
push 0
push esi
push ebx
push ecx
call sub.WS2_32.dll_send
cmp eax, 1
jge 0x46f7d3
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x46f7db
mov eax, dword [esp + 0x10]
dec eax
mov dword [esp + 0x10], eax
js 0x46fa21
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x46f7d7
add ebx, eax
sub esi, eax
test esi, esi
jg 0x46f799
push 0
call dword [sym.imp.MSVCRT.dll_time]
add esp, 4
lea edx, [esp + 0x24]
mov ecx, ebp
mov dword [ebp + 0x128], eax
push 0x1ff
push edx
call fcn.00470c70
cmp eax, 3
jle 0x46f835
cmp byte [esp + 0x27], 0x2d
je 0x46f81f
lea eax, [esp + 0x24]
push eax
call dword [sym.imp.MSVCRT.dll_atoi]
add esp, 4
test eax, eax
jne 0x46f8a0
lea ecx, [esp + 0x24]
push 0x1ff
push ecx
mov ecx, ebp
call fcn.00470c70
cmp eax, 3
jg 0x46f802
mov eax, dword [ebp + 0x114]
or esi, 0xffffffff
cmp eax, esi
je 0x46f85c
push 2
push eax
call sub.WS2_32.dll_shutdown
mov edx, dword [ebp + 0x114]
push edx
call sub.WS2_32.dll_closesocket
mov dword [ebp + 0x114], esi
mov eax, dword [ebp + 0x118]
cmp eax, esi
je 0x46f880
push 2
push eax
call sub.WS2_32.dll_shutdown
mov eax, dword [ebp + 0x118]
push eax
call sub.WS2_32.dll_closesocket
mov dword [ebp + 0x118], esi
push str.FTP:_read_answer_error
push 1
push 0x596558
mov dword [ebp + 0x128], 0
call fcn.004aa400
add esp, 0xc
jmp 0x46f8ae
cmp eax, 0x14b
je 0x46f8d6
cmp eax, 0xe6
je 0x46f8d6
lea ecx, [esp + 0x24]
push ecx
push str.FTP:_login_failed____s
push 1
push 0x596558
call fcn.004aa400
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x614
ret 4
mov edx, str.PASS__s_r_n
lea eax, [ebp + 0xc0]
test edx, edx
je 0x46fa21
test eax, eax
je 0x46fa21
push eax
push edx
lea eax, [esp + 0x22c]
push 0x3ff
push eax
call dword [sym.imp.MSVCRT.dll__snprintf]
mov eax, dword [ebp + 0x114]
or ecx, 0xffffffff
add esp, 0x10
cmp eax, ecx
lea ebx, [esp + 0x224]
mov dword [esp + 0x10], 0xa
je 0x46fa21
lea edx, [esp + 0x224]
test edx, edx
je 0x46fa21
lea edi, [esp + 0x224]
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov esi, ecx
test esi, esi
jle 0x46f98e
mov eax, dword [ebp + 0x114]
push 0
push esi
push ebx
push eax
call sub.WS2_32.dll_send
cmp eax, 1
jge 0x46f986
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x46f98e
mov eax, dword [esp + 0x10]
dec eax
mov dword [esp + 0x10], eax
js 0x46fa21
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x46f98a
add ebx, eax
sub esi, eax
test esi, esi
jg 0x46f94c
push 0
call dword [sym.imp.MSVCRT.dll_time]
add esp, 4
lea ecx, [esp + 0x24]
mov dword [ebp + 0x128], eax
push 0x1ff
push ecx
mov ecx, ebp
call fcn.00470c70
cmp eax, 3
jle 0x46f9e4
cmp byte [esp + 0x27], 0x2d
je 0x46f9ce
lea edx, [esp + 0x24]
push edx
call dword [sym.imp.MSVCRT.dll_atoi]
add esp, 4
test eax, eax
jne 0x46fa01
lea eax, [esp + 0x24]
push 0x1ff
push eax
mov ecx, ebp
call fcn.00470c70
cmp eax, 3
jg 0x46f9b5
mov ecx, ebp
call fcn.0046f370
push str.FTP:_read_answer_error
push 1
push 0x596558
call fcn.004aa400
add esp, 0xc
jmp 0x46fa08
cmp eax, 0xe6
je 0x46fa30
lea ecx, [esp + 0x24]
push ecx
push str.FTP:_login_failed____s
push 1
push 0x596558
call fcn.004aa400
add esp, 0x10
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x614
ret 4
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x614
ret 4