Function at 0x40afe0
Capabilities:
Check for time delay via gettickcount
Connect socket
Get socket status
Receive data
Receive data on socket

Disassembly:
sub esp, 0x10c
push ebx
push ebp
mov ebp, ecx
push esi
push edi
mov eax, dword [ebp + 0x20]
cmp eax, 0x10
ja case.0x40b000.5
xor ecx, ecx
mov cl, byte [eax + 0x40b2a4]
jmp dword [ecx*4 + 0x40b28c]
mov ecx, ebp
call fcn.0040b2c0
pop edi
mov dword [ebp + 0x20], eax
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret
mov eax, dword [ebp + 0x1c]
lea edx, [ebp + 0xc]
push 0x10
push edx
push eax
call sub.WSOCK32.dll_connect
test eax, eax
jne 0x40b041
pop edi
mov dword [ebp + 0x20], 1
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret
mov ecx, dword [ebp + 0x1c]
lea edx, [esp + 0x10]
push edx
lea eax, [esp + 0x1c]
push 0
push eax
mov edi, 1
mov esi, 2
push 0
push 0
mov dword [esp + 0x30], ecx
mov dword [esp + 0x2c], edi
mov dword [esp + 0x24], esi
mov dword [esp + 0x28], 0
call sub.WSOCK32.dll_select
test eax, eax
mov eax, dword [ebp + 0x20]
jg 0x40b094
cmp eax, esi
jg case.0x40b000.4
mov dword [ebp + 0x20], esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret
cmp eax, esi
jg case.0x40b000.4
mov dword [ebp + 0x20], edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
mov edx, dword [ebp + 0x2c]
mov dword [ebp + 0x28], eax
sub eax, edx
cmp eax, 0xea60
jb 0x40b0cd
call edi
mov dword [ebp + 0x2c], eax
mov dword [ebp + 0x20], 4
mov ecx, dword [ebp + 0x1c]
lea esi, [ebp + 0x36]
push 0
push 0x100d
push esi
push ecx
call sub.WSOCK32.dll_recv
mov ebx, eax
test ebx, ebx
jne 0x40b0f9
pop edi
mov dword [ebp + 0x20], 4
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret
cmp ebx, 0xffffffff
je case.0x40b000.4
call edi
push 0x45048c
mov dword [ebp + 0x2c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [0x450488]
xor ecx, ecx
mov cx, word [0x45048a]
and edx, 0xffff
add edx, ebx
cmp edx, ecx
ja 0x40b201
xor eax, eax
mov ax, word [0x450486]
lea edx, [eax + ebx]
cmp edx, ecx
jae 0x40b17e
mov edx, dword [0x450480]
mov ecx, ebx
lea edi, [eax + edx]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ax, word [0x450486]
add word [0x450488], bx
add ax, bx
cmp ax, word [0x45048a]
mov word [0x450486], ax
jb 0x40b201
jmp 0x40b1f8
mov edx, dword [0x450480]
sub ecx, eax
lea edi, [eax + edx]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor edx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
xor edi, edi
xor esi, esi
mov di, word [0x450486]
mov si, word [0x45048a]
lea eax, [edi + ebx]
div esi
sub esi, edi
mov edi, dword [0x450480]
lea eax, [ebp + 0x36]
add esi, eax
xor eax, eax
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
xor edx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ax, word [0x450486]
mov cx, word [0x45048a]
xor esi, esi
add eax, ebx
mov si, cx
add word [0x450488], bx
div esi
cmp dx, cx
mov word [0x450486], dx
jb 0x40b201
mov word [0x450486], 0
push 0x45048c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp + 4]
push 0
push 0
push 0x5f4
mov ecx, dword [eax + 0x1c]
push ecx
call dword [sym.imp.USER32.dll_PostMessageA]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret
mov eax, dword [ebp + 0x1c]
cmp eax, 0xffffffff
je 0x40b242
push eax
call sub.WSOCK32.dll_closesocket
mov dword [ebp + 0x1c], 0xffffffff
call dword [sym.imp.KERNEL32.dll_GetTickCount]
pop edi
mov dword [ebp + 0x2c], eax
mov dword [ebp + 0x20], 8
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
mov edx, dword [ebp + 0x2c]
mov dword [ebp + 0x28], eax
sub eax, edx
cmp eax, 2
jb case.0x40b000.4
call esi
mov dword [ebp + 0x2c], eax
mov dword [ebp + 0x20], 0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret