Function at 0x4081a4
Capabilities:
Create tcp socket
Create udp socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x168
mov dword [ebp - 0x14c], ecx
mov dword [ebp - 0xc], str.internal_error
mov dword [esp + 8], 0
mov dword [esp + 4], 2
mov dword [esp], 2
call sub.WS2_32.dll_socket
sub esp, 0xc
mov edx, dword [ebp - 0x14c]
mov dword [edx + 4], eax
mov eax, dword [ebp - 0x14c]
mov dword [eax + 0x44], 0
mov eax, dword [ebp - 0x14c]
mov dword [eax + 0x40], 0
mov dword [ebp - 0x18], 1
mov eax, dword [ebp - 0x14c]
mov eax, dword [eax + 4]
mov dword [esp + 0x10], 4
lea edx, [ebp - 0x18]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x20
mov dword [esp + 4], 0xffff
mov dword [esp], eax
call sub.WS2_32.dll_setsockopt
sub esp, 0x14
test eax, eax
setne al
test al, al
je 0x408250
mov dword [esp], str.setsockopt
call sub.msvcrt.dll_perror
jmp 0x408426
mov dword [esp + 8], 0x10
mov dword [esp + 4], 0
lea eax, [ebp - 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_memset
mov word [ebp - 0x28], 2
mov dword [ebp - 0x24], 0
mov word [ebp - 0x26], 0
mov eax, dword [ebp - 0x14c]
mov eax, dword [eax + 4]
mov dword [esp + 8], 0x10
lea edx, [ebp - 0x28]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.WS2_32.dll_bind
sub esp, 0xc
cmp eax, 0xffffffff
sete al
test al, al
je 0x4082bc
mov dword [esp], 0x416805
call sub.msvcrt.dll_perror
jmp 0x408426
mov eax, dword [ebp - 0x14c]
mov ecx, eax
call fcn.00407f56
mov dword [esp], 0
call sub.msvcrt.dll_time
movzx edx, ax
mov eax, dword [ebp - 0x14c]
mov dword [eax + 0x48], edx
mov dword [ebp - 0x10], 0
jmp 0x408415
mov dword [ebp - 0x14], 0
jmp 0x4083ff
mov dword [ebp - 0x2c], 0x64
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov eax, dword [ebp - 0x14c]
mov edx, dword [ebp - 0x14]
mov dword [esp + 8], edx
mov dword [esp + 4], 0
mov dword [esp], 0
mov ecx, eax
call fcn.00407c3e
sub esp, 0xc
xor eax, 1
test al, al
je 0x408367
call sub.WS2_32.dll_WSAGetLastError
mov dword [esp + 4], eax
mov dword [esp], str.sendto_error__d_n
call sub.msvcrt.dll_printf
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
mov dword [esp], eax
call sub.msvcrt.dll_fflush
jmp 0x408426
mov eax, dword [ebp - 0x14c]
mov edx, dword [ebp - 0x14]
mov dword [esp + 0x10], edx
lea edx, [ebp - 0x2c]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 2
mov dword [esp + 4], 0x16
lea edx, [ebp - 0x42]
mov dword [esp], edx
mov ecx, eax
call fcn.00407c8e
sub esp, 0x14
not eax
shr eax, 0x1f
test al, al
je 0x4083fb
mov eax, dword [ebp - 0x30]
test eax, eax
jne 0x4083fb
cmp dword [ebp - 0x14], 0
je 0x4083e4
mov edx, dword [ebp - 0x14]
mov eax, edx
add eax, eax
add eax, edx
add eax, eax
mov edx, dword [ebp - 0x14c]
add eax, edx
lea edx, [eax + 8]
mov eax, dword [ebp - 0x14c]
add eax, 8
mov dword [esp + 8], 6
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0x14c]
mov dword [eax + 0x4c], 1
mov eax, 1
jmp 0x408481
add dword [ebp - 0x14], 1
mov eax, dword [ebp - 0x14c]
mov eax, dword [eax + 0x4c]
cmp eax, dword [ebp - 0x14]
ja 0x4082f9
add dword [ebp - 0x10], 1
cmp dword [ebp - 0x10], 2
jbe 0x4082ed
mov dword [ebp - 0xc], str.timed_out
mov eax, dword [ebp - 0x14c]
add eax, 0x38
mov dword [esp], eax
call fcn.00408d69
mov edx, dword [ebp - 0xc]
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], 0x5051
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.Could_not_connect_to__s__port__u_____s_
mov dword [esp + 4], 0x100
lea eax, [ebp - 0x142]
mov dword [esp], eax
call fcn.0040ec08
lea eax, [ebp - 0x142]
mov dword [esp], eax
mov ecx, dword [ebp + 8]
call fcn.004063c0
sub esp, 4
mov eax, 0
leave
ret 4