Function at 0x40c389
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 [0x42a43c]
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 0x40c3f1
call sub.WS2_32.dll_WSAGetLastError
sub eax, 0x271d
neg eax
sbb eax, eax
add eax, 0xfffffc1a
jmp 0x40c5f8
cmp dword [ebp - 0x170], 0
je 0x40c439
push 4
push dword [ebp - 0x170]
push 7
push 0
push ebx
call sub.WS2_32.dll_setsockopt
cmp eax, 0xffffffff
jne 0x40c439
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 0x40c5f8
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 [0x43e995], al
mov word [0x43e996], ax
mov eax, pe_nt_image_headers32
mov word [0x43e998], ax
mov ax, word [0x42a2c0]
inc dword [0x42a2c0]
mov word [0x43e99a], ax
mov byte [0x43e994], 8
xor eax, eax
mov cl, al
add cl, 0x20
mov byte [eax + 0x43e9a1], cl
inc eax
cmp eax, 0x20
jl 0x40c47c
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
push 0x2d
mov edi, 0x43e994
push edi
mov dword [0x43e99d], eax
call fcn.0040c334
pop ecx
pop ecx
push 0x10
mov word [0x43e996], 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 0x40c411
call esi
mov ecx, dword [ebp + 0xc]
lea edi, [eax + ecx]
mov dword [ebp - 0x16c], edi
call esi
cmp eax, edi
jae 0x40c5b5
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 0x40c5eb
cmp eax, 0xffffffff
je 0x40c607
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 0x40c60e
cmp eax, 0x1d
jb 0x40c5a7
cmp byte [ebp - 0x154], 3
je 0x40c628
cmp byte [ebp - 0x154], 0xb
je 0x40c62f
cmp byte [ebp - 0x154], 0
jne 0x40c5a7
mov eax, pe_nt_image_headers32
cmp word [ebp - 0x150], ax
je 0x40c5b5
call esi
cmp eax, dword [ebp - 0x16c]
jb 0x40c4e1
call esi
cmp eax, dword [ebp - 0x16c]
ja 0x40c5eb
mov eax, dword [ebp - 0x170]
test eax, eax
je 0x40c5d2
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 0x40c5f6
xor eax, eax
inc eax
jmp 0x40c5f8
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.0040e208
leave
ret
mov esi, 0xfffffc18
jmp 0x40c5f0
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 0x40c5f8
mov esi, 0xfffffc1d
jmp 0x40c5f0
mov esi, 0xfffffc1e
jmp 0x40c5f0