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

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0x40
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x14]
mov word [ebp - 0x1c], dx
mov word [ebp - 0x20], ax
call sub.msvcrt.dll__errno
mov dword [eax], 0
mov dword [esp], 0
call sub.WS2_32.dll_WSASetLastError
sub esp, 4
movzx eax, word [0x40c084]
test ax, ax
je 0x402e31
mov dword [esp + 8], 0x11
mov dword [esp + 4], 2
mov dword [esp], 2
call sub.WS2_32.dll_socket
sub esp, 0xc
mov dword [0x40c124], eax
jmp 0x402e55
mov dword [esp + 8], 6
mov dword [esp + 4], 1
mov dword [esp], 2
call sub.WS2_32.dll_socket
sub esp, 0xc
mov dword [0x40c124], eax
mov eax, dword [0x40c124]
test eax, eax
jns 0x402e6a
mov dword [esp], str.Cant_get_socket
call fcn.004025c9
mov eax, dword [0x40c124]
test eax, eax
jne 0x402e85
mov eax, dword [0x40c124]
mov dword [esp], eax
call sub.msvcrt.dll__dup
mov dword [0x40c124], eax
mov eax, dword [0x40c130]
mov edx, dword [0x40c124]
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], eax
mov dword [esp + 8], 4
mov dword [esp + 4], 0xffff
mov dword [esp], edx
call sub.WS2_32.dll_setsockopt
sub esp, 0x14
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x402eca
mov dword [esp], str.nnetfd_reuseaddr_failed
call fcn.00402513
mov eax, dword [0x40c05c]
mov word [eax], 2
mov eax, dword [0x40c060]
mov word [eax], 2
cmp dword [ebp + 0x10], 0
je 0x402ef3
mov eax, dword [0x40c05c]
lea edx, [eax + 4]
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
mov dword [edx], eax
cmp word [ebp - 0x20], 0
je 0x402f13
mov ebx, dword [0x40c05c]
movzx eax, word [ebp - 0x20]
mov dword [esp], eax
call sub.WS2_32.dll_htons
sub esp, 4
mov word [ebx + 2], ax
mov ebx, 0
cmp dword [ebp + 0x10], 0
jne 0x402f29
cmp word [ebp - 0x20], 0
je 0x402fc5
movzx eax, word [ebp - 0x20]
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], 4
jmp 0x402fb5
mov eax, dword [0x40c05c]
mov edx, dword [0x40c124]
mov dword [esp + 8], 0x10
mov dword [esp + 4], eax
mov dword [esp], edx
call sub.WS2_32.dll_bind
sub esp, 0xc
mov ebx, eax
test ebx, ebx
je 0x402fc1
call sub.msvcrt.dll__errno
mov eax, dword [eax]
cmp eax, 0x2740
jne 0x402fc4
movzx esi, word [ebp - 0x20]
mov eax, dword [0x40c05c]
mov eax, dword [eax + 4]
mov dword [esp], eax
call sub.WS2_32.dll_inet_ntoa
sub esp, 4
mov dword [esp + 8], esi
mov dword [esp + 4], eax
mov dword [esp], str.retrying_local__s:_d
call fcn.00402513
mov dword [esp], 1
call sub.msvcrt.dll__sleep
call sub.msvcrt.dll__errno
mov dword [eax], 0
sub dword [ebp - 0xc], 1
cmp dword [ebp - 0xc], 0
jg 0x402f39
jmp 0x402fc5
nop
jmp 0x402fc5
nop
test ebx, ebx
je 0x402ff4
movzx ebx, word [ebp - 0x20]
mov eax, dword [0x40c05c]
mov eax, dword [eax + 4]
mov dword [esp], eax
call sub.WS2_32.dll_inet_ntoa
sub esp, 4
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov dword [esp], str.Cant_grab__s:_d_with_bind
call fcn.004025c9
movzx eax, word [0x40c07c]
test ax, ax
je 0x40300a
mov eax, dword [0x40c124]
jmp 0x403112
mov eax, dword [0x40c060]
lea edx, [eax + 4]
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [edx], eax
mov ebx, dword [0x40c060]
movzx eax, word [ebp - 0x1c]
mov dword [esp], eax
call sub.WS2_32.dll_htons
sub esp, 4
mov word [ebx + 2], ax
mov eax, dword [0x40c044]
test eax, eax
je 0x403047
mov dword [esp], str.Warning:_source_routing_unavailable_on_this_machine__ignoring
call fcn.00402513
mov eax, dword [0x40c088]
mov dword [esp + 4], eax
mov dword [esp], 1
call fcn.004026c9
mov dword [esp], 0x40c0e0
call sub.msvcrt.dll__setjmp
test eax, eax
jne 0x403092
mov eax, dword [0x40c060]
mov edx, dword [0x40c124]
mov dword [esp + 8], 0x10
mov dword [esp + 4], eax
mov dword [esp], edx
call sub.WS2_32.dll_connect
sub esp, 0xc
mov ebx, eax
jmp 0x4030a6
mov ebx, 0xffffffff
mov dword [esp], 0x274c
call sub.WS2_32.dll_WSASetLastError
sub esp, 4
mov dword [esp + 4], 0
mov dword [esp], 0
call fcn.004026c9
test ebx, ebx
jne 0x4030c5
mov eax, dword [0x40c124]
jmp 0x403112
call sub.msvcrt.dll__errno
mov ebx, eax
call sub.WS2_32.dll_WSAGetLastError
mov dword [ebx], eax
mov eax, dword [0x40c124]
mov dword [esp + 4], 2
mov dword [esp], eax
call sub.WS2_32.dll_shutdown
sub esp, 8
mov eax, dword [0x40c124]
mov dword [esp], eax
call sub.WS2_32.dll_closesocket
sub esp, 4
call sub.msvcrt.dll__errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.WS2_32.dll_WSASetLastError
sub esp, 4
mov eax, 0xffffffff
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret