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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x344
mov eax, dword [0x4f9b3c]
xor eax, ebp
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 0xc]
push ebx
push esi
xor esi, esi
mov ebx, edx
push edi
mov dword [ebp - 0x334], ebx
mov dword [ebp - 0x33c], esi
mov dword [ebp - 0x338], esi
mov dword [ebp - 0x328], esi
cmp ebx, esi
je 0x40e8a8
xor eax, eax
cmp dword [ebp + 8], esi
jbe 0x40e8a8
cmp dword [ebx + eax*8], 0xffffffff
jne 0x40e8b4
inc eax
cmp eax, dword [ebp + 8]
jb 0x40e89c
push ecx
call fcn.0040e54c
pop ecx
jmp 0x40eb8e
cmp ecx, esi
jle 0x40e8cf
mov dword [ebp - 0x328], ecx
call fcn.0040f313
mov dword [ebp - 0x33c], eax
mov dword [ebp - 0x338], edx
xor ecx, ecx
xor edi, edi
or dword [ebp - 0x330], 0xffffffff
mov dword [ebp - 0x320], ecx
mov dword [ebp - 0x218], esi
mov dword [ebp - 0x110], edi
mov dword [ebp - 0x324], esi
mov eax, dword [ebp - 0x324]
shl eax, 3
xor edx, edx
mov dword [ebp - 0x32c], eax
lea eax, [eax + ebx + 4]
mov word [eax + 2], dx
mov edx, dword [ebp - 0x32c]
mov edx, dword [edx + ebx]
cmp edx, 0xffffffff
je 0x40e9df
movzx ebx, word [eax]
test bl, 7
je 0x40e9d9
cmp edx, dword [ebp - 0x330]
jbe 0x40e937
mov dword [ebp - 0x330], edx
test bl, 1
je 0x40e96d
xor eax, eax
test ecx, ecx
je 0x40e950
cmp dword [ebp + eax*4 - 0x31c], edx
je 0x40e950
inc eax
cmp eax, ecx
jb 0x40e942
cmp eax, ecx
jne 0x40e96d
cmp ecx, 0x40
jae 0x40e96d
mov dword [ebp + eax*4 - 0x31c], edx
mov ecx, dword [ebp - 0x320]
inc ecx
mov dword [ebp - 0x320], ecx
test bl, 4
je 0x40e9a3
xor eax, eax
test esi, esi
je 0x40e986
cmp dword [ebp + eax*4 - 0x214], edx
je 0x40e986
inc eax
cmp eax, esi
jb 0x40e978
cmp eax, esi
jne 0x40e9a3
cmp esi, 0x40
jae 0x40e9a3
mov dword [ebp + eax*4 - 0x214], edx
mov esi, dword [ebp - 0x218]
inc esi
mov dword [ebp - 0x218], esi
test bl, 2
je 0x40e9d9
xor eax, eax
test edi, edi
je 0x40e9bc
cmp dword [ebp + eax*4 - 0x10c], edx
je 0x40e9bc
inc eax
cmp eax, edi
jb 0x40e9ae
cmp eax, edi
jne 0x40e9d9
cmp edi, 0x40
jae 0x40e9d9
mov dword [ebp + eax*4 - 0x10c], edx
mov edi, dword [ebp - 0x110]
inc edi
mov dword [ebp - 0x110], edi
mov ebx, dword [ebp - 0x334]
inc dword [ebp - 0x324]
mov eax, dword [ebp - 0x324]
cmp eax, dword [ebp + 8]
jb 0x40e8f2
xor eax, eax
cmp ecx, eax
jne 0x40ea0a
cmp esi, eax
jne 0x40ea0a
cmp edi, eax
jne 0x40ea0a
push dword [ebp + 0xc]
jmp 0x40e8a9
cmp dword [ebp + 0xc], eax
jge 0x40ea17
mov dword [ebp - 0x324], eax
jmp 0x40ea23
lea edx, [ebp - 0x344]
mov dword [ebp - 0x324], edx
mov edx, dword [ebp - 0x330]
inc edx
mov dword [ebp - 0x32c], edx
jmp 0x40ea46
mov ecx, dword [ebp - 0x320]
mov esi, dword [ebp - 0x218]
mov edi, dword [ebp - 0x110]
xor eax, eax
cmp dword [ebp + 0xc], eax
jle 0x40ea6d
mov eax, dword [ebp - 0x328]
cdq
mov ebx, 0x3e8
idiv ebx
mov ebx, dword [ebp - 0x334]
imul edx, edx, 0x3e8
mov dword [ebp - 0x340], edx
jmp 0x40ea75
jne 0x40ea7b
mov dword [ebp - 0x340], eax
mov dword [ebp - 0x344], eax
push dword [ebp - 0x324]
neg edi
sbb edi, edi
lea eax, [ebp - 0x110]
and edi, eax
neg esi
sbb esi, esi
lea eax, [ebp - 0x218]
and esi, eax
neg ecx
push edi
sbb ecx, ecx
lea eax, [ebp - 0x320]
push esi
and ecx, eax
push ecx
push dword [ebp - 0x32c]
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x40eb0d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x40ead3
cmp dword [0x4fe1b8], 0
jne 0x40eb11
cmp eax, 0x2714
jne 0x40eb11
cmp dword [ebp + 0xc], 0
jle 0x40ea32
push dword [ebp - 0x338]
push dword [ebp - 0x33c]
call fcn.0040f313
push edx
push eax
call fcn.0040f329
mov ecx, dword [ebp + 0xc]
sub ecx, eax
add esp, 0x10
mov dword [ebp - 0x328], ecx
test ecx, ecx
jg 0x40ea32
xor eax, eax
test eax, eax
jns 0x40eb16
or eax, 0xffffffff
jmp 0x40eb8e
jne 0x40eb1c
xor eax, eax
jmp 0x40eb8e
and dword [ebp - 0x328], 0
mov edi, dword [sym.imp.WS2_32.dll___WSAFDIsSet]
lea esi, [ebx + 6]
mov ebx, dword [ebp + 8]
xor eax, eax
mov word [esi], ax
mov eax, dword [esi - 6]
cmp eax, 0xffffffff
je 0x40eb82
lea ecx, [ebp - 0x320]
push ecx
push eax
call edi
test eax, eax
je 0x40eb4e
or word [esi], 1
lea eax, [ebp - 0x218]
push eax
push dword [esi - 6]
call edi
test eax, eax
je 0x40eb62
or word [esi], 4
lea eax, [ebp - 0x110]
push eax
push dword [esi - 6]
call edi
test eax, eax
je 0x40eb76
or word [esi], 2
cmp word [esi], 0
je 0x40eb82
inc dword [ebp - 0x328]
add esi, 8
dec ebx
jne 0x40eb2f
mov eax, dword [ebp - 0x328]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004927bf
leave
ret