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

Disassembly:
mov eax, 0x1f56c
call fcn.004154c0
push ebx
push ebp
push esi
mov esi, dword [esp + 0x1f57c]
push edi
mov ebx, ecx
mov ecx, 0xa
xor eax, eax
lea edi, [esp + 0x34]
mov edx, dword [ebx + esi*4 + 0x2f0]
mov dword [esp + 0x30], 0
mov dword [esp + 0x14], ebx
rep stosd dword es:[edi], eax
lea eax, [esi + esi*2]
lea ecx, [esp + 0x30]
push ecx
push edx
lea ebp, [ebx + eax*8]
mov dword [esp + 0x18], ebp
mov eax, dword [ebp + 4]
push eax
call dword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
cmp eax, 0xffffffff
jne 0x40c22f
mov ecx, dword [ebx + esi*4 + 0x2f0]
push ecx
call dword [sym.imp.WS2_32.dll_WSAResetEvent]
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push esi
mov ecx, ebx
call fcn.0040bc60
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1f56c
ret 4
test byte [esp + 0x30], 1
je 0x40c4f6
mov eax, dword [esp + 0x34]
test eax, eax
jne 0x40c4f6
call dword [sym.imp.KERNEL32.dll_GetTickCount]
lea edx, [esi + esi*2 + 3]
mov dword [ebp + 0x10], eax
mov ecx, reloc.USER32.dll_LoadStringA
push 0
movsx eax, word [ebx + edx*8]
lea edi, [ebx + edx*8]
sub ecx, eax
lea edx, [esp + eax + 0x180]
mov eax, dword [ebp + 4]
push ecx
push edx
push eax
mov dword [esp + 0x2c], edi
call dword [sym.imp.WS2_32.dll_recv]
mov ebx, eax
cmp ebx, reloc.USER32.dll_LoadStringA
mov dword [esp + 0x18], ebx
jg 0x40c4f2
cmp ebx, 1
jl 0x40c4f2
movsx eax, word [edi]
mov edx, dword [esp + eax + 0x17c]
lea ecx, [esp + eax + 0x17c]
cmp edx, 0x82020476
mov dword [esp + 0x20], ecx
jne 0x40c2da
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x40c2ce
push eax
call fcn.00415417
add esp, 4
mov dword [ebp + 0x14], 0
mov word [edi], 0
movsx ecx, word [edi]
lea esi, [esp + ecx + 0x17c]
jmp 0x40c327
mov esi, dword [ebp + 0x14]
test esi, esi
je 0x40c325
mov ecx, eax
lea edi, [esp + 0x17c]
mov edx, ecx
add ebx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp + 0x14]
mov ecx, edx
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov dword [esp + 0x1c], ebx
call fcn.00415417
mov eax, dword [esp + 0x20]
add esp, 4
mov dword [ebp + 0x14], 0
lea esi, [esp + 0x17c]
mov word [eax], 0
mov edi, eax
jmp 0x40c327
mov esi, ecx
test ebx, ebx
jle 0x40c4eb
jmp 0x40c335
mov edi, dword [esp + 0x1c]
cmp ebx, 8
jb 0x40c4b2
test ebx, ebx
jle 0x40c359
mov eax, dword [esi]
mov dword [esp + 0x20], esi
cmp eax, 0x82020476
je 0x40c355
dec ebx
inc esi
test ebx, ebx
jg 0x40c342
mov dword [esp + 0x18], ebx
mov ecx, dword [esp + 0x20]
xor ebp, ebp
mov bp, word [ecx + 6]
add ebp, 8
cmp ebp, ebx
jg 0x40c4c0
mov edx, ecx
xor eax, eax
mov ax, word [edx + 4]
dec eax
je 0x40c3b3
mov eax, dword [esp + 0x10]
push ebp
push esi
xor edx, edx
mov ecx, dword [eax + 4]
mov eax, dword [esp + 0x1c]
push ecx
mov ecx, dword [esp + 0x1f58c]
mov dx, word [eax + 0x2ec]
and ecx, 0xffff
shl edx, 0x10
or edx, ecx
mov ecx, dword [0x4237c0]
push edx
call fcn.00406620
jmp 0x40c49c
mov edx, dword [esp + 0x10]
cmp byte [edx + 0x1a], 1
jne 0x40c49c
lea ecx, [esp + 0x28]
mov eax, edx
push ecx
lea edx, [esp + 0x7c]
mov ebx, dword [eax + 4]
push 0
push edx
mov eax, 1
push 0
push 0
mov dword [esp + 0x90], ebx
mov dword [esp + 0x8c], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], 0
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
je 0x40c498
xor edi, edi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push edi
push ebp
push esi
push ebx
mov dword [esp + 0x34], eax
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
je 0x40c498
add edi, eax
cmp edi, ebp
jge 0x40c498
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x24]
cmp eax, 0x1388
jae 0x40c498
push 1
push 0
push 0
lea eax, [esp + 0x68]
push 0
push eax
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
je 0x40c479
lea ecx, [esp + 0x5c]
push ecx
call dword [sym.imp.USER32.dll_TranslateMessage]
lea edx, [esp + 0x5c]
push edx
call dword [sym.imp.USER32.dll_DispatchMessageA]
push 1
push 0
push 0
lea eax, [esp + 0x68]
push 0
push eax
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
jne 0x40c44c
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, ebp
push 0
sub ecx, edi
lea edx, [edi + esi]
push ecx
push edx
push ebx
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
jne 0x40c41e
mov ebx, dword [esp + 0x18]
sub ebx, ebp
add esi, ebp
mov ebp, dword [esp + 0x10]
mov dword [esp + 0x18], ebx
test ebx, ebx
jg 0x40c331
jmp 0x40c4eb
push ebx
mov word [edi], bx
call fcn.004150af
mov dword [ebp + 0x14], eax
jmp 0x40c4d6
mov ecx, dword [esp + 0x1c]
push ebx
mov word [ecx], bx
call fcn.004150af
mov edx, dword [esp + 0x14]
mov ebp, edx
mov dword [edx + 0x14], eax
mov ecx, ebx
mov edi, eax
mov eax, ecx
add esp, 4
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x1f580]
mov ebx, dword [esp + 0x14]
test byte [esp + 0x30], 0x10
je 0x40c530
mov eax, dword [esp + 0x44]
test eax, eax
je 0x40c527
mov ecx, dword [ebp + 4]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
cmp byte [ebp + 0x1a], 3
je 0x40c51e
mov dword [ebp + 4], 0xffffffff
jmp 0x40c530
mov dword [ebp + 0x10], 0
jmp 0x40c530
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp + 0x10], eax
test byte [esp + 0x30], 0x20
je 0x40c574
xor edx, edx
mov ecx, dword [0x4237c0]
mov dx, word [ebx + 0x2ec]
mov eax, esi
shl edx, 0x10
and eax, 0xffff
or edx, eax
push edx
call fcn.00406610
push esi
mov ecx, ebx
call fcn.0040bc60
cmp byte [ebp + 0x1a], 3
jne 0x40c574
mov dword [ebp + 4], 1
mov dword [ebp + 0x10], 0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1f56c
ret 4