Function at 0x4064c0
Capabilities:
Create udp socket
Get hostname
Resolve dns
Set socket configuration

Disassembly:
sub esp, 0xa0
push esi
push edi
mov esi, ecx
push str.About_to_open_a_UDP_socket_n
call fcn.00401450
add esp, 4
push 0
push 2
push 2
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [esi + 4], eax
jne 0x4064f7
pop edi
xor al, al
pop esi
add esp, 0xa0
ret 0xc
push eax
push str.Socket__d_opened_OK_n
call fcn.00401450
mov edi, dword [esp + 0xb4]
add esp, 8
mov word [esp + 0x18], 2
push edi
call sub.WSOCK32.dll_htons
mov word [esp + 0x1a], ax
mov eax, dword [esp + 0xb4]
push eax
call sub.WSOCK32.dll_htonl
push edi
push str.About_to_bind_the_UDP_socket_to_port__d_n
mov dword [esp + 0x24], eax
call fcn.00401450
mov edx, dword [esi + 4]
add esp, 8
lea ecx, [esp + 0x18]
push 0x10
push ecx
push edx
call sub.WSOCK32.dll_bind
cmp eax, 0xffffffff
jne 0x4065f5
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.bind_failed_with_error_code__d_n
call fcn.00401450
mov eax, dword [esi + 8]
mov ecx, dword [esi + 4]
push eax
push ecx
push str.Closing_socket__d_bound_to_port__d_n
call fcn.00401450
mov eax, dword [esi + 0x20]
add esp, 0x14
test eax, eax
je 0x4065bc
mov edx, dword [esi + 0x14]
mov eax, dword [edx]
push eax
call fcn.00407530
mov eax, dword [esi + 0x20]
add esp, 4
test eax, eax
jle 0x4065b5
lea ecx, [eax - 1]
xor eax, eax
test ecx, ecx
mov dword [esi + 0x20], ecx
jle 0x4065b5
mov ecx, dword [esi + 0x14]
inc eax
mov edx, dword [ecx + eax*4]
mov dword [ecx + eax*4 - 4], edx
mov ecx, dword [esi + 0x20]
cmp eax, ecx
jl 0x4065a3
mov eax, dword [esi + 0x20]
test eax, eax
jne 0x406582
mov eax, dword [esi + 4]
cmp eax, 0xffffffff
je 0x4065e8
push eax
call sub.WSOCK32.dll_closesocket
test eax, eax
je 0x4065e1
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.closesocket_failed_with_error_code__d_n
call fcn.00401450
add esp, 8
mov dword [esi + 4], 0xffffffff
pop edi
xor al, al
pop esi
add esp, 0xa0
ret 0xc
push str.Socket_bound_OK_n
call fcn.00401450
mov eax, dword [esp + 0xb4]
push str.About_to_query_the_host_name_n
mov dword [esi + 8], edi
mov dword [esi + 0xc], eax
call fcn.00401450
add esp, 8
lea ecx, [esp + 0x28]
push 0x80
push ecx
call sub.WSOCK32.dll_gethostname
test eax, eax
jne 0x40663e
lea edx, [esp + 0x28]
push edx
push str.Host_name_is__s_n
call fcn.00401450
add esp, 8
push str.About_to_call_gethostbyname_n
call fcn.00401450
add esp, 4
lea eax, [esp + 0x28]
push eax
call sub.WSOCK32.dll_gethostbyname
mov edi, eax
test edi, edi
jne 0x40666e
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.gethostbyname_failed__Error_code__d_n
call fcn.00401450
add esp, 8
mov eax, dword [esi + 0x20]
test eax, eax
je 0x4066af
mov ecx, dword [esi + 0x14]
mov edx, dword [ecx]
push edx
call fcn.00407530
mov eax, dword [esi + 0x20]
add esp, 4
test eax, eax
jle 0x4066a8
lea ecx, [eax - 1]
xor eax, eax
test ecx, ecx
mov dword [esi + 0x20], ecx
jle 0x4066a8
mov ecx, dword [esi + 0x14]
inc eax
mov edx, dword [ecx + eax*4]
mov dword [ecx + eax*4 - 4], edx
mov ecx, dword [esi + 0x20]
cmp eax, ecx
jl 0x406696
mov eax, dword [esi + 0x20]
test eax, eax
jne 0x406675
mov edi, dword [edi + 0xc]
mov dword [esp + 8], edi
mov eax, dword [edi]
test eax, eax
je 0x406752
push ebx
push ebp
lea edi, [esi + 0x10]
mov ebx, dword [eax]
mov edx, dword [esp + 0x10]
mov eax, ebx
add edx, 4
shr eax, 0x18
mov dword [esp + 0x18], ebx
mov dword [esp + 0x10], edx
xor ecx, ecx
push eax
mov cl, byte [esp + 0x1e]
xor edx, edx
mov eax, ebx
mov dl, bh
push ecx
and eax, 0xff
push edx
push eax
push str.Found_local_address:__d._d._d._d_n
call fcn.00401450
push 4
call fcn.0040753b
mov ebp, eax
add esp, 0x18
mov dword [ebp], ebx
mov eax, dword [edi + 8]
cmp dword [edi + 0x10], eax
jl 0x406733
mov cl, byte [edi + 0xd]
test cl, cl
jne 0x40671c
test eax, eax
jne 0x406742
mov ecx, dword [edi + 0x14]
test ecx, ecx
jle 0x406742
mov edx, dword [edi]
add ecx, eax
push 0
push ecx
mov ecx, edi
call dword [edx + 8]
test al, al
je 0x406742
mov eax, dword [edi + 0x10]
mov edx, dword [edi + 4]
lea ecx, [eax + 1]
mov dword [edi + 0x10], ecx
mov dword [edx + eax*4], ebp
mov eax, dword [esp + 0x10]
mov eax, dword [eax]
test eax, eax
jne 0x4066c5
pop ebp
pop ebx
mov edx, dword [esi + 4]
lea ecx, [esp + 0xc]
push 4
push ecx
push 0x80
xor eax, eax
push 0xffff
push edx
mov word [esp + 0x20], ax
mov word [esp + 0x22], ax
call sub.WSOCK32.dll_setsockopt
mov eax, dword [esi + 4]
push 4
push 0x4114f4
push 0x1002
push 0xffff
push eax
call sub.WSOCK32.dll_setsockopt
cmp eax, 0xffffffff
jne 0x4067ac
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.Failed_to_set_socket_option_SO_RCVBUF___error_code__d._n
call fcn.00401450
add esp, 8
jmp 0x4067b9
push str.Socket_option_SO_RCVBUF_set_OK_n
call fcn.00401450
add esp, 4
mov ecx, dword [esi + 4]
push 4
push 0x4114f0
push 0x1001
push 0xffff
push ecx
call sub.WSOCK32.dll_setsockopt
cmp eax, 0xffffffff
jne 0x4067ed
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.Failed_to_set_socket_option_SO_SNDBUF___error_code__d._n
call fcn.00401450
add esp, 8
jmp 0x4067fa
push str.Socket_option_SO_SNDBUF_set_OK_n
call fcn.00401450
add esp, 4
mov eax, dword [esi + 4]
lea edx, [esp + 0x14]
push edx
push 0x8004667e
push eax
mov dword [esp + 0x20], 1
call sub.WSOCK32.dll_ioctlsocket
test eax, eax
je 0x40682c
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.Failed_to_set_socket_to_non_blocking___error_code__d._n
call fcn.00401450
add esp, 8
push str.UDP_Socket_init_complete_n
call fcn.00401450
add esp, 4
mov al, 1
pop edi
pop esi
add esp, 0xa0
ret 0xc