Function at 0x401ff0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4c5ba6
mov eax, dword fs:[0]
push eax
sub esp, 0x80
mov eax, dword [0x4fa534]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov esi, ecx
mov eax, dword [ebp + 8]
mov dword [ebp - 0x74], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0x88], esi
cmp dword [eax + 0x14], 0x10
mov byte [ebp - 0x65], 0
jb 0x402046
mov eax, dword [eax]
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x4022c8
xorps xmm0, xmm0
movups xmmword [ebp - 0x24], xmm0
mov eax, dword [eax + 0xc]
mov ecx, dword [eax]
movzx eax, byte [ecx + 3]
push eax
movzx eax, byte [ecx + 2]
push eax
movzx eax, byte [ecx + 1]
push eax
movzx eax, byte [ecx]
push eax
lea eax, [ebp - 0x24]
push str._d._d._d._d
push eax
call fcn.00404620
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x3c], 0
add esp, 0x18
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], 0xf
lea edx, [ecx + 1]
mov byte [ebp - 0x3c], 0
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4020a4
sub ecx, edx
lea eax, [ebp - 0x24]
push ecx
push eax
lea ecx, [ebp - 0x3c]
call fcn.00406f50
mov byte [ebp - 4], 2
xor eax, eax
mov ecx, dword [ebp - 0x2c]
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 7
mov word [ebp - 0x54], ax
mov dword [ebp - 0x74], 1
test ecx, ecx
je 0x402187
cmp dword [ebp - 0x28], 0x10
lea eax, [ebp - 0x3c]
push 0
cmovae eax, dword [ebp - 0x3c]
push 0
push ecx
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 0x6c], eax
test eax, eax
je 0x402187
inc eax
xor ecx, ecx
mov dword [ebp - 0x78], eax
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0043c472
add esp, 4
mov edi, eax
push dword [ebp - 0x78]
push 0
push edi
call fcn.00464bd0
add esp, 0xc
lea eax, [ebp - 0x3c]
cmp dword [ebp - 0x28], 0x10
cmovae eax, dword [ebp - 0x3c]
push dword [ebp - 0x6c]
push edi
push dword [ebp - 0x2c]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov eax, dword [ebp - 0x6c]
xor ecx, ecx
mov word [edi + eax*2], cx
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x402165
sub ecx, edx
sar ecx, 1
push ecx
push edi
lea ecx, [ebp - 0x54]
call fcn.00405fe0
push edi
call fcn.0043c47b
add esp, 4
mov edi, 2
lea eax, [ebp - 0x54]
push eax
lea ecx, [esi + 8]
call fcn.00406510
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0x40]
cmp edx, 8
jb 0x4021d6
mov ecx, dword [ebp - 0x54]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4021cc
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4022dd
push edx
push ecx
call fcn.0043c464
add esp, 8
mov byte [ebp - 4], 0
mov edx, dword [ebp - 0x28]
cmp edx, 0x10
jb 0x40220e
mov ecx, dword [ebp - 0x3c]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x402204
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4022dd
push edx
push ecx
call fcn.0043c464
add esp, 8
mov eax, dword [esi + 4]
cmp eax, 0xffffffff
je 0x40221d
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [esi + 4], eax
cmp eax, 0xffffffff
je 0x4022e2
push 4
lea ecx, [ebp - 0x80]
mov dword [ebp - 0x80], 0x2710
push ecx
push 0x1006
push 0xffff
push eax
call dword [sym.imp.WS2_32.dll_setsockopt]
push dword [ebp + 0xc]
mov word [ebp - 0x64], di
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x62], ax
lea eax, [ebp - 0x24]
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [ebp - 0x60], eax
lea eax, [ebp - 0x64]
push 0x10
push eax
push dword [esi + 4]
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x4022f7
mov al, 1
jmp 0x4022aa
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0043c480
mov esp, ebp
pop ebp
ret 8
push 0x4f7ecc
lea eax, [ebp - 0x70]
mov dword [ebp - 0x70], 9
push eax
call fcn.00464e01
call fcn.00470977
push 0x4f7ecc
lea eax, [ebp - 0x7c]
mov dword [ebp - 0x7c], 0xa
push eax
call fcn.00464e01
push 0x4f7ecc
lea eax, [ebp - 0x84]
mov dword [ebp - 0x84], 2
push eax
call fcn.00464e01
int3