Function at 0x477940
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x334
mov eax, dword [0x55ca98]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [ebp + 0xc], 1
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, 0x7d0
mov dword [ebp - 0x318], ebx
push edi
mov dword [ebp - 0x324], esi
mov dword [ebp - 0x328], 0
jne 0x477993
movzx eax, word [ebx + 4]
test al, 8
jne 0x477993
or eax, 8
mov dword [ebp - 0x328], 1
mov word [ebx + 4], ax
mov eax, dword [ebp + 0x14]
cmp dword [eax], 0
jne 0x477bc9
mov ecx, dword [ebp + 0x10]
test ecx, ecx
js 0x4779b1
cmp ecx, esi
cmovl esi, ecx
mov dword [ebp - 0x324], esi
mov eax, 0x10624dd3
mov dword [ebp - 0x31c], 0
imul esi
xor ecx, ecx
xor edi, edi
sar edx, 6
mov eax, edx
mov dword [ebp - 0x108], edi
shr eax, 0x1f
add eax, edx
mov dword [ebp - 0x314], ecx
mov dword [ebp - 0x334], eax
xor edx, edx
imul eax, eax, 0x3e8
mov dword [ebp - 0x20c], edx
sub esi, eax
imul eax, esi, 0x3e8
xor esi, esi
mov dword [ebp - 0x310], esi
mov dword [ebp - 0x330], eax
cmp dword [ebp + 0xc], ecx
jbe 0x477b67
nop
lea eax, [ebx + 6]
mov dword [ebp - 0x320], eax
movzx eax, word [eax + ecx*8 - 2]
mov ebx, eax
mov dword [ebp - 0x32c], ebx
test al, 0xd
je 0x477b2a
test al, 1
je 0x477a8a
xor ecx, ecx
test edi, edi
je 0x477a5e
mov ebx, dword [ebp - 0x314]
mov eax, dword [ebp - 0x318]
mov eax, dword [eax + ebx*8]
mov ebx, dword [ebp - 0x32c]
nop dword [eax]
cmp dword [ebp + ecx*4 - 0x104], eax
je 0x477a5e
inc ecx
cmp ecx, edi
jb 0x477a50
cmp ecx, edi
jne 0x477a8a
cmp edi, 0x40
jae 0x477a8a
mov edi, dword [ebp - 0x314]
mov eax, dword [ebp - 0x318]
mov eax, dword [eax + edi*8]
mov dword [ebp + ecx*4 - 0x104], eax
mov edi, dword [ebp - 0x108]
inc edi
mov dword [ebp - 0x108], edi
test bl, 4
je 0x477ad8
mov ebx, dword [ebp - 0x318]
xor ecx, ecx
test edx, edx
je 0x477ab2
mov eax, dword [ebp - 0x314]
mov eax, dword [ebx + eax*8]
cmp dword [ebp + ecx*4 - 0x208], eax
je 0x477ab2
inc ecx
cmp ecx, edx
jb 0x477aa4
cmp ecx, edx
jne 0x477ad8
cmp edx, 0x40
jae 0x477ad8
mov eax, dword [ebp - 0x314]
mov eax, dword [ebx + eax*8]
mov dword [ebp + ecx*4 - 0x208], eax
mov edx, dword [ebp - 0x20c]
inc edx
mov dword [ebp - 0x20c], edx
mov ebx, dword [ebp - 0x318]
xor eax, eax
test esi, esi
je 0x477afe
mov ecx, dword [ebp - 0x314]
mov ecx, dword [ebx + ecx*8]
nop dword [eax]
cmp dword [ebp + eax*4 - 0x30c], ecx
je 0x477afe
inc eax
cmp eax, esi
jb 0x477af0
cmp eax, esi
jne 0x477b24
cmp esi, 0x40
jae 0x477b24
mov ecx, dword [ebp - 0x314]
mov ecx, dword [ebx + ecx*8]
mov dword [ebp + eax*4 - 0x30c], ecx
mov esi, dword [ebp - 0x310]
inc esi
mov dword [ebp - 0x310], esi
mov ecx, dword [ebp - 0x314]
mov eax, dword [ebp - 0x320]
xor ebx, ebx
mov word [eax + ecx*8], bx
mov ebx, dword [ebp - 0x318]
mov eax, dword [ebx + ecx*8]
cmp eax, dword [ebp - 0x31c]
cmovbe eax, dword [ebp - 0x31c]
inc ecx
mov dword [ebp - 0x31c], eax
mov dword [ebp - 0x314], ecx
cmp ecx, dword [ebp + 0xc]
jb 0x477a10
lea esi, [ebx + 6]
jmp 0x477b72
lea esi, [ebx + 6]
mov eax, ecx
mov dword [ebp - 0x320], esi
lea ecx, [ebp - 0x334]
inc eax
push ecx
lea ecx, [ebp - 0x310]
push ecx
lea ecx, [ebp - 0x20c]
push ecx
lea ecx, [ebp - 0x108]
push ecx
push eax
call dword [sym.imp.WS2_32.dll_select]
mov edi, eax
test edi, edi
jg 0x477bf2
jne 0x477c4d
mov ecx, dword [ebp + 0x10]
mov eax, ecx
mov esi, dword [ebp - 0x324]
sub eax, esi
test ecx, ecx
cmovle eax, ecx
mov ecx, eax
mov dword [ebp + 0x10], ecx
test ecx, ecx
jle 0x477bdf
mov eax, dword [ebp + 0x14]
cmp dword [eax], 0
je 0x4779a2
pop edi
pop esi
mov eax, 0xfffffffe
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005091c5
mov esp, ebp
pop ebp
ret
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005091c5
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp + 0xc]
test ebx, ebx
je 0x477c4d
nop dword [eax]
lea eax, [ebp - 0x108]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x477c17
or word [esi], 1
lea eax, [ebp - 0x20c]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x477c2e
or word [esi], 4
lea eax, [ebp - 0x310]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x477c45
or word [esi], 8
add esi, 8
sub ebx, 1
jne 0x477c00
cmp dword [ebp - 0x328], 0
je 0x477c68
mov eax, dword [ebp - 0x320]
or ecx, 0xffffffff
mov al, byte [eax]
and al, 0xd
cmp al, 8
cmove edi, ecx
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.005091c5
mov esp, ebp
pop ebp
ret