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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
push 0xffffffffffffffff
push 0x55ca22
mov eax, dword fs:[0]
push eax
sub esp, 0x16c
mov eax, dword [0x5b5450]
xor eax, esp
mov dword [esp + 0x164], eax
push esi
push edi
mov eax, dword [0x5b5450]
xor eax, esp
push eax
lea eax, [esp + 0x178]
mov dword fs:[0], eax
mov esi, ecx
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [esi + 0x7c], eax
cmp eax, 0xffffffff
jne 0x40ced5
lea ecx, [esp + 0x1c]
call fcn.0040d4e0
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esi + 0x80]
mov dword [esp + 0x18c], 0
call fcn.00403f60
cmp dword [esp + 0x30], 0x10
jb 0x40d169
push dword [esp + 0x1c]
call fcn.00418340
add esp, 4
jmp 0x40d169
lea ecx, [esp + 0x18]
push ecx
push 0x8004667e
push eax
mov dword [esp + 0x24], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
je 0x40cf32
lea ecx, [esp + 0x1c]
call fcn.0040d4e0
mov dword [esp + 0x180], 1
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esi + 0x80]
call fcn.00403f60
cmp dword [esp + 0x30], 0x10
jb 0x40d159
push dword [esp + 0x1c]
call fcn.00418340
add esp, 4
jmp 0x40d159
cmp dword [esi + 0x30], 0x10
xorps xmm0, xmm0
mov eax, 2
movdqa xmmword [esp + 0x34], xmm0
mov word [esp + 0x34], ax
lea eax, [esi + 0x1c]
jb 0x40cf50
mov eax, dword [eax]
push eax
call fcn.0052e7a2
add esp, 4
push eax
call dword [sym.imp.WS2_32.dll_htons]
push 0xb
lea edi, [esi + 4]
sub esp, 8
mov ecx, edi
mov word [esp + 0x42], ax
call fcn.0040d850
cmp eax, 0xffffffff
je 0x40cfc0
cmp dword [edi + 0x14], 0x10
jb 0x40cf81
mov edi, dword [edi]
push edi
call dword [sym.imp.WS2_32.dll_gethostbyname]
mov ecx, eax
test ecx, ecx
jne 0x40cfa7
lea ecx, [esp + 0x1c]
call fcn.0040d4e0
mov dword [esp + 0x180], 2
jmp 0x40cf06
movsx eax, word [ecx + 0xa]
push eax
mov eax, dword [ecx + 0xc]
push dword [eax]
lea eax, [esp + 0x40]
push eax
call fcn.0052fa20
add esp, 0xc
jmp 0x40cfd3
cmp dword [edi + 0x14], 0x10
jb 0x40cfc8
mov edi, dword [edi]
push edi
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [esp + 0x38], eax
push 0x10
lea eax, [esp + 0x38]
push eax
push dword [esi + 0x7c]
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x40d169
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x40d12c
mov eax, dword [esi + 0x7c]
mov dword [esp + 0x68], eax
mov dword [esp + 0x64], 1
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, eax
mov eax, 0x10624dd3
mul edi
mov eax, edx
shr eax, 6
mov dword [esp + 0x10], eax
imul eax, eax, 0x3e8
sub edi, eax
lea eax, [esi + 0x3c]
imul edi, edi, 0x3e8
push eax
push 0
lea eax, [esp + 0x6c]
push eax
mov eax, dword [esi + 0x7c]
push 0
inc eax
push eax
mov dword [esp + 0x28], edi
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x40d06c
lea ecx, [esp + 0x1c]
call fcn.0040d4e0
mov dword [esp + 0x180], 3
jmp 0x40cf06
lea eax, [esp + 0x64]
push eax
push dword [esi + 0x7c]
call dword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
jne 0x40d097
lea ecx, [esp + 0x1c]
call fcn.0040d4e0
mov dword [esp + 0x180], 4
jmp 0x40cf06
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, eax
mov eax, 0x10624dd3
mul edi
shr edx, 6
mov ecx, edx
sub edx, dword [esp + 0x10]
imul ecx, ecx, 0x3e8
sub edi, ecx
imul edi, edi, 0x3e8
sub edi, dword [esp + 0x14]
jns 0x40d0cc
dec edx
add edi, 0xf4240
jmp 0x40d0db
cmp edi, 0xf4240
jl 0x40d0db
inc edx
sub edi, 0xf4240
mov eax, dword [esi + 0x3c]
cmp eax, edx
jg 0x40d0fd
jl 0x40d0e9
cmp dword [esi + 0x40], edi
jg 0x40d0fd
push 0xb
push str.Time_Out___
lea ecx, [esi + 0x80]
call fcn.00403e30
jmp 0x40d159
mov ecx, dword [esi + 0x40]
sub eax, edx
sub ecx, edi
jns 0x40d115
dec eax
add ecx, 0xf4240
mov dword [esi + 0x3c], eax
mov dword [esi + 0x40], ecx
jmp 0x40d169
cmp ecx, 0xf4240
jl 0x40d124
inc eax
sub ecx, 0xf4240
mov dword [esi + 0x3c], eax
mov dword [esi + 0x40], ecx
jmp 0x40d169
lea ecx, [esp + 0x4c]
call fcn.0040d4e0
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esi + 0x80]
mov dword [esp + 0x18c], 5
call fcn.00403f60
lea ecx, [esp + 0x4c]
call fcn.004021f0
push dword [esi + 0x7c]
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi + 0x7c], 0xffffffff
mov ecx, dword [esp + 0x178]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [esp + 0x164]
xor ecx, esp
call fcn.0052c359
mov esp, ebp
pop ebp
ret