Function at 0x40cc58
Capabilities:
Act as tcp client
Check for time delay via gettickcount
Connect socket
Connect tcp socket
Create tcp socket
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff08
mov dword [ebp - 0x10], 0xffffffff
mov eax, dword [ebp + 0x10]
cmp eax, 0x3e8
jae 0x40cc7c
imul edx, dword [ebp + 0x10], 0x3e8
mov dword [ebp + 0x10], edx
mov dword [ebp - 0x10], 0xffffffff
push 6
push 1
push 2
call sub.WSOCK32.DLL_socket
mov dword [ebp - 0x10], eax
test eax, eax
jge 0x40ccb7
call sub.WSOCK32.DLL_WSAGetLastError
push eax
push str.socket_failed__errno:_d
lea edx, [ebp - 0xf8]
push edx
call fcn.004a16bc
add esp, 0xc
or eax, 0xffffffff
jmp 0x40ce47
push 0x10
push 0
lea edx, [ebp - 0x30]
push edx
call fcn.0049d948
add esp, 0xc
push dword [ebp + 8]
call sub.WSOCK32.DLL_inet_addr
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 8]
cmp ecx, 0xffffffff
jne 0x40cd31
push dword [ebp + 8]
call sub.WSOCK32.DLL_gethostbyname
mov dword [ebp - 4], eax
test eax, eax
jne 0x40cd13
call sub.WSOCK32.DLL_WSAGetLastError
push eax
push str.gethostbyname_and_inet_addr_failed__errno:_d
lea edx, [ebp - 0xf8]
push edx
call fcn.004a16bc
add esp, 0xc
push dword [ebp - 0x10]
call sub.WSOCK32.DLL_closesocket
or eax, 0xffffffff
jmp 0x40ce47
mov edx, dword [ebp - 4]
movsx ecx, word [edx + 0xa]
push ecx
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0xc]
push dword [edx]
lea ecx, [ebp - 0x2c]
push ecx
call fcn.0049d8d8
add esp, 0xc
jmp 0x40cd37
mov eax, dword [ebp - 8]
mov dword [ebp - 0x2c], eax
mov word [ebp - 0x30], 2
mov dx, word [ebp + 0xc]
push edx
call sub.WSOCK32.DLL_htons
mov word [ebp - 0x2e], ax
mov dword [ebp - 0xc], 1
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x40cd7e
lea eax, [ebp - 0xc]
push eax
push 0x8004667e
push dword [ebp - 0x10]
call sub.WSOCK32.DLL_ioctlsocket
test eax, eax
jge 0x40cd7e
push dword [ebp - 0x10]
call sub.WSOCK32.DLL_closesocket
or eax, 0xffffffff
jmp 0x40ce47
call sub.KERNEL32.DLL_GetTickCount
mov dword [ebp - 0x18], eax
jmp 0x40cdf1
call sub.KERNEL32.DLL_GetTickCount
mov dword [ebp - 0x1c], eax
mov edx, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x18]
sub edx, ecx
mov eax, dword [ebp + 0x10]
cmp edx, eax
jbe 0x40cdaf
push dword [ebp - 0x10]
call sub.WSOCK32.DLL_closesocket
or eax, 0xffffffff
jmp 0x40ce47
call fcn.0040d108
call sub.WSOCK32.DLL_WSAGetLastError
mov dword [ebp - 0x20], eax
mov edx, dword [ebp - 0x14]
inc edx
jne 0x40cdcf
mov ecx, dword [ebp - 0x20]
cmp ecx, 0x2748
je 0x40ce06
jmp 0x40cdf1
mov eax, dword [ebp - 0x20]
cmp eax, 0x2733
je 0x40cdf1
mov edx, dword [ebp - 0x20]
cmp edx, 0x2735
je 0x40cdf1
push dword [ebp - 0x10]
call sub.WSOCK32.DLL_closesocket
or eax, 0xffffffff
jmp 0x40ce47
push 0x10
lea edx, [ebp - 0x30]
push edx
push dword [ebp - 0x10]
call sub.WSOCK32.DLL_connect
mov dword [ebp - 0x14], eax
test eax, eax
jne 0x40cd88
push dword [ebp + 0x10]
push 0x4c7ed6
push dword [ebp - 0x10]
call fcn.0040c6a0
add esp, 0xc
test eax, eax
jge 0x40ce44
call sub.WSOCK32.DLL_WSAGetLastError
push eax
push str.status:_connect___failed__error_code:__d_n
lea edx, [ebp - 0xf8]
push edx
call fcn.004a16bc
add esp, 0xc
push dword [ebp - 0x10]
call sub.WSOCK32.DLL_closesocket
or eax, 0xffffffff
jmp 0x40ce47
mov eax, dword [ebp - 0x10]
mov esp, ebp
pop ebp
ret