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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34c
mov eax, dword [0x5c31c8]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
xor esi, esi
mov dword [ebp - 0x324], eax
push edi
mov ebx, edx
mov dword [ebp - 0x334], esi
mov edx, ecx
mov dword [ebp - 0x338], esi
or edi, 0xffffffff
mov dword [ebp - 0x328], edx
mov dword [ebp - 0x32c], esi
cmp edx, edi
jne 0x5183c3
cmp ebx, edi
jne 0x5183c3
cmp dword [ebp + 8], edi
jne 0x5183c3
mov ecx, eax
call fcn.0051834b
jmp 0x518660
test eax, eax
jle 0x5183e4
mov dword [ebp - 0x32c], eax
call fcn.00519343
mov dword [ebp - 0x338], edx
mov edx, dword [ebp - 0x328]
mov dword [ebp - 0x334], eax
mov dword [ebp - 0x340], 1
mov ecx, esi
mov dword [ebp - 0x110], ecx
mov eax, esi
mov dword [ebp - 0x218], eax
cmp edx, 0xffffffff
je 0x518425
mov ecx, dword [ebp - 0x340]
mov edi, edx
mov eax, ecx
mov dword [ebp - 0x214], edx
mov dword [ebp - 0x218], eax
mov dword [ebp - 0x10c], edx
mov dword [ebp - 0x110], ecx
cmp ebx, 0xffffffff
je 0x51848a
mov edx, esi
test eax, eax
je 0x51843e
cmp dword [ebp + edx*4 - 0x214], ebx
je 0x51843e
inc edx
cmp edx, eax
jb 0x518430
cmp edx, eax
jne 0x518454
cmp eax, 0x40
jae 0x518454
mov dword [ebp + edx*4 - 0x214], ebx
inc dword [ebp - 0x218]
mov eax, esi
test ecx, ecx
je 0x518468
cmp dword [ebp + eax*4 - 0x10c], ebx
je 0x518468
inc eax
cmp eax, ecx
jb 0x51845a
cmp eax, ecx
jne 0x518485
cmp ecx, 0x40
jae 0x518485
mov dword [ebp + eax*4 - 0x10c], ebx
mov ecx, dword [ebp - 0x110]
inc ecx
mov dword [ebp - 0x110], ecx
cmp ebx, edi
cmova edi, ebx
mov eax, dword [ebp + 8]
mov dword [ebp - 0x320], esi
cmp eax, 0xffffffff
je 0x5184d7
mov dword [ebp - 0x31c], eax
mov edx, esi
mov dword [ebp - 0x320], 1
test ecx, ecx
je 0x5184bc
cmp dword [ebp + edx*4 - 0x10c], eax
je 0x5184bc
inc edx
cmp edx, ecx
jb 0x5184ae
cmp edx, ecx
jne 0x5184d2
cmp ecx, 0x40
jae 0x5184d2
mov dword [ebp + edx*4 - 0x10c], eax
inc dword [ebp - 0x110]
cmp eax, edi
cmova edi, eax
xor eax, eax
lea ecx, [ebp - 0x348]
cmp dword [ebp - 0x324], eax
cmovl ecx, eax
lea eax, [edi + 1]
mov edi, dword [ebp - 0x324]
mov dword [ebp - 0x33c], ecx
mov dword [ebp - 0x330], eax
test edi, edi
jle 0x518532
mov eax, dword [ebp - 0x32c]
cdq
mov dword [ebp - 0x324], 0x3e8
idiv dword [ebp - 0x324]
mov dword [ebp - 0x348], eax
imul eax, edx, 0x3e8
mov dword [ebp - 0x344], eax
mov eax, dword [ebp - 0x330]
jmp 0x518540
jne 0x518540
mov dword [ebp - 0x348], esi
mov dword [ebp - 0x344], esi
push ecx
lea ecx, [ebp - 0x110]
push ecx
lea ecx, [ebp - 0x320]
push ecx
lea ecx, [ebp - 0x218]
push ecx
push eax
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x5185be
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x518573
cmp eax, 0x2714
jne 0x5185c2
mov ecx, dword [ebp - 0x33c]
mov eax, dword [ebp - 0x330]
test edi, edi
jle 0x518532
push dword [ebp - 0x338]
push dword [ebp - 0x334]
call fcn.00519343
push edx
push eax
call fcn.00519359
mov ecx, edi
add esp, 0x10
sub ecx, eax
mov eax, dword [ebp - 0x330]
mov dword [ebp - 0x32c], ecx
test ecx, ecx
mov ecx, dword [ebp - 0x33c]
jg 0x5184fd
mov eax, esi
test eax, eax
jns 0x5185ca
or eax, 0xffffffff
jmp 0x518660
jne 0x5185d3
xor eax, eax
jmp 0x518660
mov eax, dword [ebp - 0x328]
mov edi, dword [sym.imp.WS2_32.dll___WSAFDIsSet]
cmp eax, 0xffffffff
je 0x51860d
lea ecx, [ebp - 0x218]
push ecx
push eax
call edi
test eax, eax
lea eax, [ebp - 0x110]
push eax
push dword [ebp - 0x328]
cmovne esi, dword [ebp - 0x340]
call edi
test eax, eax
je 0x51860d
or esi, 4
cmp ebx, 0xffffffff
je 0x518634
lea eax, [ebp - 0x218]
push eax
push ebx
call edi
test eax, eax
je 0x518623
or esi, 8
lea eax, [ebp - 0x110]
push eax
push ebx
call edi
test eax, eax
je 0x518634
or esi, 4
mov ebx, dword [ebp + 8]
cmp ebx, 0xffffffff
je 0x51865e
lea eax, [ebp - 0x320]
push eax
push ebx
call edi
test eax, eax
je 0x51864d
or esi, 2
lea eax, [ebp - 0x110]
push eax
push ebx
call edi
test eax, eax
je 0x51865e
or esi, 4
mov eax, esi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0055daac
mov esp, ebp
pop ebp
ret