Function at 0x40a190
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 0x40a1d9
jg 0x40a1c4
mov ebp, dword [esp + 0x35c]
cmp ebp, 0x7fffffff
jb 0x40a1e0
mov ebp, bind
mov dword [esp + 0x35c], ebp
mov dword [esp + 0x360], edx
jmp 0x40a1e0
mov ebp, dword [esp + 0x35c]
mov eax, dword [esp + 0x350]
mov ecx, dword [esp + 0x354]
cmp eax, 0xffffffff
jne 0x40a233
cmp ecx, eax
jne 0x40a233
cmp dword [esp + 0x358], eax
jne 0x40a233
cmp ebp, edx
je 0x40a226
jge 0x40a21f
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 0x40a27c
jg 0x40a242
cmp ebp, edx
jbe 0x40a27c
lea eax, [esp + 0x30]
push eax
mov edi, ebp
call fcn.00414840
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 0x40a2b0
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 0x40a31a
xor eax, eax
test esi, esi
jbe 0x40a2ce
jmp 0x40a2c0
cmp dword [esp + eax*4 + 0x148], ecx
je 0x40a2ce
inc eax
cmp eax, esi
jb 0x40a2c0
cmp eax, esi
jne 0x40a2ed
cmp esi, 0x40
jae 0x40a2ed
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 0x40a2fe
cmp dword [esp + eax*4 + 0x44], ecx
je 0x40a2fe
inc eax
cmp eax, edx
jb 0x40a2f3
cmp eax, edx
jne 0x40a314
cmp edx, 0x40
jae 0x40a314
mov dword [esp + eax*4 + 0x44], ecx
mov edx, dword [esp + 0x40]
inc edx
mov dword [esp + 0x40], edx
cmp ecx, ebx
jbe 0x40a31a
mov ebx, ecx
mov eax, dword [esp + 0x358]
xor ecx, ecx
mov dword [esp + 0x248], ecx
cmp eax, 0xffffffff
je 0x40a391
mov dword [esp + 0x24c], eax
mov ecx, 1
xor eax, eax
mov dword [esp + 0x248], ecx
test edx, edx
jbe 0x40a369
jmp 0x40a350
mov ebp, dword [esp + 0x358]
cmp dword [esp + eax*4 + 0x44], ebp
je 0x40a362
inc eax
cmp eax, edx
jb 0x40a350
mov ebp, dword [esp + 0x35c]
cmp eax, edx
jne 0x40a381
cmp edx, 0x40
jae 0x40a381
mov edx, dword [esp + 0x358]
mov dword [esp + eax*4 + 0x44], edx
inc dword [esp + 0x40]
cmp dword [esp + 0x358], ebx
jbe 0x40a391
mov ebx, dword [esp + 0x358]
cmp dword [esp + 0x360], 0
jg 0x40a3b6
jl 0x40a3a1
test ebp, ebp
jae 0x40a3b6
inc ebx
mov dword [esp + 0x2c], ebx
mov ebx, dword [sym.imp.WS2_32.dll_select]
mov dword [esp + 0x10], 0
jmp 0x40a3e0
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 0x40a3e0
mov ecx, dword [esp + 0x248]
mov esi, dword [esp + 0x144]
mov edi, edi
cmp dword [esp + 0x360], 0
jl 0x40a41b
jg 0x40a3f0
test ebp, ebp
jbe 0x40a41b
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 0x40a42e
mov eax, ebp
or eax, dword [esp + 0x360]
jne 0x40a42e
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 0x40a4f6
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x40a480
cmp dword [0x46d8d0], 0
jne 0x40a4f6
cmp eax, 0x2714
jne 0x40a4f6
cmp dword [esp + 0x360], 0
jl 0x40a3d0
jg 0x40a498
test ebp, ebp
jbe 0x40a3d0
lea edx, [esp + 0x30]
push edx
call fcn.00414840
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.00414880
mov edi, ebp
sub edi, eax
add esp, 0x20
test edi, edi
jle 0x40a226
jmp 0x40a3d0
test esi, esi
jl 0x40a211
je 0x40a226
mov edi, dword [esp + 0x350]
xor esi, esi
cmp edi, 0xffffffff
je 0x40a53b
lea ecx, [esp + 0x144]
push ecx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40a529
mov esi, 1
lea edx, [esp + 0x40]
push edx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40a53b
or esi, 4
mov edi, dword [esp + 0x354]
cmp edi, 0xffffffff
je 0x40a56e
lea eax, [esp + 0x144]
push eax
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40a55c
or esi, 8
lea ecx, [esp + 0x40]
push ecx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40a56e
or esi, 4
mov edi, dword [esp + 0x358]
cmp edi, 0xffffffff
je 0x40a5a1
lea edx, [esp + 0x248]
push edx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40a58f
or esi, 2
lea eax, [esp + 0x40]
push eax
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40a5a1
or esi, 4
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x33c
ret