Function at 0x40c985
Capabilities:
Check for time delay via gettickcount
Create raw socket
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x280
mov eax, dword [0x42a2e4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
mov dword [ebp - 0x170], eax
push esi
push edi
xor eax, eax
mov esi, dword [ebp + 8]
lea edi, [ebp - 0x14]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor eax, eax
lea edi, [ebp - 0x24]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push 1
stosd dword es:[edi], eax
push 3
push 2
mov dword [ebp - 0x174], 0x10
stosd dword es:[edi], eax
call sub.WS2_32.dll_socket
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40c9ed
call sub.WS2_32.dll_WSAGetLastError
sub eax, 0x271d
neg eax
sbb eax, eax
add eax, 0xfffffc1a
jmp 0x40cbf4
cmp dword [ebp - 0x170], 0
je 0x40ca35
push 4
push dword [ebp - 0x170]
push 7
push 0
push ebx
call sub.WS2_32.dll_setsockopt
cmp eax, 0xffffffff
jne 0x40ca35
call sub.WS2_32.dll_WSAGetLastError
push ebx
mov esi, eax
call sub.WS2_32.dll_closesocket
push esi
call sub.WS2_32.dll_WSASetLastError
xor eax, eax
cmp esi, 0x271d
sete al
add eax, 0xfffffc19
jmp 0x40cbf4
mov eax, dword [esi]
mov dword [ebp - 0x10], eax
push 2
pop eax
mov word [ebp - 0x14], ax
xor eax, eax
mov word [ebp - 0x12], ax
mov byte [0x42c6a5], al
mov word [0x42c6a6], ax
mov eax, 0xd8
mov word [0x42c6a8], ax
mov ax, word [0x42a010]
inc dword [0x42a010]
mov word [0x42c6aa], ax
mov byte [0x42c6a4], 8
xor eax, eax
mov cl, al
add cl, 0x20
mov byte [eax + 0x42c6b1], cl
inc eax
cmp eax, 0x20
jl 0x40ca78
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
push 0x2d
mov edi, 0x42c6a4
push edi
mov dword [0x42c6ad], eax
call fcn.0040c930
pop ecx
pop ecx
push 0x10
mov word [0x42c6a6], ax
lea eax, [ebp - 0x14]
push eax
push 0
push 0x2d
push edi
push ebx
call sub.WS2_32.dll_sendto
cmp eax, 0x2d
jb 0x40ca0d
call esi
mov ecx, dword [ebp + 0xc]
lea edi, [eax + ecx]
mov dword [ebp - 0x16c], edi
call esi
cmp eax, edi
jae 0x40cbb1
call esi
mov ecx, dword [ebp - 0x16c]
sub ecx, eax
mov eax, ecx
xor edx, edx
mov edi, 0x3e8
div edi
xor edi, edi
mov dword [ebp - 0x280], 1
mov dword [ebp - 0x27c], ebx
mov dword [ebp - 0x17c], eax
imul eax, eax, 0x3e8
sub ecx, eax
imul ecx, ecx, 0x3e8
lea eax, [ebp - 0x17c]
push eax
push edi
push edi
lea eax, [ebp - 0x280]
push eax
push 1
mov dword [ebp - 0x178], ecx
call sub.WS2_32.dll_select
cmp eax, edi
je 0x40cbe7
cmp eax, 0xffffffff
je 0x40cc03
lea eax, [ebp - 0x174]
push eax
lea eax, [ebp - 0x24]
push eax
push edi
push 0x141
lea eax, [ebp - 0x168]
push eax
push ebx
call sub.WS2_32.dll_recvfrom
cmp eax, 0xffffffff
je 0x40cc0a
cmp eax, 0x1d
jb 0x40cba3
cmp byte [ebp - 0x154], 3
je 0x40cc24
cmp byte [ebp - 0x154], 0xb
je 0x40cc2b
cmp byte [ebp - 0x154], 0
jne 0x40cba3
mov eax, 0xd8
cmp word [ebp - 0x150], ax
je 0x40cbb1
call esi
cmp eax, dword [ebp - 0x16c]
jb 0x40cadd
call esi
cmp eax, dword [ebp - 0x16c]
ja 0x40cbe7
mov eax, dword [ebp - 0x170]
test eax, eax
je 0x40cbce
movzx ecx, byte [ebp - 0x160]
mov dword [eax], ecx
call esi
mov esi, eax
sub esi, dword [ebp - 0x14b]
push ebx
call sub.WS2_32.dll_closesocket
test esi, esi
jne 0x40cbf2
xor eax, eax
inc eax
jmp 0x40cbf4
mov esi, 0xfffffc1b
push ebx
call sub.WS2_32.dll_closesocket
mov eax, esi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040e92f
leave
ret
mov esi, 0xfffffc18
jmp 0x40cbec
call sub.WS2_32.dll_WSAGetLastError
push ebx
mov esi, eax
call sub.WS2_32.dll_closesocket
push esi
call sub.WS2_32.dll_WSASetLastError
mov eax, 0xfffffc18
jmp 0x40cbf4
mov esi, 0xfffffc1d
jmp 0x40cbec
mov esi, 0xfffffc1e
jmp 0x40cbec