Function at 0x404560
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Set socket configuration

Disassembly:
sub esp, 0x4a4
push ebx
push ebp
push esi
push edi
xor eax, eax
mov dword [esp + 0x25], eax
mov dword [esp + 0x29], eax
mov dword [esp + 0x2d], eax
mov dword [esp + 0x31], eax
mov dword [esp + 0x35], eax
mov dword [esp + 0x39], eax
mov dword [esp + 0x3d], eax
mov word [esp + 0x41], ax
mov byte [esp + 0x43], al
mov byte [esp + 0x44], al
xor ecx, ecx
xor edx, edx
mov dword [esp + 0x85], edx
mov dword [esp + 0x45], ecx
mov dword [esp + 0x65], eax
mov dword [esp + 0x69], eax
mov dword [esp + 0x89], edx
mov dword [esp + 0x6d], eax
mov dword [esp + 0x49], ecx
mov dword [esp + 0x8d], edx
mov dword [esp + 0x71], eax
mov dword [esp + 0x4d], ecx
mov dword [esp + 0x91], edx
mov dword [esp + 0x75], eax
mov dword [esp + 0x51], ecx
mov dword [esp + 0x95], edx
mov dword [esp + 0x79], eax
mov dword [esp + 0x55], ecx
mov dword [esp + 0x99], edx
mov dword [esp + 0x7d], eax
mov esi, dword [esp + 0x4bc]
mov dword [esp + 0x59], ecx
mov dword [esp + 0x9d], edx
mov word [esp + 0xa1], dx
mov word [esp + 0x81], ax
mov edi, dword [esp + 0x4c0]
mov dword [esp + 0x5d], ecx
mov word [esp + 0x61], cx
mov byte [esp + 0x83], al
mov eax, esi
mov byte [esp + 0xa3], dl
mov byte [esp + 0x64], dl
mov byte [esi + edi], dl
mov byte [esp + 0x24], 0
mov byte [esp + 0x63], cl
mov byte [esp + 0x84], cl
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404650
push 3
sub eax, edx
push 0x47b2d8
push eax
push esi
call fcn.0041b1d0
mov ebp, dword [esp + 0x4c8]
add esp, 0x10
test eax, eax
mov ebx, 1
je 0x404686
cmp dword [ebp + 0x28], ebx
jne 0x404686
mov dword [ebp + 0x28], 0
mov eax, esi
lea edx, [eax + 1]
jmp 0x404690
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404690
push 3
sub eax, edx
push 0x47b2d4
push eax
push esi
call fcn.0041b1d0
add esp, 0x10
test eax, eax
je 0x404e0a
mov esi, dword [esp + 0x4c0]
lea ecx, [esi + 1]
push ecx
call fcn.0044dffd
mov ecx, esi
mov edx, ecx
mov ebx, eax
shr ecx, 2
mov byte [ebx + esi], 0
mov esi, dword [esp + 0x4c0]
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, edx
add esp, 4
xor eax, eax
test ecx, ecx
jle 0x4046ff
lea esp, [esp]
cmp byte [ebx + eax], 0x2c
jne 0x4046fa
mov byte [ebx + eax], 0x20
inc eax
cmp eax, ecx
jl 0x4046f0
mov eax, ebx
xor esi, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404706
sub eax, edx
test eax, eax
jle 0x40472d
cmp byte [ebx + esi], 0x28
je 0x40472d
mov eax, ebx
inc esi
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404720
sub eax, edx
cmp esi, eax
jl 0x404713
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x6c]
push edx
lea eax, [esp + 0x90]
push eax
lea ecx, [esp + 0x54]
push ecx
lea edx, [esp + 0x38]
push edx
lea eax, [ebx + esi + 1]
push str._s__s__s__s__d__d
push eax
call fcn.0044e290
push ebx
call fcn.0044dee5
lea ebx, [ebp + 0x50]
add esp, 0x24
xor ecx, ecx
mov edx, ebx
mov dword [edx], ecx
mov dword [edx + 4], ecx
mov dword [edx + 8], ecx
mov dword [edx + 0xc], ecx
mov dword [edx + 0x10], ecx
mov dword [edx + 0x14], ecx
mov dword [edx + 0x18], ecx
lea eax, [esp + 0x24]
mov dword [edx + 0x1c], ecx
mov esi, eax
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404790
mov edi, ebx
sub eax, esi
dec edi
lea esp, [esp]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4047a0
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebx
dec edi
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4047c0
mov ax, word [0x47b11c]
mov word [edi], ax
lea eax, [esp + 0x44]
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4047d7
mov edi, ebx
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4047e3
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebx
dec edi
mov edi, edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x404800
mov cx, word [0x47b11c]
lea eax, [esp + 0x84]
mov word [edi], cx
mov edx, eax
jmp 0x404820
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404820
mov edi, ebx
sub eax, edx
dec edi
lea esp, [esp]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x404830
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebx
dec edi
jmp 0x404850
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x404850
mov dx, word [0x47b11c]
lea eax, [esp + 0x64]
mov word [edi], dx
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404868
mov edi, ebx
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x404874
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x1c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x20]
shl eax, 8
add eax, ecx
mov dword [ebp + 0x70], eax
cmp dword [ebp + 0x28], 1
jne 0x404c9a
mov ecx, dword [ebp]
mov al, byte [ecx + 0x10]
test al, al
je 0x4048fb
push str.Internet_FTP_connect_to_gate.
call fcn.00402a90
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 4]
push 1
push edx
push 0x438
push eax
call fcn.00401d30
mov edi, eax
add esp, 0x14
test edi, edi
jne 0x4048f2
push 2
push eax
call dword [sym.imp.WS2_32.dll_shutdown]
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4a4
ret
mov esi, dword [esp + 0x14]
mov dword [ebp + 0x20], edi
jmp 0x404949
push str.FTP_connect_to_gate.
call fcn.00402a90
mov ecx, dword [ebp]
mov edx, dword [ecx + 8]
mov ecx, dword [ebp + 0xc]
mov eax, dword [edx]
mov edx, dword [ebp + 8]
push 1
push ecx
mov ecx, dword [ebp + 4]
push edx
push ecx
push eax
call fcn.00401e90
mov esi, eax
add esp, 0x18
test esi, esi
jne 0x404942
push str.SSLTray:_FTP_active_connect_to_gate_failed.
call fcn.00402a90
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4a4
ret
mov edi, dword [esp + 0x14]
mov dword [ebp + 0x1c], esi
mov edx, dword [ebp]
mov byte [esp + 0x10], 0
mov al, byte [edx + 0x10]
test al, al
push 1
je 0x40496c
lea eax, [esp + 0x14]
push eax
push edi
mov byte [esp + 0x1c], 0
call fcn.0041b340
jmp 0x40497a
mov edx, dword [esi + 4]
lea ecx, [esp + 0x14]
push ecx
push edx
call fcn.0041b4c0
mov al, byte [ebp + 0x14]
mov ecx, dword [ebp]
mov byte [esp + 0x1c], al
mov al, byte [ecx + 0x10]
add esp, 0xc
test al, al
push 1
je 0x4049a2
lea edx, [esp + 0x14]
push edx
push edi
mov byte [esp + 0x1c], 0
call fcn.0041b340
jmp 0x4049b0
mov ecx, dword [esi + 4]
lea eax, [esp + 0x14]
push eax
push ecx
call fcn.0041b4c0
mov eax, ebx
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4049b8
sub eax, edx
lea edx, [esp + 0x10]
push edx
push eax
call fcn.0041bb20
mov eax, dword [ebp]
mov cl, byte [eax + 0x10]
add esp, 8
test cl, cl
push 4
je 0x404a03
lea ecx, [esp + 0x14]
push ecx
push edi
call fcn.0041b340
mov eax, ebx
add esp, 0xc
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4049f0
sub eax, edx
push eax
push ebx
push edi
call fcn.0041b340
jmp 0x404a34
mov eax, dword [esi + 4]
lea edx, [esp + 0x14]
push edx
push eax
call fcn.0041b4c0
mov eax, ebx
add esp, 0xc
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404a20
mov ecx, dword [esi + 4]
sub eax, edx
push eax
push ebx
push ecx
call fcn.0041b4c0
mov eax, dword [ebp + 0x70]
add esp, 0xc
lea edx, [esp + 0x10]
push edx
push eax
call fcn.0041bb20
mov ecx, dword [ebp]
mov al, byte [ecx + 0x10]
add esp, 8
test al, al
push 4
je 0x404a61
lea edx, [esp + 0x14]
push edx
push edi
call fcn.0041b340
jmp 0x404a6f
mov ecx, dword [esi + 4]
lea eax, [esp + 0x14]
push eax
push ecx
call fcn.0041b4c0
mov edx, dword [ebp]
mov al, byte [edx + 0x10]
add esp, 0xc
test al, al
mov eax, dword [ebp + 0x10]
lea edx, [eax + 1]
je 0x404ac3
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404a82
lea ecx, [esp + 0x10]
sub eax, edx
push ecx
push eax
call fcn.0041bb20
push 4
lea edx, [esp + 0x1c]
push edx
push edi
call fcn.0041b340
mov ecx, dword [ebp + 0x10]
mov eax, ecx
add esp, 0x14
lea esi, [eax + 1]
mov edi, edi
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x404ab0
sub eax, esi
push eax
push ecx
push edi
call fcn.0041b340
jmp 0x404b19
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404ac3
sub eax, edx
lea ecx, [esp + 0x10]
push ecx
add eax, 3
push eax
call fcn.0041bb20
mov eax, dword [esi + 4]
push 4
lea edx, [esp + 0x1c]
push edx
push eax
call fcn.0041b4c0
mov ecx, dword [esi + 4]
push 3
push 0x47b258
push ecx
call fcn.0041b4c0
mov ecx, dword [ebp + 0x10]
mov eax, ecx
add esp, 0x20
lea edi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x404b05
mov edx, dword [esi + 4]
sub eax, edi
push eax
push ecx
push edx
call fcn.0041b4c0
mov eax, str.200_PORT_command_successful.
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404b24
sub eax, edx
push eax
mov eax, dword [ebp]
mov ecx, dword [eax + 4]
push str.200_PORT_command_successful.
push ecx
call fcn.0041b340
mov eax, 0x47ad4c
add esp, 0xc
lea ecx, [eax + 1]
lea ebx, [ebx]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x404b50
mov edx, dword [ebp]
sub eax, ecx
push eax
mov eax, dword [edx + 4]
push 0x47ad4c
push eax
call fcn.0041b340
add esp, 0xc
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
mov dword [ebp + 0x18], eax
jne 0x404b9a
push str.SSLTray:_FTP_active_connect_to_client_create_failed.
call fcn.00402a90
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4a4
ret
xor ecx, ecx
mov cx, word [ebp + 0x4c]
mov word [esp + 0xa4], 2
push ecx
call dword [sym.imp.WS2_32.dll_htons]
lea edx, [ebp + 0x2c]
push edx
mov word [esp + 0xaa], ax
call dword [sym.imp.WS2_32.dll_inet_addr]
push str.FTP_port_mode_connect_to_client.
mov dword [esp + 0xac], eax
call fcn.00402a90
mov ecx, dword [ebp + 0x18]
add esp, 4
push 0x10
lea eax, [esp + 0xa8]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x404c3a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
lea edx, [esp + 0xb8]
push str.SSLTray:_FTP_active_connect_to_client_failed__d.
push edx
call fcn.0044dd9b
lea eax, [esp + 0xc0]
push eax
call fcn.00402a90
mov ecx, dword [ebp + 0x18]
add esp, 0x10
push 2
push ecx
call dword [sym.imp.WS2_32.dll_shutdown]
mov edx, dword [ebp + 0x18]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4a4
ret
mov ecx, dword [ebp + 0x18]
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
push 4
lea eax, [esp + 0x18]
push eax
push 1
push 6
push ecx
mov dword [esp + 0x28], 1
call esi
mov eax, dword [ebp + 0x18]
push 4
lea edx, [esp + 0x1c]
push edx
push 0x1006
push 0xffff
push eax
mov dword [esp + 0x2c], 0
call esi
mov edx, dword [ebp + 0x18]
push 4
lea ecx, [esp + 0x1c]
push ecx
push 0x1005
push 0xffff
push edx
call esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4a4
ret
push 0x4ac784
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, ebx
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404cb0
mov ecx, dword [ebp + 0x70]
push 1
push ecx
sub eax, edx
push eax
push ebx
call fcn.00408c50
add esp, 0x10
cmp eax, 0xffffffff
jne 0x404d8d
call fcn.00408a40
mov edx, eax
imul edx, edx, 0xb8
add edx, 0x4d4e30
xor eax, eax
mov ecx, 0x2e
mov edi, edx
rep stosd dword es:[edi], eax
mov eax, ebx
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404cf5
sub eax, esi
mov ecx, eax
shr ecx, 2
mov esi, ebx
lea edi, [edx + 0x44]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
mov eax, ebx
rep movsb byte es:[edi], byte [esi]
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404d16
sub eax, esi
mov dword [edx + 0x54], eax
mov dword [edx + 0x58], 0x20
mov ecx, dword [ebp + 0x70]
mov dword [edx + 0x68], ecx
mov eax, dword [ebp + 0x70]
mov dword [edx + 0x6c], eax
mov eax, 1
mov dword [edx + 0x5c], eax
mov ecx, dword [ebp + 0x14]
mov dword [edx + 0xb4], eax
mov dword [edx + 0x60], ecx
mov dword [edx + 0x64], 0
mov dword [edx + 0xb0], 6
mov esi, dword [ebp + 0x10]
mov eax, esi
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404d62
sub eax, edi
mov ecx, eax
shr ecx, 2
mov edi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp + 0x10]
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404d81
sub eax, esi
mov dword [edx + 0x40], eax
push 0x4ac784
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [sym.imp.WS2_32.dll_htons]
xor ecx, ecx
mov cx, word [ebp + 0x70]
push ecx
call esi
xor edx, edx
mov dx, word [ebp + 0x70]
push eax
push edx
call esi
push eax
push 0x20
push ebx
call dword [sym.imp.WS2_32.dll_inet_addr]
push eax
push 0
call fcn.00417980
mov edx, dword [esp + 0x4d0]
mov eax, edx
add esp, 0x14
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404dd2
sub eax, esi
push eax
mov eax, dword [ebp]
mov ecx, dword [eax + 4]
push edx
push ecx
call fcn.0041b340
mov edx, dword [ebp]
mov eax, dword [edx + 4]
push 2
push 0x47ad4c
push eax
call fcn.0041b340
add esp, 0x18
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4a4
ret
mov eax, esi
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404e10
push 3
sub eax, edx
push 0x47b1a4
push eax
push esi
call fcn.0041b1d0
add esp, 0x10
test eax, eax
jne 0x404e80
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404e33
push 3
sub eax, edx
push 0x47b1a0
push eax
push esi
call fcn.0041b1d0
add esp, 0x10
test eax, eax
jne 0x404e80
mov ecx, dword [ebp]
mov edx, dword [ecx + 4]
push edi
push esi
push edx
call fcn.0041b340
mov eax, dword [ebp]
mov ecx, dword [eax + 4]
push 2
push 0x47ad4c
push ecx
call fcn.0041b340
add esp, 0x18
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4a4
ret
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x404e85
sub eax, edx
mov edx, dword [ebp]
push eax
mov eax, dword [edx + 4]
push esi
push eax
call fcn.0041b340
mov ecx, dword [ebp]
mov edx, dword [ecx + 4]
push 2
push 0x47ad4c
push edx
call fcn.0041b340
mov eax, dword [ebp + 0x28]
add esp, 0x18
cmp eax, ebx
jne 0x404f92
cmp dword [ebp + 0x24], ebx
mov eax, dword [ebp + 0x14]
jne 0x404f31
test eax, eax
je 0x404ee4
mov eax, dword [ebp + 0x1c]
push eax
add ebp, 0x18
push ebp
call fcn.00415b90
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4a4
ret
push str.FTP_client_to_server_comes.
call fcn.00402a90
mov ecx, dword [ebp]
mov al, byte [ecx + 0x10]
add esp, 4
test al, al
je 0x404f16
lea edx, [ebp + 0x20]
push edx
add ebp, 0x18
push ebp
call fcn.00416020
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4a4
ret
mov eax, dword [ebp + 0x1c]
push eax
add ebp, 0x18
push ebp
call fcn.00415930
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4a4
ret
test eax, eax
je 0x404f50
mov edx, dword [ebp + 0x1c]
lea ecx, [ebp + 0x18]
push ecx
push edx
call fcn.00415d00
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4a4
ret
push str.FTP_server_to_client_comes.
call fcn.00402a90
mov eax, dword [ebp]
mov cl, byte [eax + 0x10]
add esp, 4
test cl, cl
je 0x404f82
lea ecx, [ebp + 0x18]
push ecx
add ebp, 0x20
push ebp
call fcn.00415eb0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4a4
ret
mov eax, dword [ebp + 0x1c]
lea edx, [ebp + 0x18]
push edx
push eax
call fcn.00415a90
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4a4
ret