Function at 0x40c9a0
Capabilities:
Create raw socket
Create tcp socket
Create udp socket
Get socket status
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x76c
mov eax, dword [0x4a9e6c]
push ebx
push esi
mov ebx, ecx
push edi
push ebx
lea ecx, [esp + 0x1c]
mov dword [esp + 0x778], eax
call fcn.00406f90
mov eax, dword [eax]
mov edx, dword [eax - 0xc]
mov eax, dword [esp + 0x18]
xor esi, esi
cmp edx, esi
sete byte [esp + 0xf]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c9f3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov al, byte [esp + 0xf]
test al, al
je 0x40ca10
xor eax, eax
mov ecx, dword [esp + 0x774]
call fcn.004368a4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.00408f40
test al, al
jne 0x40ca31
mov eax, 0xfffffffe
mov ecx, dword [esp + 0x774]
call fcn.004368a4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
mov byte [esp + 0x170], 0
mov ecx, 0x3f
lea edi, [esp + 0x171]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
mov byte [esp + 0x270], 0
mov ecx, 0x3f
lea edi, [esp + 0x271]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea edx, [esp + 0x270]
stosb byte es:[edi], al
mov dword [esp + 0x18], esi
mov eax, ebx
sub edx, ebx
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40ca76
lea eax, [esp + 0x270]
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
cmp eax, esi
je 0x40cb0c
mov ecx, dword [eax + 0xc]
mov edx, dword [ecx]
mov eax, dword [edx]
push eax
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push 1
push 3
push 2
mov edi, eax
call dword [sym.imp.WS2_32.dll_socket]
push edi
mov ebx, eax
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [esp + 0x164], eax
mov word [esp + 0x160], 2
call fcn.00437979
mov word [esp + 0x162], ax
xor eax, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], 0xffffffff
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], 0x2dc6c0
call fcn.00437979
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x14], ax
mov byte [esp + 0x11], 0
mov byte [esp + 0x10], 8
jmp 0x40cb30
mov eax, 0xfffffffd
mov ecx, dword [esp + 0x774]
call fcn.004368a4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [esp + 0x24]
jmp 0x40cb30
xor eax, eax
mov ecx, 0x40
lea edi, [esp + 0x170]
push esi
rep stosd dword es:[edi], eax
call dword [sym.imp.WS2_32.dll_htons]
mov ecx, 0x78787878
mov dword [esp + 0x178], ecx
mov dword [esp + 0x17c], ecx
mov dword [esp + 0x180], ecx
mov dword [esp + 0x184], ecx
mov dword [esp + 0x188], ecx
inc esi
mov word [esp + 0x16], ax
mov dword [esp + 0x18c], ecx
mov dword [esp + 0x24], esi
mov esi, dword [esp + 0x14]
mov word [esp + 0x12], 0
mov eax, dword [esp + 0x10]
mov dword [esp + 0x190], ecx
push 0x28
lea edi, [esp + 0x174]
mov dword [esp + 0x174], eax
mov dword [esp + 0x178], esi
mov dword [esp + 0x198], ecx
call fcn.00408e80
add esp, 4
push eax
call dword [sym.imp.WS2_32.dll_htons]
push 0x10
mov word [esp + 0x16], ax
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x164]
push eax
push 0
push 0x28
mov ecx, edi
push ecx
push ebx
mov dword [esp + 0x188], edx
mov dword [esp + 0x18c], esi
call dword [sym.imp.WS2_32.dll_sendto]
lea edx, [esp + 0x38]
push edx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
cmp esi, 0xffffffff
je 0x40cd8b
lea eax, [esp + 0x30]
push eax
push 0
push 0
lea ecx, [esp + 0x64]
push ecx
push 0
mov dword [esp + 0x70], ebx
mov dword [esp + 0x6c], 1
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
je 0x40cdb3
test eax, eax
jle 0x40cdf3
lea edx, [esp + 0x58]
push edx
push ebx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x40cdf3
xor eax, eax
mov byte [esp + 0x370], 0
mov ecx, 0xff
lea edi, [esp + 0x371]
rep stosd dword es:[edi], eax
push 0
push 0
stosw word es:[edi], ax
push 0
stosb byte es:[edi], al
push 0x5dc
lea eax, [esp + 0x380]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_recvfrom]
mov esi, eax
cmp esi, 0xffffffff
je 0x40cddb
lea ecx, [esp + 0x48]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
mov edx, dword [esp + 0x384]
mov edi, dword [esp + 0x388]
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], edi
mov eax, dword [esp + 0x2a]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
mov al, byte [esp + 0x28]
test al, al
jne 0x40cd69
cmp di, word [esp + 0x14]
jne 0x40cd69
mov cx, word [esp + 0x16]
cmp word [esp + 0x2e], cx
jne 0x40cd69
lea edx, [esi - 0x14]
push edx
lea edi, [esp + 0x388]
call fcn.00408ee0
add esp, 4
test al, al
je 0x40cd69
lea ecx, [esi - 0x1c]
lea edi, [esp + 0x38c]
lea esi, [esp + 0x178]
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x40cd69
movzx edx, word [esp + 0x44]
movzx ecx, word [esp + 0x54]
sub ecx, edx
jns 0x40cd20
add ecx, 0x3c
movzx edx, word [esp + 0x46]
movzx eax, word [esp + 0x56]
sub eax, edx
cdq
mov esi, eax
mov eax, ecx
mov ecx, dword [esp + 0x20]
imul eax, eax, 0x3e8
xor esi, edx
sub esi, edx
sub eax, esi
cdq
xor eax, edx
sub eax, edx
cmp ecx, 0xffffffff
mov dword [esp + 0x18], eax
jne 0x40cd55
mov dword [esp + 0x20], eax
jmp 0x40cd65
cmp eax, ecx
jge 0x40cd5f
mov dword [esp + 0x20], eax
jmp 0x40cd69
cmp eax, dword [esp + 0x1c]
jle 0x40cd69
mov dword [esp + 0x1c], eax
cmp dword [esp + 0x24], 1
jl 0x40cb24
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x774]
call fcn.004368a4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x170]
push eax
call fcn.0045640d
add esp, 4
mov eax, 0xfffffffc
mov ecx, dword [esp + 0x774]
call fcn.004368a4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [esp + 0x170]
push ecx
call fcn.0045640d
add esp, 4
mov eax, 0xfffffffb
mov ecx, dword [esp + 0x774]
call fcn.004368a4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, 0xfffffffa
mov ecx, dword [esp + 0x774]
call fcn.004368a4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x774]
mov eax, 0xffffff9c
call fcn.004368a4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret