Function at 0x509b90
Capabilities:
Check for time delay via gettickcount
Get socket status

Disassembly:
sub esp, 0x324
push ebx
mov ebx, dword [esp + 0x32c]
push esi
xor esi, esi
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], esi
mov dword [esp + 8], esi
cmp ebx, esi
je 0x509bcb
mov ecx, dword [esp + 0x334]
xor eax, eax
cmp ecx, esi
jbe 0x509bcb
mov edi, edi
cmp dword [ebx + eax*8], 0xffffffff
jne 0x509be4
inc eax
cmp eax, ecx
jb 0x509bc0
mov eax, dword [esp + 0x338]
push eax
call fcn.00509830
add esp, 4
pop esi
pop ebx
add esp, 0x324
ret
mov eax, dword [esp + 0x338]
cmp eax, esi
jle 0x509c00
mov dword [esp + 8], eax
call fcn.00514070
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
push ebp
push edi
xor ecx, ecx
xor edi, edi
or eax, 0xffffffff
mov dword [esp + 0x12c], ecx
mov dword [esp + 0x28], esi
mov dword [esp + 0x230], edi
mov dword [esp + 0x14], eax
xor ebp, ebp
xor edx, edx
mov word [ebx + ebp*8 + 6], dx
mov edx, dword [ebx + ebp*8]
cmp edx, 0xffffffff
je 0x509cf8
movzx ebx, word [ebx + ebp*8 + 4]
test bl, 7
je 0x509ced
cmp edx, eax
jbe 0x509c4a
mov dword [esp + 0x14], edx
test bl, 1
je 0x509c82
xor eax, eax
test ecx, ecx
jbe 0x509c63
cmp dword [esp + eax*4 + 0x130], edx
je 0x509c63
inc eax
cmp eax, ecx
jb 0x509c55
cmp eax, ecx
jne 0x509c82
cmp ecx, 0x40
jae 0x509c82
mov dword [esp + eax*4 + 0x130], edx
mov ecx, dword [esp + 0x12c]
inc ecx
mov dword [esp + 0x12c], ecx
test bl, 4
je 0x509cb1
xor eax, eax
test esi, esi
jbe 0x509c9b
lea ecx, [ecx]
cmp dword [esp + eax*4 + 0x2c], edx
je 0x509c9b
inc eax
cmp eax, esi
jb 0x509c90
cmp eax, esi
jne 0x509cb1
cmp esi, 0x40
jae 0x509cb1
mov dword [esp + eax*4 + 0x2c], edx
mov esi, dword [esp + 0x28]
inc esi
mov dword [esp + 0x28], esi
test bl, 2
je 0x509ced
xor eax, eax
test edi, edi
jbe 0x509cce
lea esp, [esp]
cmp dword [esp + eax*4 + 0x234], edx
je 0x509cce
inc eax
cmp eax, edi
jb 0x509cc0
cmp eax, edi
jne 0x509ced
cmp edi, 0x40
jae 0x509ced
mov dword [esp + eax*4 + 0x234], edx
mov edi, dword [esp + 0x230]
inc edi
mov dword [esp + 0x230], edi
mov ebx, dword [esp + 0x338]
mov eax, dword [esp + 0x14]
inc ebp
cmp ebp, dword [esp + 0x33c]
jb 0x509c21
test ecx, ecx
jne 0x509d2d
test esi, esi
jne 0x509d2d
test edi, edi
jne 0x509d2d
mov eax, dword [esp + 0x340]
push eax
call fcn.00509830
add esp, 4
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x324
ret
xor ebx, ebx
cmp dword [esp + 0x340], ebx
lea edx, [esp + 0x20]
setl bl
lea ebp, [eax + 1]
dec ebx
and ebx, edx
jmp 0x509d60
mov edi, dword [esp + 0x230]
mov esi, dword [esp + 0x28]
mov ecx, dword [esp + 0x12c]
jmp 0x509d60
mov eax, dword [esp + 0x340]
xor edx, edx
cmp eax, edx
jle 0x509d98
mov eax, 0x10624dd3
imul dword [esp + 0x10]
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, dword [esp + 0x10]
mov dword [esp + 0x20], eax
imul eax, eax, 0x3e8
sub edx, eax
imul edx, edx, 0x3e8
jmp 0x509d9e
jne 0x509da2
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], edx
neg edi
sbb edi, edi
lea eax, [esp + 0x230]
and edi, eax
neg esi
sbb esi, esi
push ebx
lea edx, [esp + 0x2c]
and esi, edx
neg ecx
push edi
sbb ecx, ecx
lea eax, [esp + 0x134]
push esi
and ecx, eax
push ecx
push ebp
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x509e2d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x509df0
cmp dword [0x5fe370], 0
jne 0x509e31
cmp eax, 0x2714
jne 0x509e31
cmp dword [esp + 0x340], 0
jle 0x509d45
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
push ecx
push edx
call fcn.00514070
push edx
push eax
call fcn.005140a0
mov ecx, dword [esp + 0x350]
sub ecx, eax
add esp, 0x10
mov dword [esp + 0x10], ecx
test ecx, ecx
jle 0x509e41
jmp 0x509d45
test eax, eax
jge 0x509e3f
pop edi
pop ebp
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0x324
ret
jne 0x509e4e
pop edi
pop ebp
pop esi
xor eax, eax
pop ebx
add esp, 0x324
ret
mov esi, dword [esp + 0x338]
mov edi, dword [esp + 0x33c]
xor ebx, ebx
add esi, 6
xor eax, eax
mov word [esi], ax
mov eax, dword [esi - 6]
cmp eax, 0xffffffff
je 0x509eba
lea ecx, [esp + 0x12c]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x509e84
or word [esi], 1
mov eax, dword [esi - 6]
lea edx, [esp + 0x28]
push edx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x509e9a
or word [esi], 4
mov edx, dword [esi - 6]
lea ecx, [esp + 0x230]
push ecx
push edx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x509eb3
or word [esi], 2
cmp word [esi], 0
je 0x509eba
inc ebx
add esi, 8
sub edi, 1
jne 0x509e61
pop edi
pop ebp
pop esi
mov eax, ebx
pop ebx
add esp, 0x324
ret