Function at 0x4046a9
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x324
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
or edi, 0xffffffff
xor esi, esi
cmp ebx, edi
mov dword [ebp - 0x10], esi
mov dword [ebp - 0xc], esi
mov dword [ebp - 4], esi
jne 0x4046e2
cmp dword [ebp + 0xc], edi
jne 0x4046e2
cmp dword [ebp + 0x10], edi
jne 0x4046e2
push dword [ebp + 0x14]
call fcn.00404686
pop ecx
jmp 0x404989
mov eax, dword [ebp + 0x14]
cmp eax, esi
jle 0x4046f7
mov dword [ebp - 4], eax
call fcn.0040e984
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], edx
cmp ebx, 0xffffffff
mov dword [ebp - 0x11c], esi
mov dword [ebp - 0x220], esi
je 0x404725
push 1
mov dword [ebp - 0x21c], ebx
pop esi
mov dword [ebp - 0x118], ebx
mov dword [ebp - 0x220], esi
mov dword [ebp - 0x11c], esi
mov edi, ebx
mov edx, dword [ebp + 0xc]
cmp edx, 0xffffffff
je 0x4047a6
xor eax, eax
test esi, esi
jbe 0x404745
lea ecx, [ebp - 0x21c]
cmp dword [ecx], edx
je 0x404745
inc eax
add ecx, 4
cmp eax, esi
jb 0x404739
cmp eax, esi
jne 0x404762
cmp esi, 0x40
jae 0x404762
mov dword [ebp + eax*4 - 0x21c], edx
mov esi, dword [ebp - 0x220]
inc esi
mov dword [ebp - 0x220], esi
xor eax, eax
cmp dword [ebp - 0x11c], eax
jbe 0x404782
lea ecx, [ebp - 0x118]
cmp dword [ecx], edx
je 0x404782
inc eax
add ecx, 4
cmp eax, dword [ebp - 0x11c]
jb 0x404772
cmp eax, dword [ebp - 0x11c]
jne 0x4047a0
cmp dword [ebp - 0x11c], 0x40
jae 0x4047a0
mov dword [ebp + eax*4 - 0x118], edx
inc dword [ebp - 0x11c]
cmp edx, edi
jbe 0x4047a6
mov edi, edx
mov edx, dword [ebp + 0x10]
xor ecx, ecx
cmp edx, 0xffffffff
mov dword [ebp - 0x324], ecx
je 0x404812
push 1
xor eax, eax
cmp dword [ebp - 0x11c], eax
pop ecx
mov dword [ebp - 0x320], edx
mov dword [ebp - 0x324], ecx
jbe 0x4047ee
lea edx, [ebp - 0x118]
mov ebx, dword [ebp + 0x10]
cmp dword [edx], ebx
je 0x4047e8
inc eax
add edx, 4
cmp eax, dword [ebp - 0x11c]
jb 0x4047d5
mov ebx, dword [ebp + 8]
mov edx, dword [ebp + 0x10]
cmp eax, dword [ebp - 0x11c]
jne 0x40480c
cmp dword [ebp - 0x11c], 0x40
jae 0x40480c
mov dword [ebp + eax*4 - 0x118], edx
inc dword [ebp - 0x11c]
cmp edx, edi
jbe 0x404812
mov edi, edx
cmp dword [ebp + 0x14], 0
jge 0x40481e
and dword [ebp - 8], 0
jmp 0x404824
lea eax, [ebp - 0x18]
mov dword [ebp - 8], eax
inc edi
jmp 0x404833
mov esi, dword [ebp - 0x220]
mov ecx, dword [ebp - 0x324]
xor eax, eax
cmp dword [ebp + 0x14], eax
jle 0x40485c
mov eax, dword [ebp - 4]
mov ebx, 0x3e8
cdq
idiv ebx
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 4]
cdq
idiv ebx
mov ebx, dword [ebp + 8]
imul edx, edx, 0x3e8
mov dword [ebp - 0x14], edx
jmp 0x404864
jne 0x404864
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
push dword [ebp - 8]
lea eax, [ebp - 0x11c]
neg ecx
push eax
lea eax, [ebp - 0x324]
sbb ecx, ecx
and ecx, eax
lea eax, [ebp - 0x220]
neg esi
sbb esi, esi
push ecx
and esi, eax
push esi
push edi
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x4048df
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x4048ae
cmp dword [0x429cf4], 0
jne 0x4048e3
cmp eax, 0x2714
jne 0x4048e3
cmp dword [ebp + 0x14], 0
jle 0x404827
push dword [ebp - 0xc]
push dword [ebp - 0x10]
call fcn.0040e984
push edx
push eax
call fcn.0040e9ac
mov ecx, dword [ebp + 0x14]
add esp, 0x10
sub ecx, eax
test ecx, ecx
mov dword [ebp - 4], ecx
jg 0x404827
xor eax, eax
test eax, eax
jge 0x4048eb
or eax, 0xffffffff
jmp 0x404989
jne 0x4048f4
xor eax, eax
jmp 0x404989
xor esi, esi
cmp ebx, 0xffffffff
je 0x404923
lea eax, [ebp - 0x220]
push eax
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40490f
push 1
pop esi
lea eax, [ebp - 0x11c]
push eax
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x404923
or esi, 4
cmp dword [ebp + 0xc], 0xffffffff
je 0x404955
lea eax, [ebp - 0x220]
push eax
push dword [ebp + 0xc]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40493f
or esi, 8
lea eax, [ebp - 0x11c]
push eax
push dword [ebp + 0xc]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x404955
or esi, 4
cmp dword [ebp + 0x10], 0xffffffff
je 0x404987
lea eax, [ebp - 0x324]
push eax
push dword [ebp + 0x10]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x404971
or esi, 2
lea eax, [ebp - 0x11c]
push eax
push dword [ebp + 0x10]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x404987
or esi, 4
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret