Function at 0x40ec40
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Get socket status
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x368
mov eax, dword [0x47a540]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0x10]
lea eax, [ebp - 0xa3]
push esi
mov esi, dword [ebp + 0xc]
push edi
mov edi, dword [ebp + 8]
push 0x63
push 0
push eax
mov byte [ebp - 0xa4], 0
call fcn.004143a0
push 0x10
push esi
mov dword [ebp - 0x35c], 1
call fcn.0040aef0
add esp, 0x14
test eax, eax
lea eax, [ebp - 0x108]
push 0x64
je 0x40ecd6
push esi
push eax
call fcn.0040b920
push 0x14
lea eax, [ebp - 0x18]
push ebx
push eax
call fcn.0040b920
push 0x64
lea eax, [ebp - 0xa4]
push esi
push eax
call fcn.0040b920
lea eax, [ebp - 0x108]
push eax
call fcn.0040b040
lea eax, [ebp - 0xa4]
push eax
call fcn.0040b040
add esp, 0x2c
jmp 0x40ed22
push edi
push eax
call fcn.0040b920
push 0x14
lea eax, [ebp - 0x18]
push ebx
push eax
call fcn.0040b920
push 0x64
lea eax, [ebp - 0xa4]
push edi
push eax
call fcn.0040b920
lea eax, [ebp - 0x108]
push eax
call fcn.0040b040
lea eax, [ebp - 0xa4]
push eax
call fcn.0040b040
push 0x64
lea eax, [ebp - 0xa4]
push eax
push edi
call fcn.00407ef0
add esp, 0x38
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x108]
push eax
push str._etc_silentm_translate_translate__s:_s.txt
lea eax, [ebp - 0x31c]
push 0xc8
push eax
call fcn.00401120
lea eax, [ebp - 0x31c]
push eax
lea eax, [ebp - 0x1d0]
push 0x64
push eax
call fcn.0040dd70
add esp, 0x20
test eax, eax
jle 0x40ee0e
lea eax, [ebp - 0x1d0]
push eax
call fcn.0040b080
push 0x64
lea eax, [ebp - 0x1d0]
push eax
lea eax, [ebp - 0x16c]
push eax
call fcn.0040b920
lea eax, [ebp - 0x16c]
push 0x3a
push eax
call fcn.0040b400
push 0x3a
push 0x14
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x1d0]
push eax
call fcn.0040a4c0
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x16c]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x108]
push eax
push str.SystemSocketConnect___Translation_found__s:_s_to__s:_s
push 0x46b2c8
push 4
push 3
call fcn.00406fa0
add esp, 0x48
lea eax, [ebp - 0x16c]
push 0x64
push eax
lea eax, [ebp - 0xa4]
push eax
call fcn.0040b920
push 0x64
lea eax, [ebp - 0x16c]
push eax
lea eax, [ebp - 0x108]
push eax
call fcn.0040b920
push 0x14
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.0040b920
add esp, 0x24
mov ebx, dword [sym.imp.WSOCK32.dll_inet_addr]
mov eax, 2
mov word [ebp - 0x254], ax
xorps xmm0, xmm0
lea eax, [ebp - 0xa4]
movlpd qword [ebp - 0x24c], xmm0
push eax
call ebx
mov dword [ebp - 0x250], eax
lea eax, [ebp - 0x18]
push eax
call fcn.0043b12a
add esp, 4
push eax
call dword [sym.imp.WSOCK32.dll_htons]
push str.sockets
mov word [ebp - 0x252], ax
call fcn.00407300
add esp, 4
test eax, eax
je 0x40ee86
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0xa4]
push eax
push str.SystemSocketConnect_to__s_port__s
push 0x46b2c8
push 2
push 3
call fcn.00406fa0
add esp, 0x18
push 0
push 1
push 2
call dword [sym.imp.WSOCK32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40eebb
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.SystemSocketConnect_error__d_opening_socket.
push 0x46b2c8
push 1
push 3
call fcn.00406fa0
add esp, 0x14
jmp 0x40f156
push str.sockets
mov dword [ebp - 0x360], 1
call fcn.00407300
add esp, 4
test eax, eax
je 0x40eeec
push str.SystemSocketConnect_Initiating_connect
push 0x46b2c8
push 0
push 3
call fcn.00406fa0
add esp, 0x10
push 0x64
lea eax, [ebp - 0x234]
push eax
push str.BIND_ADDRESS
push 0
call fcn.00409eb0
add esp, 0x10
test eax, eax
jne 0x40f01f
push 0x14
lea eax, [ebp - 0x2c]
push eax
push str.BIND_PORT
push 0
call fcn.00409eb0
add esp, 0x10
test eax, eax
je 0x40ef37
push 0x14
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x2c]
push eax
call fcn.0040b920
add esp, 0xc
mov eax, 2
xorps xmm0, xmm0
mov word [ebp - 0x244], ax
lea eax, [ebp - 0x234]
push eax
movlpd qword [ebp - 0x23c], xmm0
call ebx
mov dword [ebp - 0x240], eax
lea eax, [ebp - 0x2c]
push eax
call fcn.0043b12a
add esp, 4
push eax
call dword [sym.imp.WSOCK32.dll_htons]
push 4
mov word [ebp - 0x242], ax
lea eax, [ebp - 0x35c]
push eax
push 4
push 0xffff
push esi
call dword [sym.imp.WSOCK32.dll_setsockopt]
test eax, eax
jns 0x40efc9
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.SystemSocketConnect_REUSE_error__d
push 0x46b2c8
push 1
push 3
call fcn.00406fa0
push esi
call fcn.0040ec10
add esp, 0x18
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041305e
mov esp, ebp
pop ebp
ret
push 0x10
lea eax, [ebp - 0x244]
push eax
push esi
call dword [sym.imp.WSOCK32.dll_bind]
test eax, eax
jns 0x40f01f
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x234]
push eax
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.SystemSocketConnect_bind_error__d_BIND_ADDRESS_s_BIND_PORT_s
push 0x46b2c8
push 3
push 3
call fcn.00406fa0
push esi
call fcn.0040ec10
add esp, 0x20
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041305e
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x360]
push eax
push 0x8004667e
push esi
call dword [sym.imp.WSOCK32.dll_ioctlsocket]
cmp eax, 0xffffffff
jne 0x40f048
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.SystemSocketConnect_FIONBIO_error__d.
jmp 0x40eea5
push 0x10
lea eax, [ebp - 0x254]
push eax
push esi
call dword [sym.imp.WSOCK32.dll_connect]
cmp eax, 0xffffffff
jne 0x40f159
mov ebx, dword [sym.imp.WSOCK32.dll_WSAGetLastError]
call ebx
cmp eax, 0x2733
je 0x40f0a0
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x108]
push eax
push edi
call ebx
push eax
push str.SystemSocketConnect_error__d_initiating_connect_to__s__s__s.
push 0x46b2c8
push 4
push 3
call fcn.00406fa0
push esi
call fcn.0040ec10
add esp, 0x24
jmp 0x40f156
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x368], eax
lea eax, [ebp - 0x368]
push eax
push 0
lea eax, [ebp - 0x358]
mov dword [ebp - 0x364], 0
push eax
push 0
lea eax, [esi + 1]
mov dword [ebp - 0x354], esi
push eax
mov dword [ebp - 0x358], 1
call dword [sym.imp.WSOCK32.dll_select]
test eax, eax
jle 0x40f12e
lea eax, [ebp - 0x358]
push eax
push esi
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x40f12e
push str.sockets
call fcn.00407300
add esp, 4
test eax, eax
je 0x40f159
push str.Connection_established.
push 0x46b2c8
push 0
push 3
call fcn.00406fa0
add esp, 0x10
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041305e
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x108]
push eax
push edi
push str.SystemSocketConnect_timeout_on_connect_node_s_ip_s_port_s.
push 0x46b2c8
push 3
push 3
call fcn.00406fa0
push esi
call fcn.0040ec10
add esp, 0x20
or esi, 0xffffffff
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0041305e
mov esp, ebp
pop ebp
ret