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

Disassembly:
sub esp, 0x1ac
mov eax, dword [0x4727f0]
xor eax, esp
mov dword [esp + 0x1a8], eax
push ebx
push ebp
push esi
mov esi, edi
call fcn.00405f10
mov eax, dword [esp + 0x1bc]
mov esi, dword [sym.imp.WS2_32.dll_WSAStartup]
lea ecx, [esp + 0x20]
push ecx
push 0x202
mov dword [edi + 0x36c], eax
call esi
test eax, eax
je 0x406020
lea edx, [esp + 0x20]
push edx
push 0x102
call esi
test eax, eax
je 0x406020
lea eax, [esp + 0x20]
push eax
push 0x101
call esi
test eax, eax
je 0x406020
push 0x464a64
call fcn.004059c0
jmp 0x40623c
push 0x30
call fcn.0041a836
mov esi, eax
xor ebx, ebx
add esp, 4
cmp esi, ebx
mov ebp, 1
je 0x406064
push esi
mov dword [esi + 0x20], ebp
mov dword [esi + 0x24], ebx
mov dword [esi + 0x1c], ebx
mov dword [esi + 0x18], ebx
mov dword [esi + 0x28], ebx
mov dword [esi + 0x2c], ebx
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
cmp dword [esi + 0x20], ebx
je 0x406066
push ebx
push ebp
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [esi + 0x18], eax
jmp 0x406066
xor esi, esi
push 0x30
mov dword [edi + 0x58], esi
call fcn.0041a836
mov esi, eax
add esp, 4
cmp esi, ebx
je 0x4060a8
push esi
mov dword [esi + 0x20], ebp
mov dword [esi + 0x24], ebx
mov dword [esi + 0x1c], ebx
mov dword [esi + 0x18], ebx
mov dword [esi + 0x28], ebx
mov dword [esi + 0x2c], ebx
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
cmp dword [esi + 0x20], ebx
je 0x4060a4
push ebx
push ebp
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [esi + 0x18], eax
mov eax, esi
jmp 0x4060aa
xor eax, eax
mov esi, dword [edi + 0x58]
cmp esi, ebx
mov dword [edi + 0x5c], eax
je 0x406227
cmp eax, ebx
je 0x406212
push ebx
push ebp
push 2
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
mov dword [edi + 0x368], eax
jne 0x406109
push str.could_not_create_socket_r_n
call fcn.004059c0
add esp, 4
mov eax, dword [edi + 0x58]
cmp eax, ebx
je 0x4060f1
call fcn.00406260
mov dword [edi + 0x58], ebx
mov eax, dword [edi + 0x5c]
cmp eax, ebx
je 0x40623f
call fcn.00406260
mov dword [edi + 0x5c], ebx
jmp 0x40623f
lea ecx, [esp + 0x1c]
push ecx
push 0x8004667e
push eax
mov dword [esp + 0x28], ebp
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp eax, 0xffffffff
jne 0x406145
push str.set_nonblocking_mode_failed_in_init_client_r_n
call fcn.004059c0
mov edx, dword [edi + 0x368]
add esp, 4
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [edi + 0x368], ebx
jmp 0x4060e2
cmp dword [edi + 0x36c], ebx
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
jne 0x40616a
mov ecx, dword [edi + 0x368]
push 4
lea eax, [esp + 0x14]
push eax
push ebp
push 6
push ecx
mov dword [esp + 0x24], ebp
call esi
mov eax, dword [edi + 0x368]
push 4
lea edx, [esp + 0x18]
push edx
push 4
push 0xffff
push eax
mov dword [esp + 0x28], ebp
call esi
mov edx, dword [edi + 0x368]
push 4
lea ecx, [esp + 0x10]
push ecx
push 0x80
push 0xffff
push edx
mov word [esp + 0x22], bx
mov word [esp + 0x20], bp
call esi
mov ecx, dword [edi + 0x368]
push 4
lea eax, [esp + 0x1c]
push eax
push 8
push 0xffff
push ecx
mov dword [esp + 0x2c], ebp
call esi
test eax, eax
je 0x4061d4
push str.Winsock_error_Socket_SetOpt_failed
call fcn.004059c0
jmp 0x40623c
mov esi, dword [sym.imp.WINMM.dll_timeGetTime]
call esi
mov dword [edi + 0x39c], eax
call esi
mov dword [edi + 0x398], eax
mov dword [edi + 0x3a0], ebx
mov dword [edi + 0x3a4], ebx
mov dword [edi + 0x3a8], ebx
mov dword [edi + 0x3ac], ebx
mov dword [edi + 0x3b0], ebx
mov dword [edi + 0x3b4], ebx
mov eax, ebp
jmp 0x406241
cmp esi, ebx
je 0x406227
call fcn.00405d20
push esi
call fcn.0041a866
add esp, 4
mov dword [edi + 0x58], ebx
mov esi, dword [edi + 0x5c]
cmp esi, ebx
je 0x40623f
call fcn.00405d20
push esi
call fcn.0041a866
mov dword [edi + 0x5c], ebx
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x1b4]
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0043d963
add esp, 0x1ac
ret 4