Function at 0x40498e
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x330
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
xor edi, edi
cmp ebx, edi
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x18], edi
mov dword [ebp - 8], edi
je 0x404b05
xor ecx, ecx
cmp dword [ebp + 0xc], edi
jbe 0x404b05
mov eax, ebx
cmp dword [eax], 0xffffffff
jne 0x4049d0
inc ecx
add eax, 8
cmp ecx, dword [ebp + 0xc]
jb 0x4049bd
jmp 0x404b05
mov eax, dword [ebp + 0x10]
cmp eax, edi
jle 0x4049e5
mov dword [ebp - 8], eax
call fcn.0040e984
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], edx
mov eax, dword [ebp + 0xc]
xor ecx, ecx
xor esi, esi
or dword [ebp - 0x14], 0xffffffff
mov dword [ebp - 0x22c], ecx
mov dword [ebp - 0x128], esi
mov dword [ebp - 0x330], edi
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], eax
and word [ebx + 6], 0
mov eax, dword [ebx]
cmp eax, 0xffffffff
je 0x404aea
mov dx, word [ebx + 4]
test dl, 7
mov dword [ebp - 0x10], edx
je 0x404aea
cmp eax, dword [ebp - 0x14]
jbe 0x404a30
mov dword [ebp - 0x14], eax
test byte [ebp - 0x10], 1
je 0x404a6e
xor edx, edx
test ecx, ecx
jbe 0x404a51
lea ebx, [ebp - 0x228]
cmp dword [ebx], eax
je 0x404a4e
inc edx
add ebx, 4
cmp edx, ecx
jb 0x404a42
mov ebx, dword [ebp - 0xc]
cmp edx, ecx
jne 0x404a6e
cmp ecx, 0x40
jae 0x404a6e
mov dword [ebp + edx*4 - 0x228], eax
mov ecx, dword [ebp - 0x22c]
inc ecx
mov dword [ebp - 0x22c], ecx
test byte [ebx + 4], 4
je 0x404aac
xor edx, edx
test esi, esi
jbe 0x404a8f
lea ebx, [ebp - 0x124]
cmp dword [ebx], eax
je 0x404a8c
inc edx
add ebx, 4
cmp edx, esi
jb 0x404a80
mov ebx, dword [ebp - 0xc]
cmp edx, esi
jne 0x404aac
cmp esi, 0x40
jae 0x404aac
mov dword [ebp + edx*4 - 0x124], eax
mov esi, dword [ebp - 0x128]
inc esi
mov dword [ebp - 0x128], esi
test byte [ebx + 4], 2
je 0x404aea
xor edx, edx
test edi, edi
jbe 0x404acd
lea ebx, [ebp - 0x32c]
cmp dword [ebx], eax
je 0x404aca
inc edx
add ebx, 4
cmp edx, edi
jb 0x404abe
mov ebx, dword [ebp - 0xc]
cmp edx, edi
jne 0x404aea
cmp edi, 0x40
jae 0x404aea
mov dword [ebp + edx*4 - 0x32c], eax
mov edi, dword [ebp - 0x330]
inc edi
mov dword [ebp - 0x330], edi
add ebx, 8
dec dword [ebp - 4]
mov dword [ebp - 0xc], ebx
jne 0x404a08
test ecx, ecx
jne 0x404b13
test esi, esi
jne 0x404b13
test edi, edi
jne 0x404b13
push dword [ebp + 0x10]
call fcn.00404686
pop ecx
jmp 0x404c66
cmp dword [ebp + 0x10], 0
jge 0x404b1f
and dword [ebp - 4], 0
jmp 0x404b25
lea eax, [ebp - 0x24]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0x10], eax
jmp 0x404b40
mov ecx, dword [ebp - 0x22c]
mov esi, dword [ebp - 0x128]
mov edi, dword [ebp - 0x330]
xor eax, eax
cmp dword [ebp + 0x10], eax
jle 0x404b66
mov eax, dword [ebp - 8]
mov ebx, 0x3e8
cdq
idiv ebx
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 8]
cdq
idiv ebx
imul edx, edx, 0x3e8
mov dword [ebp - 0x20], edx
jmp 0x404b6e
jne 0x404b6e
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
neg edi
sbb edi, edi
lea eax, [ebp - 0x330]
push dword [ebp - 4]
and edi, eax
neg esi
sbb esi, esi
lea eax, [ebp - 0x128]
and esi, eax
lea eax, [ebp - 0x22c]
neg ecx
sbb ecx, ecx
push edi
and ecx, eax
push esi
push ecx
push dword [ebp - 0x10]
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x404bf1
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x404bc0
cmp dword [0x429cf4], 0
jne 0x404bf5
cmp eax, 0x2714
jne 0x404bf5
cmp dword [ebp + 0x10], 0
jle 0x404b2e
push dword [ebp - 0x18]
push dword [ebp - 0x1c]
call fcn.0040e984
push edx
push eax
call fcn.0040e9ac
mov ecx, dword [ebp + 0x10]
add esp, 0x10
sub ecx, eax
test ecx, ecx
mov dword [ebp - 8], ecx
jg 0x404b2e
xor eax, eax
test eax, eax
jge 0x404bfa
or eax, 0xffffffff
jmp 0x404c66
jne 0x404c00
xor eax, eax
jmp 0x404c66
mov eax, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
xor ebx, ebx
lea esi, [eax + 6]
and word [esi], 0
mov eax, dword [esi - 6]
cmp eax, 0xffffffff
je 0x404c5e
lea ecx, [ebp - 0x22c]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x404c2b
or byte [esi], 1
lea eax, [ebp - 0x128]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x404c41
or byte [esi], 4
lea eax, [ebp - 0x330]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x404c57
or byte [esi], 2
cmp word [esi], 0
je 0x404c5e
inc ebx
add esi, 8
dec edi
jne 0x404c0b
mov eax, ebx
pop edi
pop esi
pop ebx
leave
ret