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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x78
mov dword [ebp - 0x5c], ecx
mov eax, dword [ebp - 0x5c]
mov ecx, eax
call fcn.004142fc
mov eax, dword [ebp - 0x5c]
mov dword [eax], 0x419e08
mov eax, dword [ebp - 0x5c]
add eax, 0x10
mov ecx, eax
call fcn.00413e2c
mov eax, dword [ebp - 0x5c]
mov dword [eax + 0x1c], 0
mov eax, dword [ebp - 0x5c]
mov dword [eax + 0x20], 0
mov eax, dword [ebp - 0x5c]
mov edx, dword [ebp + 8]
mov dword [eax + 0x24], edx
mov eax, dword [ebp - 0x5c]
mov edx, dword [ebp + 0xc]
mov dword [eax + 0x28], edx
mov eax, dword [ebp - 0x5c]
mov dword [eax + 0x2c], 0xffffffff
mov eax, dword [ebp - 0x5c]
mov dword [eax + 0x30], 0
mov eax, dword [ebp - 0x5c]
mov byte [eax + 0x34], 0
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 - 0x5c]
mov dword [edx + 8], eax
mov eax, dword [ebp - 0x5c]
mov eax, dword [eax + 8]
cmp eax, 0xffffffff
jne 0x40a60b
mov dword [esp], 0x416b18
call sub.msvcrt.dll_perror
jmp 0x40a7fc
mov word [ebp - 0x1c], 2
mov dword [esp], 0x162e
call sub.WS2_32.dll_htons
sub esp, 4
mov word [ebp - 0x1a], ax
mov dword [ebp - 0x18], 0
mov eax, dword [ebp - 0x5c]
mov eax, dword [eax + 8]
mov dword [esp + 8], 0x10
lea edx, [ebp - 0x1c]
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 0x40a666
mov dword [esp], str.bind
call sub.msvcrt.dll_perror
jmp 0x40a7fc
mov dword [ebp - 0x20], 1
mov eax, dword [ebp - 0x5c]
mov eax, dword [eax + 8]
mov dword [esp + 0x10], 4
lea edx, [ebp - 0x20]
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
mov dword [esp + 8], 0
mov dword [esp + 4], 2
mov dword [esp], 0x17
call sub.WS2_32.dll_socket
sub esp, 0xc
mov edx, dword [ebp - 0x5c]
mov dword [edx + 0xc], eax
mov eax, dword [ebp - 0x5c]
mov eax, dword [eax + 0xc]
cmp eax, 0xffffffff
je 0x40a7fc
mov word [ebp - 0x3c], 0x17
mov dword [esp], 0x162e
call sub.WS2_32.dll_htons
sub esp, 4
mov word [ebp - 0x3a], ax
mov dword [ebp - 0x24], 0
mov dword [esp + 8], 0x10
mov dword [esp + 4], 0
lea eax, [ebp - 0x3c]
add eax, 8
mov dword [esp], eax
call sub.msvcrt.dll_memset
mov eax, dword [ebp - 0x5c]
mov eax, dword [eax + 0xc]
mov dword [esp + 8], 0x1c
lea edx, [ebp - 0x3c]
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 0x40a765
mov dword [esp], str.bind6
call sub.msvcrt.dll_perror
mov eax, dword [ebp - 0x5c]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.WS2_32.dll_closesocket
sub esp, 4
mov eax, dword [ebp - 0x5c]
mov dword [eax + 0xc], 0xffffffff
jmp 0x40a7fc
mov dword [esp + 8], 0x14
mov dword [esp + 4], 0
lea eax, [ebp - 0x50]
mov dword [esp], eax
call sub.msvcrt.dll_memset
lea eax, [ebp - 0x50]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
mov byte [eax], 0xff
mov eax, dword [ebp - 0xc]
add eax, 1
mov byte [eax], 2
mov eax, dword [ebp - 0xc]
add eax, 0xf
mov byte [eax], 1
mov eax, dword [ebp - 0x5c]
mov eax, dword [eax + 0xc]
mov dword [esp + 0x10], 0x14
lea edx, [ebp - 0x50]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0xc
mov dword [esp + 4], 0x29
mov dword [esp], eax
call sub.WS2_32.dll_setsockopt
sub esp, 0x14
shr eax, 0x1f
test al, al
je 0x40a7fc
mov dword [esp], str.IPV6_ADD_MEMBERSHIP
call sub.msvcrt.dll_perror
mov eax, dword [ebp - 0x5c]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.WS2_32.dll_closesocket
sub esp, 4
mov eax, dword [ebp - 0x5c]
mov dword [eax + 0xc], 0xffffffff
leave
ret 8