Function at 0x409b27
Capabilities:
Connect socket
Get socket status
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x240
mov eax, dword [0x5e5710]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0x24], eax
mov eax, dword [ebp + 0xc]
xor ebx, ebx
push esi
push edi
mov dword [ebp - 0x1c], eax
mov word [ebp - 0x14], bx
xor eax, eax
lea edi, [ebp - 0x12]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
push ebx
xor edi, edi
inc edi
push edi
push 2
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x240], ebx
mov dword [ebp - 0x13c], ebx
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, ebx
jbe 0x409c25
mov eax, dword [ebp - 0x24]
cmp byte [eax], bl
mov word [ebp - 0x14], 2
je 0x409bab
mov ecx, dword [ebp - 0x20]
push eax
call fcn.00409ad0
push eax
call dword [sym.imp.WS2_32.dll_htonl]
mov dword [ebp - 0x10], eax
push dword [ebp - 0x1c]
call dword [sym.imp.MSVCR80.dll_atoi]
pop ecx
push eax
call dword [sym.imp.WS2_32.dll_htons]
cmp ax, bx
mov word [ebp - 0x12], ax
je 0x409c25
lea eax, [ebp - 0x28]
push eax
push 0x8004667e
push esi
mov dword [ebp - 0x28], edi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp eax, 0xffffffff
mov dword [ebp - 0x18], eax
je 0x409c25
mov ecx, dword [ebp - 0x20]
mov eax, dword [ecx]
push 7
call dword [eax + 8]
push 0x10
lea eax, [ebp - 0x14]
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, ebx
mov dword [ebp - 0x18], eax
je 0x409d70
jge 0x409c45
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
mov dword [ebp - 0x18], eax
je 0x409c45
cmp eax, 0x2734
je 0x409c45
mov ecx, dword [ebp - 0x20]
mov eax, dword [ecx]
push 8
call dword [eax + 8]
cmp esi, 0xffffffff
je 0x409c31
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x30]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0056f17c
leave
ret 0xc
cmp dword [ebp + 0x10], ebx
jne 0x409c51
mov dword [ebp + 0x10], 0x1e
mov eax, dword [ebp + 0x10]
push 3
xor edx, edx
pop ecx
div ecx
cmp eax, ebx
jne 0x409c64
mov dword [ebp - 0x24], edi
jmp 0x409c6b
cmp eax, edi
mov dword [ebp - 0x24], eax
jne 0x409c73
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x38], eax
jmp 0x409c7a
mov dword [ebp - 0x38], 3
cmp dword [ebp - 0x24], ebx
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x1c], ebx
jbe 0x409ceb
mov ecx, dword [ebp - 0x20]
mov eax, dword [ecx]
push 5
call dword [eax + 8]
test eax, eax
je 0x409c25
lea eax, [ebp - 0x38]
push eax
push ebx
lea eax, [ebp - 0x13c]
push eax
lea eax, [ebp - 0x240]
push eax
lea eax, [esi + 1]
push eax
mov dword [ebp - 0x23c], esi
mov dword [ebp - 0x240], edi
mov dword [ebp - 0x138], esi
mov dword [ebp - 0x13c], edi
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
mov dword [ebp - 0x18], eax
jne 0x409cdb
call dword [sym.imp.MSVCR80.dll__errno]
cmp dword [eax], 4
je 0x409c85
cmp dword [ebp - 0x18], ebx
jg 0x409cf4
inc dword [ebp - 0x1c]
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x24]
jb 0x409c85
cmp dword [ebp - 0x18], ebx
jle 0x409c25
lea eax, [ebp - 0x13c]
push eax
push esi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x409d1a
lea eax, [ebp - 0x240]
push eax
push esi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x409c25
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x18]
push eax
push 0x1007
push 0xffff
push esi
mov dword [ebp - 0x2c], 4
call dword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jl 0x409c25
cmp dword [ebp - 0x18], ebx
jne 0x409c25
mov eax, dword [ebp - 0x20]
mov dword [eax + 4], esi
lea eax, [ebp - 0x28]
push eax
push 0x8004667e
push esi
mov dword [ebp - 0x28], ebx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
cmp eax, 0xffffffff
mov dword [ebp - 0x18], eax
je 0x409c25
mov dword [ebp - 0x30], edi
jmp 0x409c31