Function at 0x40c224
Capabilities:
Initialize winsock library
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1ac
push ebx
push esi
lea eax, [ebp - 0x1ac]
push edi
push eax
push 0x101
mov esi, ecx
call sub.WSOCK32.dll_WSAStartup
test eax, eax
push 0
je 0x40c25a
push str.WSAStart__
call fcn.0040baac
pop ecx
pop ecx
jmp 0x40c44b
push 2
pop edi
push edi
push edi
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [esi], eax
jne 0x40c274
push 0
push str.Please_setup_TCP_IP_controlpanel__network__r_n
jmp 0x40c24e
xor ebx, ebx
inc ebx
cmp dword [ebp + 8], ebx
jne 0x40c44f
push 0
push ebx
push edi
call sub.WSOCK32.dll_socket
cmp eax, 0xffffffff
mov dword [esi + 4], eax
jne 0x40c29a
push 0
push str.Please_setup2_TCP_IP_controlpanel__network__r_n
jmp 0x40c24e
push 0x10
lea eax, [ebp - 0x1c]
push 0
push eax
call fcn.00416ce0
mov eax, dword [esi + 0x84]
add esp, 0xc
mov dword [ebp - 0x18], eax
mov ax, word [esi + 0x88]
mov word [ebp - 0x1a], ax
lea eax, [ebp - 0x1c]
push 0x10
push eax
push dword [esi]
mov word [ebp - 0x1c], di
call sub.WSOCK32.dll_bind
test eax, eax
je 0x40c2df
push 0
push str.bind__
jmp 0x40c24e
lea eax, [ebp - 0x1c]
push 0x10
push eax
push dword [esi + 4]
call sub.WSOCK32.dll_bind
test eax, eax
je 0x40c30b
push dword [esi + 4]
call sub.WSOCK32.dll_closesocket
or dword [esi + 4], 0xffffffff
push 0
push str.bind_tcp__error._Cant_support_file_attach
call fcn.0040baac
pop ecx
pop ecx
lea eax, [ebp - 4]
mov edi, 0x8004667e
push eax
push edi
push dword [esi]
mov dword [ebp - 4], ebx
call sub.WSOCK32.dll_ioctlsocket
test eax, eax
je 0x40c32f
push 0
push str.ioctlsocket_nonblock_
jmp 0x40c24e
mov eax, dword [esi + 4]
cmp eax, 0xffffffff
je 0x40c352
lea ecx, [ebp - 4]
push ecx
push edi
push eax
call sub.WSOCK32.dll_ioctlsocket
test eax, eax
je 0x40c352
push 0
push str.ioctlsocket_tcp_nonblock_
jmp 0x40c24e
lea eax, [ebp - 4]
push 4
push eax
mov edi, 0xffff
push 0x20
push edi
push dword [esi]
mov dword [ebp - 4], ebx
call sub.WSOCK32.dll_setsockopt
test eax, eax
je 0x40c37a
push 0
push str.setsockopt_broadcast_
jmp 0x40c24e
lea eax, [ebp - 0xc]
push 4
mov ebx, 0x1001
push eax
push ebx
push edi
push dword [esi]
mov dword [ebp - 0xc], 0x10000
mov dword [ebp - 8], 0x8000
call sub.WSOCK32.dll_setsockopt
test eax, eax
je 0x40c3c1
lea eax, [ebp - 8]
push 4
push eax
push ebx
push edi
push dword [esi]
call sub.WSOCK32.dll_setsockopt
test eax, eax
je 0x40c3c1
push 0
push str.setsockopt_sendbuf_
call fcn.0040baac
pop ecx
pop ecx
lea eax, [ebp - 0xc]
push 4
mov ebx, 0x1002
push eax
push ebx
push edi
push dword [esi]
mov dword [ebp - 0xc], 0x10000
mov dword [ebp - 8], 0x8000
call sub.WSOCK32.dll_setsockopt
test eax, eax
je 0x40c408
lea eax, [ebp - 8]
push 4
push eax
push ebx
push edi
push dword [esi]
call sub.WSOCK32.dll_setsockopt
test eax, eax
je 0x40c408
push 0
push str.setsockopt_recvbuf_
call fcn.0040baac
pop ecx
pop ecx
mov eax, dword [esi + 4]
xor ebx, ebx
inc ebx
cmp eax, 0xffffffff
mov dword [ebp - 4], ebx
je 0x40c437
lea ecx, [ebp - 4]
push 4
push ecx
push 4
push edi
push eax
call sub.WSOCK32.dll_setsockopt
test eax, eax
je 0x40c437
push 0
push str.setsockopt_tcp_reuseaddr_
call fcn.0040baac
pop ecx
pop ecx
mov esi, dword [esi + 4]
cmp esi, 0xffffffff
je 0x40c44f
push 5
push esi
call sub.WSOCK32.dll_listen
test eax, eax
je 0x40c44f
xor eax, eax
jmp 0x40c451
mov eax, ebx
pop edi
pop esi
pop ebx
leave
ret 4