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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x334
mov eax, dword [0x547e80]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
xor esi, esi
mov dword [ebp - 0x32c], ebx
mov dword [ebp - 0x328], esi
mov dword [ebp - 0x324], esi
mov dword [ebp - 0x31c], esi
cmp ebx, esi
je 0x407875
xor eax, eax
cmp dword [ebp + 0xc], esi
jbe 0x407875
cmp dword [ebx + eax*8], 0xffffffff
jne 0x407883
inc eax
cmp eax, dword [ebp + 0xc]
jb 0x407869
push dword [ebp + 0x10]
call fcn.004074fa
pop ecx
jmp 0x407b5f
mov eax, dword [ebp + 0x10]
cmp eax, esi
jle 0x4078a1
mov dword [ebp - 0x31c], eax
call fcn.00410335
mov dword [ebp - 0x328], eax
mov dword [ebp - 0x324], edx
push edi
xor ecx, ecx
xor edi, edi
or dword [ebp - 0x320], 0xffffffff
mov dword [ebp - 0x310], ecx
mov dword [ebp - 0x20c], esi
mov dword [ebp - 0x108], edi
mov dword [ebp - 0x314], esi
mov eax, dword [ebp - 0x314]
shl eax, 3
xor edx, edx
mov dword [ebp - 0x318], eax
lea eax, [eax + ebx + 4]
mov word [eax + 2], dx
mov edx, dword [ebp - 0x318]
mov edx, dword [edx + ebx]
cmp edx, 0xffffffff
je 0x4079b2
movzx ebx, word [eax]
test bl, 7
je 0x4079ac
cmp edx, dword [ebp - 0x320]
jbe 0x40790a
mov dword [ebp - 0x320], edx
test bl, 1
je 0x407940
xor eax, eax
test ecx, ecx
je 0x407923
cmp dword [ebp + eax*4 - 0x30c], edx
je 0x407923
inc eax
cmp eax, ecx
jb 0x407915
cmp eax, ecx
jne 0x407940
cmp ecx, 0x40
jae 0x407940
mov dword [ebp + eax*4 - 0x30c], edx
mov ecx, dword [ebp - 0x310]
inc ecx
mov dword [ebp - 0x310], ecx
test bl, 4
je 0x407976
xor eax, eax
test esi, esi
je 0x407959
cmp dword [ebp + eax*4 - 0x208], edx
je 0x407959
inc eax
cmp eax, esi
jb 0x40794b
cmp eax, esi
jne 0x407976
cmp esi, 0x40
jae 0x407976
mov dword [ebp + eax*4 - 0x208], edx
mov esi, dword [ebp - 0x20c]
inc esi
mov dword [ebp - 0x20c], esi
test bl, 2
je 0x4079ac
xor eax, eax
test edi, edi
je 0x40798f
cmp dword [ebp + eax*4 - 0x104], edx
je 0x40798f
inc eax
cmp eax, edi
jb 0x407981
cmp eax, edi
jne 0x4079ac
cmp edi, 0x40
jae 0x4079ac
mov dword [ebp + eax*4 - 0x104], edx
mov edi, dword [ebp - 0x108]
inc edi
mov dword [ebp - 0x108], edi
mov ebx, dword [ebp - 0x32c]
inc dword [ebp - 0x314]
mov eax, dword [ebp - 0x314]
cmp eax, dword [ebp + 0xc]
jb 0x4078c5
xor ebx, ebx
cmp ecx, ebx
jne 0x4079e3
cmp esi, ebx
jne 0x4079e3
cmp edi, ebx
jne 0x4079e3
push dword [ebp + 0x10]
call fcn.004074fa
pop ecx
jmp 0x407b5e
cmp dword [ebp + 0x10], ebx
jge 0x4079f0
mov dword [ebp - 0x314], ebx
jmp 0x4079fc
lea eax, [ebp - 0x334]
mov dword [ebp - 0x314], eax
mov eax, dword [ebp - 0x320]
inc eax
mov dword [ebp - 0x318], eax
jmp 0x407a1d
mov ecx, dword [ebp - 0x310]
mov esi, dword [ebp - 0x20c]
mov edi, dword [ebp - 0x108]
cmp dword [ebp + 0x10], ebx
jle 0x407a46
mov eax, dword [ebp - 0x31c]
cdq
mov ebx, 0x3e8
idiv ebx
imul edx, edx, 0x3e8
mov dword [ebp - 0x334], eax
mov dword [ebp - 0x330], edx
xor ebx, ebx
jmp 0x407a54
jne 0x407a54
mov dword [ebp - 0x334], ebx
mov dword [ebp - 0x330], ebx
push dword [ebp - 0x314]
neg edi
sbb edi, edi
lea eax, [ebp - 0x108]
and edi, eax
neg esi
sbb esi, esi
lea eax, [ebp - 0x20c]
and esi, eax
neg ecx
push edi
sbb ecx, ecx
lea eax, [ebp - 0x310]
push esi
and ecx, eax
push ecx
push dword [ebp - 0x318]
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x407ae4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, ebx
je 0x407aab
cmp dword [0x551a84], ebx
jne 0x407ae8
cmp eax, 0x2714
jne 0x407ae8
cmp dword [ebp + 0x10], ebx
jle 0x407a0b
push dword [ebp - 0x324]
push dword [ebp - 0x328]
call fcn.00410335
push edx
push eax
call fcn.0041034b
mov ecx, dword [ebp + 0x10]
sub ecx, eax
add esp, 0x10
mov dword [ebp - 0x31c], ecx
cmp ecx, ebx
jg 0x407a0b
xor eax, eax
cmp eax, ebx
jge 0x407aed
or eax, 0xffffffff
jmp 0x407b5e
jne 0x407af3
xor eax, eax
jmp 0x407b5e
mov esi, dword [ebp - 0x32c]
mov edi, dword [ebp + 0xc]
add esi, 6
xor eax, eax
mov word [esi], ax
mov eax, dword [esi - 6]
cmp eax, 0xffffffff
je 0x407b56
lea ecx, [ebp - 0x310]
push ecx
push eax
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x407b21
or word [esi], 1
lea eax, [ebp - 0x20c]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x407b38
or word [esi], 4
lea eax, [ebp - 0x108]
push eax
push dword [esi - 6]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x407b4f
or word [esi], 2
cmp word [esi], 0
je 0x407b56
inc ebx
add esi, 8
dec edi
jne 0x407aff
mov eax, ebx
pop edi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.00446098
leave
ret