Function at 0x40bcea
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push 0x10
push 0
lea eax, [ebp - 0x2c]
push eax
call fcn.0041b260
add esp, 0xc
mov word [ebp - 0x2c], 2
mov ecx, dword [ebp + 8]
and ecx, 0xffff
imul ecx, ecx, 0xb8
mov edx, dword [0x4477e4]
mov ax, word [edx + ecx + 0x13]
mov word [ebp - 0x2a], ax
mov ecx, dword [ebp + 8]
and ecx, 0xffff
imul ecx, ecx, 0xb8
mov edx, dword [0x4477e4]
mov eax, dword [edx + ecx + 0xf]
mov dword [ebp - 0x28], eax
push 0
push 1
push 2
call sub.WSOCK32.dll_socket
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0xffffffff
jne 0x40bd62
mov ecx, dword [ebp - 4]
push ecx
call sub.WSOCK32.dll_closesocket
jmp 0x40bf9a
push 0x7d00
push 0x7d00
mov edx, dword [ebp - 4]
push edx
call fcn.00417636
add esp, 0xc
test eax, eax
jne 0x40bda8
call sub.WSOCK32.dll_WSAGetLastError
mov dword [ebp - 8], eax
mov eax, dword [ebp - 4]
push eax
call sub.WSOCK32.dll_closesocket
mov ecx, dword [ebp - 8]
push ecx
push str.Reconnect_Config_socket_error_
mov dx, word [ebp + 8]
push edx
call fcn.00404ce9
add esp, 0xc
jmp 0x40bf9a
push 0x10
push 0
lea eax, [ebp - 0x1c]
push eax
call fcn.0041b260
add esp, 0xc
mov word [ebp - 0x1c], 2
mov ecx, dword [ebp + 8]
and ecx, 0xffff
imul ecx, ecx, 0xb8
mov edx, dword [0x4477e4]
mov ax, word [edx + ecx + 0xa]
mov word [ebp - 0x1a], ax
mov ecx, dword [ebp + 8]
and ecx, 0xffff
imul ecx, ecx, 0xb8
mov edx, dword [0x4477e4]
mov eax, dword [edx + ecx + 6]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp + 8]
and ecx, 0xffff
imul ecx, ecx, 0xb8
mov edx, dword [0x4477e4]
mov eax, dword [ebp - 4]
mov dword [edx + ecx + 2], eax
push 0
push 0x42d3e0
mov cx, word [ebp + 8]
push ecx
call fcn.00404ba1
add esp, 0xc
push 0x10
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [ebp + 8]
and eax, 0xffff
imul eax, eax, 0xb8
mov ecx, dword [0x4477e4]
mov edx, dword [ecx + eax + 2]
push edx
call sub.WSOCK32.dll_connect
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
jne 0x40bf8d
call sub.WSOCK32.dll_WSAGetLastError
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0x2733
je 0x40be85
mov eax, dword [ebp - 8]
push eax
push str.TCPl
mov cx, word [ebp + 8]
push ecx
call fcn.00404ce9
add esp, 0xc
jmp 0x40bf9a
mov edx, dword [ebp + 8]
and edx, 0xffff
imul edx, edx, 0xb8
mov eax, dword [0x4477e4]
mov ecx, dword [eax + edx + 0x17]
mov byte [ecx + 5], 4
push 0x447b60
call fcn.00415bf6
add esp, 4
push 0x447800
mov edx, dword [ebp + 8]
and edx, 0xffff
imul edx, edx, 0xb8
mov eax, dword [0x4477e4]
mov ecx, dword [eax + edx + 2]
push ecx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
jne 0x40bf16
cmp dword [0x447800], 0x40
jae 0x40bf10
mov edx, dword [ebp + 8]
and edx, 0xffff
imul edx, edx, 0xb8
mov eax, dword [0x447800]
mov ecx, dword [0x4477e4]
mov edx, dword [ecx + edx + 2]
mov dword [eax*4 + 0x447804], edx
mov eax, dword [0x447800]
add eax, 1
mov dword [0x447800], eax
xor ecx, ecx
test ecx, ecx
jne 0x40bed5
push 0x447a40
mov edx, dword [ebp + 8]
and edx, 0xffff
imul edx, edx, 0xb8
mov eax, dword [0x4477e4]
mov ecx, dword [eax + edx + 2]
push ecx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
jne 0x40bf7e
cmp dword [0x447a40], 0x40
jae 0x40bf78
mov edx, dword [ebp + 8]
and edx, 0xffff
imul edx, edx, 0xb8
mov eax, dword [0x447a40]
mov ecx, dword [0x4477e4]
mov edx, dword [ecx + edx + 2]
mov dword [eax*4 + 0x447a44], edx
mov eax, dword [0x447a40]
add eax, 1
mov dword [0x447a40], eax
xor ecx, ecx
test ecx, ecx
jne 0x40bf3d
push 0x447b60
call fcn.00415c05
add esp, 4
jmp 0x40bf9a
mov dx, word [ebp + 8]
push edx
call fcn.0040b5ad
add esp, 4
mov esp, ebp
pop ebp
ret