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

Disassembly:
sub esp, 0x324
push esi
mov esi, dword [esp + 0x32c]
push edi
xor edi, edi
cmp esi, edi
mov dword [esp + 0x10], edi
mov dword [esp + 0x14], edi
mov dword [esp + 8], edi
je 0x41577b
mov ecx, dword [esp + 0x334]
xor eax, eax
cmp ecx, edi
jbe 0x41577b
mov edi, edi
cmp dword [esi + eax*8], 0xffffffff
jne 0x4157b1
inc eax
cmp eax, ecx
jb 0x415770
mov eax, dword [esp + 0x338]
cmp eax, edi
je 0x4157a6
jge 0x41579f
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
pop edi
or eax, 0xffffffff
pop esi
add esp, 0x324
ret
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
pop edi
xor eax, eax
pop esi
add esp, 0x324
ret
mov eax, dword [esp + 0x338]
cmp eax, edi
jle 0x4157cd
mov dword [esp + 8], eax
call fcn.004168e0
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
push ebx
push ebp
xor ebp, ebp
mov dword [esp + 0x28], edi
mov dword [esp + 0x12c], edi
mov dword [esp + 0x230], ebp
mov dword [esp + 0x14], 0xffffffff
xor ebx, ebx
lea ecx, [ecx]
mov ecx, dword [esi + ebx*8]
cmp ecx, 0xffffffff
mov word [esi + ebx*8 + 6], 0
je 0x4158cd
mov dx, word [esi + ebx*8 + 4]
test dl, 7
je 0x4158cd
cmp ecx, dword [esp + 0x14]
jbe 0x41581b
mov dword [esp + 0x14], ecx
test dl, 1
je 0x415853
mov esi, dword [esp + 0x28]
xor eax, eax
test esi, esi
jbe 0x41583b
lea ebx, [ebx]
cmp dword [esp + eax*4 + 0x2c], ecx
je 0x41583b
inc eax
cmp eax, esi
jb 0x415830
cmp eax, esi
jne 0x41584c
cmp esi, 0x40
jae 0x41584c
mov dword [esp + eax*4 + 0x2c], ecx
inc dword [esp + 0x28]
mov esi, dword [esp + 0x338]
test dl, 4
je 0x41588d
xor eax, eax
test edi, edi
jbe 0x41586e
mov edi, edi
cmp dword [esp + eax*4 + 0x130], ecx
je 0x41586e
inc eax
cmp eax, edi
jb 0x415860
cmp eax, edi
jne 0x41588d
cmp edi, 0x40
jae 0x41588d
mov dword [esp + eax*4 + 0x130], ecx
mov edi, dword [esp + 0x12c]
inc edi
mov dword [esp + 0x12c], edi
test dl, 2
je 0x4158cd
xor eax, eax
test ebp, ebp
jbe 0x4158ae
jmp 0x4158a0
cmp dword [esp + eax*4 + 0x234], ecx
je 0x4158ae
inc eax
cmp eax, ebp
jb 0x4158a0
cmp eax, ebp
jne 0x4158cd
cmp ebp, 0x40
jae 0x4158cd
mov dword [esp + eax*4 + 0x234], ecx
mov ebp, dword [esp + 0x230]
inc ebp
mov dword [esp + 0x230], ebp
mov eax, dword [esp + 0x33c]
inc ebx
cmp ebx, eax
jb 0x4157f0
mov eax, dword [esp + 0x340]
mov edi, dword [esp + 0x14]
mov ebp, dword [sym.imp.WS2_32.dll_select]
xor ebx, ebx
xor ecx, ecx
cmp eax, ecx
setl bl
lea edx, [esp + 0x20]
dec ebx
and ebx, edx
inc edi
jmp 0x415910
mov eax, dword [esp + 0x340]
xor ecx, ecx
lea ebx, [ebx]
cmp eax, ecx
jle 0x415930
mov eax, dword [esp + 0x10]
cdq
mov ecx, 0x3e8
idiv ecx
imul edx, edx, 0x3e8
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edx
jmp 0x41593a
jne 0x41593a
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
push ebx
lea edx, [esp + 0x234]
push edx
lea eax, [esp + 0x134]
push eax
lea ecx, [esp + 0x34]
push ecx
push edi
call ebp
mov esi, eax
cmp esi, 0xffffffff
jne 0x4159a4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x41596b
cmp eax, 0x2714
jne 0x4159a4
mov eax, dword [esp + 0x340]
test eax, eax
jle 0x415901
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
push edx
push eax
call fcn.004168e0
push edx
push eax
call fcn.00416900
mov ecx, dword [esp + 0x350]
sub ecx, eax
add esp, 0x10
test ecx, ecx
mov dword [esp + 0x10], ecx
jg 0x415901
test esi, esi
jge 0x4159b6
pop ebp
pop ebx
pop edi
or eax, 0xffffffff
pop esi
add esp, 0x324
ret
jne 0x4159c5
pop ebp
pop ebx
pop edi
xor eax, eax
pop esi
add esp, 0x324
ret
mov esi, dword [esp + 0x338]
mov edi, dword [esp + 0x33c]
xor ebx, ebx
add esi, 6
jmp 0x4159e0
mov eax, dword [esi - 6]
cmp eax, 0xffffffff
mov word [esi], 0
je 0x415a36
lea ecx, [esp + 0x28]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4159ff
or byte [esi], 1
mov eax, dword [esi - 6]
lea edx, [esp + 0x12c]
push edx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x415a17
or byte [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 0x415a2f
or byte [esi], 2
cmp word [esi], 0
je 0x415a36
inc ebx
add esi, 8
dec edi
jne 0x4159e0
pop ebp
mov eax, ebx
pop ebx
pop edi
pop esi
add esp, 0x324
ret