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

Disassembly:
sub esp, 0x33c
push ebx
push ebp
xor edx, edx
push esi
push edi
xor edi, edi
cmp dword [esp + 0x360], edx
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], edx
mov dword [esp + 0x1c], edx
jl 0x40a6e9
jg 0x40a6d4
mov ebp, dword [esp + 0x35c]
cmp ebp, 0x7fffffff
jb 0x40a6f0
mov ebp, accept
mov dword [esp + 0x35c], ebp
mov dword [esp + 0x360], edx
jmp 0x40a6f0
mov ebp, dword [esp + 0x35c]
mov eax, dword [esp + 0x350]
mov ecx, dword [esp + 0x354]
cmp eax, 0xffffffff
jne 0x40a743
cmp ecx, eax
jne 0x40a743
cmp dword [esp + 0x358], eax
jne 0x40a743
cmp ebp, edx
je 0x40a736
jge 0x40a72f
push 0x2726
call dword [sym.imp.WS2_32.dll_WSASetLastError]
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x33c
ret
push ebp
call dword [sym.imp.KERNEL32.dll_Sleep]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x33c
ret
cmp dword [esp + 0x360], edx
jl 0x40a78c
jg 0x40a752
cmp ebp, edx
jbe 0x40a78c
lea eax, [esp + 0x30]
push eax
mov edi, ebp
call fcn.00414d60
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [esp + 0x18], ecx
mov ecx, dword [eax + 8]
mov dword [esp + 0x1c], edx
mov edx, dword [eax + 0xc]
mov eax, dword [esp + 0x354]
add esp, 4
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x354]
mov dword [esp + 0x20], edx
xor edx, edx
xor esi, esi
or ebx, 0xffffffff
mov dword [esp + 0x40], edx
mov dword [esp + 0x144], esi
cmp eax, 0xffffffff
je 0x40a7c0
mov esi, 1
mov edx, esi
mov dword [esp + 0x148], eax
mov dword [esp + 0x144], esi
mov dword [esp + 0x44], eax
mov dword [esp + 0x40], edx
mov ebx, eax
cmp ecx, 0xffffffff
je 0x40a82a
xor eax, eax
test esi, esi
jbe 0x40a7de
jmp 0x40a7d0
cmp dword [esp + eax*4 + 0x148], ecx
je 0x40a7de
inc eax
cmp eax, esi
jb 0x40a7d0
cmp eax, esi
jne 0x40a7fd
cmp esi, 0x40
jae 0x40a7fd
mov dword [esp + eax*4 + 0x148], ecx
mov esi, dword [esp + 0x144]
inc esi
mov dword [esp + 0x144], esi
xor eax, eax
test edx, edx
jbe 0x40a80e
cmp dword [esp + eax*4 + 0x44], ecx
je 0x40a80e
inc eax
cmp eax, edx
jb 0x40a803
cmp eax, edx
jne 0x40a824
cmp edx, 0x40
jae 0x40a824
mov dword [esp + eax*4 + 0x44], ecx
mov edx, dword [esp + 0x40]
inc edx
mov dword [esp + 0x40], edx
cmp ecx, ebx
jbe 0x40a82a
mov ebx, ecx
mov eax, dword [esp + 0x358]
xor ecx, ecx
mov dword [esp + 0x248], ecx
cmp eax, 0xffffffff
je 0x40a8a1
mov dword [esp + 0x24c], eax
mov ecx, 1
xor eax, eax
mov dword [esp + 0x248], ecx
test edx, edx
jbe 0x40a879
jmp 0x40a860
mov ebp, dword [esp + 0x358]
cmp dword [esp + eax*4 + 0x44], ebp
je 0x40a872
inc eax
cmp eax, edx
jb 0x40a860
mov ebp, dword [esp + 0x35c]
cmp eax, edx
jne 0x40a891
cmp edx, 0x40
jae 0x40a891
mov edx, dword [esp + 0x358]
mov dword [esp + eax*4 + 0x44], edx
inc dword [esp + 0x40]
cmp dword [esp + 0x358], ebx
jbe 0x40a8a1
mov ebx, dword [esp + 0x358]
cmp dword [esp + 0x360], 0
jg 0x40a8c6
jl 0x40a8b1
test ebp, ebp
jae 0x40a8c6
inc ebx
mov dword [esp + 0x2c], ebx
mov ebx, dword [sym.imp.WS2_32.dll_select]
mov dword [esp + 0x10], 0
jmp 0x40a8f0
inc ebx
lea eax, [esp + 0x24]
mov dword [esp + 0x2c], ebx
mov ebx, dword [sym.imp.WS2_32.dll_select]
mov dword [esp + 0x10], eax
jmp 0x40a8f0
mov ecx, dword [esp + 0x248]
mov esi, dword [esp + 0x144]
mov edi, edi
cmp dword [esp + 0x360], 0
jl 0x40a92b
jg 0x40a900
test ebp, ebp
jbe 0x40a92b
mov eax, 0x10624dd3
imul edi
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esp + 0x24], eax
imul eax, eax, 0x3e8
mov edx, edi
sub edx, eax
imul edx, edx, 0x3e8
mov dword [esp + 0x28], edx
jmp 0x40a93e
mov eax, ebp
or eax, dword [esp + 0x360]
jne 0x40a93e
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov edx, dword [esp + 0x10]
push edx
neg ecx
sbb ecx, ecx
lea edx, [esp + 0x24c]
and ecx, edx
lea eax, [esp + 0x44]
push eax
neg esi
push ecx
mov ecx, dword [esp + 0x38]
sbb esi, esi
lea eax, [esp + 0x150]
and esi, eax
push esi
push ecx
call ebx
mov esi, eax
cmp esi, 0xffffffff
jne 0x40aa06
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x40a990
cmp dword [0x46e910], 0
jne 0x40aa06
cmp eax, 0x2714
jne 0x40aa06
cmp dword [esp + 0x360], 0
jl 0x40a8e0
jg 0x40a9a8
test ebp, ebp
jbe 0x40a8e0
lea edx, [esp + 0x30]
push edx
call fcn.00414d60
mov edx, dword [esp + 0x18]
sub esp, 0xc
mov ecx, esp
mov dword [ecx], edx
mov edx, dword [esp + 0x28]
mov dword [ecx + 4], edx
mov edx, dword [esp + 0x2c]
mov dword [ecx + 8], edx
mov edx, dword [esp + 0x30]
mov dword [ecx + 0xc], edx
mov edx, dword [eax]
sub esp, 0x10
mov ecx, esp
mov dword [ecx], edx
mov edx, dword [eax + 4]
mov dword [ecx + 4], edx
mov edx, dword [eax + 8]
mov eax, dword [eax + 0xc]
mov dword [ecx + 8], edx
mov dword [ecx + 0xc], eax
call fcn.00414da0
mov edi, ebp
sub edi, eax
add esp, 0x20
test edi, edi
jle 0x40a736
jmp 0x40a8e0
test esi, esi
jl 0x40a721
je 0x40a736
mov edi, dword [esp + 0x350]
xor esi, esi
cmp edi, 0xffffffff
je 0x40aa4b
lea ecx, [esp + 0x144]
push ecx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40aa39
mov esi, 1
lea edx, [esp + 0x40]
push edx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40aa4b
or esi, 4
mov edi, dword [esp + 0x354]
cmp edi, 0xffffffff
je 0x40aa7e
lea eax, [esp + 0x144]
push eax
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40aa6c
or esi, 8
lea ecx, [esp + 0x40]
push ecx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40aa7e
or esi, 4
mov edi, dword [esp + 0x358]
cmp edi, 0xffffffff
je 0x40aab1
lea edx, [esp + 0x248]
push edx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40aa9f
or esi, 2
lea eax, [esp + 0x40]
push eax
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40aab1
or esi, 4
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x33c
ret