Function at 0x500af0
Capabilities:
Get socket status

Disassembly:
sub esp, 0x328
mov edx, dword [esp + 0x32c]
xor eax, eax
mov dword [esp + 0xc], 0
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
test edx, edx
je 0x500b2d
mov ecx, dword [esp + 0x330]
test ecx, ecx
je 0x500b2d
cmp dword [edx + eax*8], 0xffffffff
jne 0x500b57
inc eax
cmp eax, ecx
jb 0x500b22
mov eax, dword [esp + 0x334]
test eax, eax
je 0x500ea9
jns 0x500ea2
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
add esp, 0x328
ret
push ebp
mov ebp, dword [esp + 0x338]
test ebp, ebp
jle 0x500b7b
mov dword [esp + 0xc], ebp
call fcn.00508ef0
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x330]
mov dword [esp + 0x10], eax
mov ebp, dword [esp + 0x334]
or ecx, 0xffffffff
push ebx
push esi
push edi
xor edi, edi
mov dword [esp + 0x10], ecx
xor ebx, ebx
mov dword [esp + 0x2c], edi
xor esi, esi
mov dword [esp + 0x130], ebx
xor eax, eax
mov dword [esp + 0x234], esi
mov dword [esp + 0x14], eax
lea ebx, [ebx]
xor ecx, ecx
mov word [edx + eax*8 + 6], cx
mov ecx, dword [edx + eax*8]
cmp ecx, 0xffffffff
je 0x500c88
movzx edx, word [edx + eax*8 + 4]
test dl, 7
je 0x500c81
cmp ecx, dword [esp + 0x10]
jbe 0x500bdb
mov dword [esp + 0x10], ecx
test dl, 1
je 0x500c07
xor eax, eax
test edi, edi
je 0x500bf1
cmp dword [esp + eax*4 + 0x30], ecx
je 0x500bf1
inc eax
cmp eax, edi
jb 0x500be6
cmp eax, edi
jne 0x500c07
cmp edi, 0x40
jae 0x500c07
mov dword [esp + eax*4 + 0x30], ecx
mov edi, dword [esp + 0x2c]
inc edi
mov dword [esp + 0x2c], edi
test dl, 4
je 0x500c3f
xor eax, eax
test ebx, ebx
je 0x500c20
cmp dword [esp + eax*4 + 0x134], ecx
je 0x500c20
inc eax
cmp eax, ebx
jb 0x500c12
cmp eax, ebx
jne 0x500c3f
cmp ebx, 0x40
jae 0x500c3f
mov dword [esp + eax*4 + 0x134], ecx
mov ebx, dword [esp + 0x130]
inc ebx
mov dword [esp + 0x130], ebx
test dl, 2
je 0x500c7d
xor eax, eax
test esi, esi
je 0x500c5e
lea ebx, [ebx]
cmp dword [esp + eax*4 + 0x238], ecx
je 0x500c5e
inc eax
cmp eax, esi
jb 0x500c50
cmp eax, esi
jne 0x500c7d
cmp esi, 0x40
jae 0x500c7d
mov dword [esp + eax*4 + 0x238], ecx
mov esi, dword [esp + 0x234]
inc esi
mov dword [esp + 0x234], esi
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x33c]
inc eax
mov dword [esp + 0x14], eax
cmp eax, ebp
jb 0x500bb0
mov ebp, dword [esp + 0x344]
test edi, edi
jne 0x500cdb
test ebx, ebx
jne 0x500cdb
test esi, esi
jne 0x500cdb
test ebp, ebp
je 0x500cce
jns 0x500cc7
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
pop edi
pop esi
pop ebx
or eax, 0xffffffff
pop ebp
add esp, 0x328
ret
push ebp
call dword [sym.imp.KERNEL32.dll_Sleep]
pop edi
pop esi
pop ebx
xor eax, eax
pop ebp
add esp, 0x328
ret
xor eax, eax
lea ecx, [esp + 0x24]
mov edx, ebp
mov ebp, dword [sym.imp.WS2_32.dll_WSAGetLastError]
test edx, edx
sets al
dec eax
and eax, ecx
mov ecx, dword [esp + 0x10]
inc ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ecx
mov edi, edi
test edx, edx
jle 0x500d39
mov ecx, dword [esp + 0x18]
mov eax, 0x10624dd3
imul ecx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esp + 0x24], eax
imul eax, eax, 0x3e8
sub ecx, eax
imul eax, ecx, 0x3e8
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x14]
jmp 0x500d4b
jne 0x500d4b
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], 0
push eax
neg esi
lea eax, [esp + 0x238]
sbb esi, esi
and esi, eax
neg ebx
lea eax, [esp + 0x134]
sbb ebx, ebx
and ebx, eax
neg edi
push esi
sbb edi, edi
lea eax, [esp + 0x34]
push ebx
and edi, eax
push edi
push ecx
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x500e18
call ebp
test eax, eax
je 0x500da1
cmp dword [0xa649b4], 0
jne 0x500cb9
cmp eax, 0x2714
jne 0x500cb9
mov edx, dword [esp + 0x344]
test edx, edx
jg 0x500dcb
mov edi, dword [esp + 0x2c]
mov ebx, dword [esp + 0x130]
mov esi, dword [esp + 0x234]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
jmp 0x500d00
push dword [esp + 0x20]
push dword [esp + 0x20]
call fcn.00508ef0
push edx
push eax
call fcn.00508f80
mov edx, dword [esp + 0x354]
add esp, 0x10
mov ecx, edx
sub ecx, eax
mov dword [esp + 0x18], ecx
test ecx, ecx
jle 0x500cce
mov edi, dword [esp + 0x2c]
mov ebx, dword [esp + 0x130]
mov esi, dword [esp + 0x234]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
jmp 0x500d00
test eax, eax
js 0x500cb9
je 0x500cce
mov esi, dword [esp + 0x33c]
xor edi, edi
add esi, 6
xor eax, eax
mov word [esi], ax
mov eax, dword [esi - 6]
cmp eax, 0xffffffff
je 0x500e89
lea ecx, [esp + 0x2c]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x500e52
or word [esi], 1
lea eax, [esp + 0x130]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x500e6a
or word [esi], 4
lea eax, [esp + 0x234]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x500e82
or word [esi], 2
cmp word [esi], 0
je 0x500e89
inc edi
add esi, 8
dec dword [esp + 0x340]
jne 0x500e32
mov eax, edi
pop edi
pop esi
pop ebx
pop ebp
add esp, 0x328
ret
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
xor eax, eax
add esp, 0x328
ret