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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x33c
mov eax, dword [0x4f9b3c]
xor eax, esp
mov dword [esp + 0x338], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
xor esi, esi
push edi
or edi, 0xffffffff
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x10], esi
cmp ebx, edi
jne 0x40e5c1
cmp dword [ebp + 0xc], edi
jne 0x40e5c1
cmp dword [ebp + 0x10], edi
jne 0x40e5c1
push dword [ebp + 0x14]
call fcn.0040e54c
pop ecx
jmp 0x40e847
mov eax, dword [ebp + 0x14]
cmp eax, esi
jle 0x40e5d9
mov dword [esp + 0x10], eax
call fcn.0040f313
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
mov dword [esp + 0x238], esi
mov dword [esp + 0x28], esi
cmp ebx, 0xffffffff
je 0x40e604
xor esi, esi
inc esi
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x28], esi
mov dword [esp + 0x23c], ebx
mov dword [esp + 0x238], esi
mov edi, ebx
mov ecx, dword [ebp + 0xc]
cmp ecx, 0xffffffff
je 0x40e678
xor eax, eax
test esi, esi
je 0x40e61d
cmp dword [esp + eax*4 + 0x2c], ecx
je 0x40e61d
inc eax
cmp eax, esi
jb 0x40e612
cmp eax, esi
jne 0x40e633
cmp esi, 0x40
jae 0x40e633
mov dword [esp + eax*4 + 0x2c], ecx
mov esi, dword [esp + 0x28]
inc esi
mov dword [esp + 0x28], esi
xor eax, eax
cmp eax, dword [esp + 0x238]
jae 0x40e658
cmp dword [esp + eax*4 + 0x23c], ecx
je 0x40e651
inc eax
cmp eax, dword [esp + 0x238]
jb 0x40e63e
cmp eax, dword [esp + 0x238]
jne 0x40e672
cmp dword [esp + 0x238], 0x40
jae 0x40e672
mov dword [esp + eax*4 + 0x23c], ecx
inc dword [esp + 0x238]
cmp ecx, edi
jbe 0x40e678
mov edi, ecx
mov edx, dword [ebp + 0x10]
xor ecx, ecx
mov dword [esp + 0x130], ecx
cmp edx, 0xffffffff
je 0x40e6dd
inc ecx
xor eax, eax
mov dword [esp + 0x134], edx
mov dword [esp + 0x130], ecx
cmp eax, dword [esp + 0x238]
jae 0x40e6bd
cmp dword [esp + eax*4 + 0x23c], edx
je 0x40e6b6
inc eax
cmp eax, dword [esp + 0x238]
jb 0x40e6a3
cmp eax, dword [esp + 0x238]
jne 0x40e6d7
cmp dword [esp + 0x238], 0x40
jae 0x40e6d7
mov dword [esp + eax*4 + 0x23c], edx
inc dword [esp + 0x238]
cmp edx, edi
jbe 0x40e6dd
mov edi, edx
xor eax, eax
cmp dword [ebp + 0x14], eax
jge 0x40e6ea
mov dword [esp + 0x14], eax
jmp 0x40e6f2
lea edx, [esp + 0x20]
mov dword [esp + 0x14], edx
inc edi
jmp 0x40e702
mov esi, dword [esp + 0x28]
mov ecx, dword [esp + 0x130]
xor eax, eax
cmp dword [ebp + 0x14], eax
jle 0x40e722
mov eax, dword [esp + 0x10]
cdq
mov ebx, 0x3e8
idiv ebx
mov ebx, dword [ebp + 8]
imul edx, edx, 0x3e8
mov dword [esp + 0x24], edx
jmp 0x40e728
jne 0x40e72c
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], eax
push dword [esp + 0x14]
neg ecx
lea eax, [esp + 0x23c]
push eax
sbb ecx, ecx
lea eax, [esp + 0x138]
and ecx, eax
neg esi
sbb esi, esi
lea eax, [esp + 0x30]
push ecx
and esi, eax
push esi
push edi
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x40e7ab
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x40e777
cmp dword [0x4fe1b8], 0
jne 0x40e7af
cmp eax, 0x2714
jne 0x40e7af
cmp dword [ebp + 0x14], 0
jle 0x40e6f5
push dword [esp + 0x1c]
push dword [esp + 0x1c]
call fcn.0040f313
push edx
push eax
call fcn.0040f329
mov ecx, dword [ebp + 0x14]
sub ecx, eax
add esp, 0x10
mov dword [esp + 0x10], ecx
test ecx, ecx
jg 0x40e6f5
xor eax, eax
test eax, eax
jns 0x40e7b7
or eax, 0xffffffff
jmp 0x40e847
jne 0x40e7c0
xor eax, eax
jmp 0x40e847
mov esi, dword [sym.imp.WS2_32.dll___WSAFDIsSet]
xor edi, edi
cmp ebx, 0xffffffff
je 0x40e7ec
lea eax, [esp + 0x28]
push eax
push ebx
call esi
test eax, eax
je 0x40e7da
inc edi
lea eax, [esp + 0x238]
push eax
push ebx
call esi
test eax, eax
je 0x40e7ec
or edi, 4
cmp dword [ebp + 0xc], 0xffffffff
je 0x40e817
lea eax, [esp + 0x28]
push eax
push dword [ebp + 0xc]
call esi
test eax, eax
je 0x40e803
or edi, 8
lea eax, [esp + 0x238]
push eax
push dword [ebp + 0xc]
call esi
test eax, eax
je 0x40e817
or edi, 4
cmp dword [ebp + 0x10], 0xffffffff
je 0x40e845
lea eax, [esp + 0x130]
push eax
push dword [ebp + 0x10]
call esi
test eax, eax
je 0x40e831
or edi, 2
lea eax, [esp + 0x238]
push eax
push dword [ebp + 0x10]
call esi
test eax, eax
je 0x40e845
or edi, 4
mov eax, edi
mov ecx, dword [esp + 0x344]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004927bf
mov esp, ebp
pop ebp
ret