Function at 0x46fc40
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Send data
Send data on socket

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x718
push ebx
push ebp
push esi
push edi
mov esi, ecx
push eax
call fcn.00470a40
test eax, eax
je 0x46feb8
mov eax, dword [esi + 0x114]
or ecx, 0xffffffff
cmp eax, ecx
je 0x46feb8
mov ebp, str.TYPE_I_r_n
mov dword [esp + 0x10], 0xa
mov edx, ebp
test edx, edx
je 0x46feb8
mov edi, ebp
xor eax, eax
repne scasb al, byte es:[edi]
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
not ecx
dec ecx
mov edi, ecx
test edi, edi
jle 0x46fcd9
mov eax, dword [esi + 0x114]
push 0
push edi
push ebp
push eax
call sub.WS2_32.dll_send
cmp eax, 1
jge 0x46fcd1
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x46fcd9
mov eax, dword [esp + 0x10]
dec eax
mov dword [esp + 0x10], eax
js 0x46feb8
push 0x32
call ebx
jmp 0x46fcd5
add ebp, eax
sub edi, eax
test edi, edi
jg 0x46fc9b
push 0
call dword [sym.imp.MSVCRT.dll_time]
add esp, 4
lea ecx, [esp + 0x28]
mov dword [esi + 0x128], eax
push 0x1ff
push ecx
mov ecx, esi
call fcn.00470c70
cmp eax, 3
jle 0x46fd35
mov edi, dword [sym.imp.MSVCRT.dll_atoi]
cmp byte [esp + 0x2b], 0x2d
je 0x46fd1f
lea edx, [esp + 0x28]
push edx
call edi
add esp, 4
test eax, eax
jne 0x46fdad
lea eax, [esp + 0x28]
push 0x1ff
push eax
mov ecx, esi
call fcn.00470c70
cmp eax, 3
jg 0x46fd06
mov eax, dword [esi + 0x114]
or edi, 0xffffffff
cmp eax, edi
je 0x46fd5c
push 2
push eax
call sub.WS2_32.dll_shutdown
mov ecx, dword [esi + 0x114]
push ecx
call sub.WS2_32.dll_closesocket
mov dword [esi + 0x114], edi
mov eax, dword [esi + 0x118]
cmp eax, edi
je 0x46fd80
push 2
push eax
call sub.WS2_32.dll_shutdown
mov edx, dword [esi + 0x118]
push edx
call sub.WS2_32.dll_closesocket
mov dword [esi + 0x118], edi
push str.FTP:_read_answer_error
push 1
push 0x596558
mov dword [esi + 0x128], 0
call fcn.004aa400
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x718
ret 4
cmp eax, 0xc8
jne 0x46feb8
mov eax, dword [esi + 0x114]
mov byte [esp + 0x28], 0
cmp eax, 0xffffffff
mov ebp, str.PASV_r_n
mov ebx, 0xa
je 0x46fe9f
mov eax, ebp
test eax, eax
je 0x46fe9f
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ecx
test edi, edi
jle 0x46fe2c
mov ecx, dword [esi + 0x114]
push 0
push edi
push ebp
push ecx
call sub.WS2_32.dll_send
cmp eax, 1
jge 0x46fe24
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x46fe2c
dec ebx
js 0x46fe9f
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x46fe28
add ebp, eax
sub edi, eax
test edi, edi
jg 0x46fdf2
push 0
call dword [sym.imp.MSVCRT.dll_time]
add esp, 4
lea edx, [esp + 0x28]
mov ecx, esi
mov dword [esi + 0x128], eax
push 0x1ff
push edx
call fcn.00470c70
cmp eax, 3
jle 0x46fe84
mov ebx, dword [sym.imp.MSVCRT.dll_atoi]
cmp byte [esp + 0x2b], 0x2d
je 0x46fe6e
lea eax, [esp + 0x28]
push eax
call ebx
add esp, 4
test eax, eax
jne 0x46fec7
lea ecx, [esp + 0x28]
push 0x1ff
push ecx
mov ecx, esi
call fcn.00470c70
cmp eax, 3
jg 0x46fe59
mov ecx, esi
call fcn.0046f370
push str.FTP:_read_answer_error
push 1
push 0x596558
call fcn.004aa400
add esp, 0xc
lea ecx, [esp + 0x28]
push ecx
push str.FTP:_PASS_command_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, 0x718
ret 4
cmp eax, 0xe3
jne 0x46fe9f
xor edx, edx
lea eax, [esp + 0x18]
mov dword [esp + 0x18], edx
lea ecx, [esp + 0x28]
mov dword [esp + 0x1c], edx
push eax
mov dword [esp + 0x24], edx
push ecx
mov ecx, esi
mov dword [esp + 0x2c], edx
mov word [esp + 0x20], 2
call fcn.00470b90
test eax, eax
jne 0x46ff08
lea edx, [esp + 0x28]
push edx
push str.FTP:_PASV_mode_unexpected_reply___s_
jmp 0x46fea9
mov eax, dword [esi + 0x118]
or ebp, 0xffffffff
cmp eax, ebp
je 0x46ff1b
push eax
call sub.WS2_32.dll_closesocket
push 0
push 1
push 2
call sub.WS2_32.dll_socket
cmp eax, ebp
mov dword [esi + 0x118], eax
jne 0x46ff53
push str.FTP:_can_not_create_data_socket
push 1
push 0x596558
call fcn.004aa400
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x718
ret 4
lea ecx, [esp + 0x18]
push 0x10
push ecx
push eax
call sub.WS2_32.dll_connect
cmp eax, ebp
jne 0x46ff87
push str.FTP:_no_connection
push 1
push 0x596558
call fcn.004aa400
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x718
ret 4
mov edi, dword [esp + 0x72c]
push 0x5c
push edi
call dword [sym.imp.MSVCRT.dll_strrchr]
add esp, 8
test eax, eax
push 0xff
je 0x46ffaf
inc eax
lea edx, [esp + 0x22c]
push eax
push edx
jmp 0x46ffb8
lea eax, [esp + 0x22c]
push edi
push eax
call dword [sym.imp.MSVCRT.dll_strncpy]
mov ecx, str.STOR__s_r_n
add esp, 0xc
test ecx, ecx
mov byte [esp + 0x327], 0
je 0x4700c6
lea edx, [esp + 0x228]
test edx, edx
je 0x4700c6
lea eax, [esp + 0x228]
push eax
push ecx
lea ecx, [esp + 0x330]
push 0x3ff
push ecx
call dword [sym.imp.MSVCRT.dll__snprintf]
add esp, 0x10
lea edx, [esp + 0x328]
mov ecx, esi
push edx
call fcn.00470d10
test eax, eax
je 0x4700c6
lea eax, [esp + 0x28]
push 0x1ff
push eax
mov ecx, esi
call fcn.00470c70
cmp eax, 3
jle 0x470060
cmp byte [esp + 0x2b], 0x2d
je 0x47004a
lea ecx, [esp + 0x28]
push ecx
call ebx
add esp, 4
test eax, eax
jne 0x4700e9
lea edx, [esp + 0x28]
push 0x1ff
push edx
mov ecx, esi
call fcn.00470c70
cmp eax, 3
jg 0x470031
mov eax, dword [esi + 0x114]
cmp eax, ebp
je 0x470084
push 2
push eax
call sub.WS2_32.dll_shutdown
mov eax, dword [esi + 0x114]
push eax
call sub.WS2_32.dll_closesocket
mov dword [esi + 0x114], ebp
mov eax, dword [esi + 0x118]
cmp eax, ebp
je 0x4700a8
push 2
push eax
call sub.WS2_32.dll_shutdown
mov ecx, dword [esi + 0x118]
push ecx
call sub.WS2_32.dll_closesocket
mov dword [esi + 0x118], ebp
push str.FTP:_read_answer_error
push 1
push 0x596558
mov dword [esi + 0x128], 0
call fcn.004aa400
add esp, 0xc
push str.FTP:_STOR_command_failed
push 1
push 0x596558
call fcn.004aa400
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x718
ret 4
cmp eax, 0x96
jne 0x4700c6
mov edi, dword [esi + 0x11c]
test edi, edi
je 0x4701a0
mov ebp, dword [esi + 0x120]
test ebp, ebp
jle 0x4701a0
mov ebx, dword [esi + 0x118]
mov dword [esp + 0x14], 0xa
test edi, edi
mov dword [esp + 0x10], 0
je 0x47019b
test ebp, ebp
jl 0x47019b
cmp ebx, 0xffffffff
je 0x47019b
test ebp, ebp
jle 0x470184
cmp ebp, 0x8000
mov eax, 0x8000
jg 0x470142
mov eax, ebp
push 0
push eax
push edi
push ebx
call sub.WS2_32.dll_send
cmp eax, 1
jge 0x470172
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x470184
mov eax, dword [esp + 0x14]
dec eax
mov dword [esp + 0x14], eax
js 0x47019b
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x470180
mov ecx, dword [esp + 0x10]
sub ebp, eax
add edi, eax
add ecx, eax
mov dword [esp + 0x10], ecx
test ebp, ebp
jg 0x470133
push 0
call dword [sym.imp.MSVCRT.dll_time]
mov edi, dword [esp + 0x14]
add esp, 4
mov dword [esi + 0x128], eax
jmp 0x4701a2
or edi, 0xffffffff
jmp 0x4701a2
xor edi, edi
mov edx, dword [esi + 0x118]
push edx
call sub.WS2_32.dll_closesocket
test edi, edi
mov dword [esi + 0x118], 0xffffffff
jl 0x47021e
lea eax, [esp + 0x28]
push 0x1ff
push eax
mov ecx, esi
call fcn.00470c70
cmp eax, 3
jle 0x470203
mov edi, dword [sym.imp.MSVCRT.dll_atoi]
cmp byte [esp + 0x2b], 0x2d
je 0x4701ed
lea ecx, [esp + 0x28]
push ecx
call edi
add esp, 4
test eax, eax
jne 0x470230
lea edx, [esp + 0x28]
push 0x1ff
push edx
mov ecx, esi
call fcn.00470c70
cmp eax, 3
jg 0x4701d8
mov ecx, esi
call fcn.0046f370
push str.FTP:_read_answer_error
push 1
push 0x596558
call fcn.004aa400
add esp, 0xc
lea eax, [esp + 0x228]
push eax
push str.FTP:__s_failed
jmp 0x46fea9
cmp eax, 0xe2
jne 0x47021e
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x718
ret 4