Function at 0x10057b60
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x43c
mov eax, dword [0x1020c6f4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov ecx, 0x103b202b
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [ebp - 0x43c], eax
call fcn.1000602d
xor eax, eax
mov dword [ebp - 0x438], 1
mov dword [ebp - 0x430], eax
cmp dword [esi + 0x18], eax
jne 0x10057dc9
mov eax, dword [ebp + 0x14]
cmp eax, 1
je 0x10057bda
cmp eax, 2
je 0x10057bda
push eax
lea eax, [esi + 0x44]
push str.Invalid_direction__d_n
push eax
call fcn.10006b22
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10003260
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0x10]
cmp eax, 0x41
je 0x10057c0d
cmp eax, 0x49
je 0x10057c0d
push eax
lea eax, [esi + 0x44]
push str.Invalid_mode__c_n
push eax
call fcn.10006b22
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10003260
mov esp, ebp
pop ebp
ret
call fcn.100057d1
cmp dword [esi + 0x24], 1
mov dword [ebp - 0x434], 0x10
jne 0x10057d4e
push esi
xorps xmm0, xmm0
mov eax, 2
push 0x32
push 0x1020b680
movlpd qword [ebp - 0x424], xmm0
mov word [ebp - 0x42c], ax
call fcn.10058140
add esp, 0xc
test eax, eax
je 0x10057c72
push str._ERR__FtpOpenPort__FtpSendCmd_PASV_Error_Found_______________________________________
call fcn.10003837
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10003260
mov esp, ebp
pop ebp
ret
lea eax, [esi + 0x44]
push 0x28
push eax
call fcn.10001ffa
add esp, 8
test eax, eax
je 0x10057dc9
lea ecx, [ebp - 0x418]
inc eax
push ecx
lea ecx, [ebp - 0x41c]
push ecx
lea ecx, [ebp - 0x408]
push ecx
lea ecx, [ebp - 0x40c]
push ecx
lea ecx, [ebp - 0x410]
push ecx
lea ecx, [ebp - 0x414]
push ecx
push 0x1020b6e0
push eax
call fcn.100060eb
movzx eax, byte [ebp - 0x414]
add esp, 0x20
mov byte [ebp - 0x428], al
movzx eax, byte [ebp - 0x410]
mov byte [ebp - 0x427], al
movzx eax, byte [ebp - 0x40c]
mov byte [ebp - 0x426], al
movzx eax, byte [ebp - 0x408]
mov byte [ebp - 0x425], al
movzx eax, byte [ebp - 0x41c]
mov byte [ebp - 0x42a], al
movzx eax, byte [ebp - 0x418]
mov byte [ebp - 0x429], al
push 6
push 1
push 2
call sub.WS2_32.dll_socket
mov edi, eax
cmp edi, 0xffffffff
jne 0x10057d92
cmp dword [sym.Restore.dll_ftplib_debug], 0
je 0x10057dc9
push str.socket
call fcn.1000270c
add esp, 4
or eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10003260
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x434]
push eax
lea eax, [ebp - 0x42c]
push eax
push dword [esi + 8]
call sub.WS2_32.dll_getsockname
test eax, eax
jns 0x10057d0f
cmp dword [sym.Restore.dll_ftplib_debug], 0
je 0x10057dc9
push 0x1020b6f4
call fcn.1000270c
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10003260
mov esp, ebp
pop ebp
ret
push 4
lea eax, [ebp - 0x438]
push eax
push 4
push 0xffff
push edi
call sub.WS2_32.dll_setsockopt
cmp eax, 0xffffffff
jne 0x10057ddd
cmp dword [sym.Restore.dll_ftplib_debug], 0
je 0x10057dc3
push 0x1020b708
call fcn.1000270c
add esp, 4
push edi
call sub.WS2_32.dll_closesocket
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10003260
mov esp, ebp
pop ebp
ret
push 4
lea eax, [ebp - 0x430]
push eax
push 0x80
push 0xffff
push edi
call sub.WS2_32.dll_setsockopt
cmp eax, 0xffffffff
jne 0x10057e0b
cmp dword [sym.Restore.dll_ftplib_debug], 0
je 0x10057dc3
push str.setsockopt
jmp 0x10057dbb
call fcn.100057d1
cmp dword [esi + 0x24], 1
push 0x10
jne 0x10057e47
lea eax, [ebp - 0x42c]
push eax
push edi
call sub.WS2_32.dll_connect
cmp eax, 0xffffffff
jne 0x10057f13
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [sym.Restore.dll_ftplib_debug], 0
je 0x10057dc3
push str.connect
jmp 0x10057dbb
xor eax, eax
mov word [ebp - 0x42a], ax
lea eax, [ebp - 0x42c]
push eax
push edi
call sub.WS2_32.dll_bind
cmp eax, 0xffffffff
jne 0x10057e79
cmp dword [sym.Restore.dll_ftplib_debug], 0
je 0x10057dc3
push str.bind
jmp 0x10057dbb
push 1
push edi
call sub.WS2_32.dll_listen
test eax, eax
jns 0x10057e9c
cmp dword [sym.Restore.dll_ftplib_debug], 0
je 0x10057dc3
push str.listen
jmp 0x10057dbb
lea eax, [ebp - 0x434]
push eax
lea eax, [ebp - 0x42c]
push eax
push edi
call sub.WS2_32.dll_getsockname
test eax, eax
js 0x10057dc9
movzx eax, byte [ebp - 0x429]
push eax
movzx eax, byte [ebp - 0x42a]
push eax
movzx eax, byte [ebp - 0x425]
push eax
movzx eax, byte [ebp - 0x426]
push eax
movzx eax, byte [ebp - 0x427]
push eax
movzx eax, byte [ebp - 0x428]
push eax
lea eax, [ebp - 0x404]
push str.PORT__d__d__d__d__d__d
push eax
call fcn.10006b22
push esi
lea eax, [ebp - 0x404]
push 0x32
push eax
call fcn.10058140
add esp, 0x2c
test eax, eax
jne 0x10057dc3
push 0x444
push 1
call fcn.1000358f
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x10057f3e
cmp dword [sym.Restore.dll_ftplib_debug], eax
je 0x10057dc3
push 0x1020b750
jmp 0x10057dbb
cmp dword [ebp + 0x10], 0x41
jne 0x10057f90
push 0x2000
call fcn.100015f0
add esp, 4
mov dword [ebx + 0x14], eax
test eax, eax
jne 0x10057f90
cmp dword [sym.Restore.dll_ftplib_debug], eax
je 0x10057f6d
push str.calloc
call fcn.1000270c
add esp, 4
push edi
call sub.WS2_32.dll_closesocket
push ebx
call fcn.10004435
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10003260
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0x14]
mov dword [ebx + 8], edi
mov dword [ebx + 0x18], eax
mov ecx, dword [esi + 0x28]
mov edx, dword [esi + 0x2c]
mov dword [ebx + 0x28], ecx
mov dword [ebx + 0x2c], edx
mov eax, dword [esi + 0x34]
mov dword [ebx + 0x34], eax
mov dword [ebx + 0x38], 0
mov dword [ebx + 0x40], 0
mov eax, dword [esi + 0x3c]
mov dword [ebx + 0x3c], eax
test ecx, ecx
jne 0x10057fea
test edx, edx
jne 0x10057fea
test eax, eax
jne 0x10057fea
mov dword [ebx + 0x30], eax
mov eax, dword [ebp - 0x43c]
pop edi
pop esi
mov dword [eax], ebx
lea eax, [ecx + 1]
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10003260
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x30]
mov ecx, dword [ebp - 4]
mov dword [ebx + 0x30], eax
xor ecx, ebp
mov eax, dword [ebp - 0x43c]
pop edi
pop esi
mov dword [eax], ebx
mov eax, 1
pop ebx
call fcn.10003260
mov esp, ebp
pop ebp
ret