Function at 0x40ee84
Capabilities:
Act as tcp client
Connect tcp socket
Resolve dns

Disassembly:
push ebp
mov ecx, 0x1c
xor eax, eax
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x34]
push ebx
sub esp, 0x3c
mov ebx, dword [ebp + 8]
test edi, edi
je 0x40eea3
jecxz 0x40eea3
cld
rep stosb byte es:[edi], al
cmp byte [ebx], 0x5b
jne 0x40eed4
push eax
push eax
lea eax, [ebx + 1]
push eax
lea eax, [ebp - 0x2c]
push eax
call fcn.0041f307
add esp, 0xc
mov word [ebp - 0x34], 0x17
push 6
push 1
push 0x17
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
pop eax
jmp 0x40f046
sub esp, 0xc
push ebx
call fcn.0040ee69
add esp, 0x10
test eax, eax
je 0x40f017
sub esp, 0xc
push 0x46dab0
call fcn.0040366a
pop esi
pop edi
push 0x20
push ebx
mov edi, 0x46dac0
call fcn.0040ed80
add esp, 0x10
mov ecx, 0x10
mov dword [ebp - 0x3c], eax
jecxz 0x40ef16
cld
repne scasd eax, dword es:[edi]
je 0x40ef1b
mov edi, 4
sub edi, 4
test edi, edi
jne 0x40efbd
sub esp, 0xc
mov edi, dword [sym.imp.WS2_32.dll_gethostbyname]
mov dword [0x46dab0], 0
push ebx
call edi
add esp, 0xc
test eax, eax
jne 0x40ef5a
push ecx
push ebx
push str.Cannot_get_host_by_name__s
push dword [0x464464]
call fcn.0040423a
jmp 0x40f0b4
mov edx, dword [eax + 0xc]
mov edx, dword [edx]
mov esi, dword [edx]
cmp esi, 0x100007f
jne 0x40ef8b
push edx
movsx eax, word [eax + 0xa]
push eax
push str._localhost____u
push dword [0x464464]
call fcn.0040423a
mov dword [esp], ebx
call edi
add esp, 0xc
test eax, eax
je 0x40ef43
sub esp, 0xc
push 0x46dab0
call fcn.0040366a
mov eax, dword [0x46dab4]
mov ecx, dword [ebp - 0x3c]
add esp, 0x10
mov dword [eax*4 + 0x46dac0], ecx
lea edi, [eax*4 + 0x46dac0]
inc eax
and eax, 0xf
mov dword [edi + 0x40], esi
mov dword [0x46dab4], eax
mov eax, dword [edi + 0x40]
mov dword [ebp - 0x30], eax
cmp eax, 0x100007f
je 0x40efd6
mov dword [0x46dab0], 0
jmp 0x40f02c
push eax
mov eax, dword [0x46dab4]
shl eax, 2
sub edi, eax
push edi
push str.2_localhost____u
push dword [0x464464]
call fcn.0040423a
mov dword [esp], ebx
call dword [sym.imp.WS2_32.dll_gethostbyname]
add esp, 0xc
test eax, eax
je 0x40efca
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov esi, dword [eax]
cmp esi, 0x100007f
jne 0x40ef8b
jmp 0x40efca
sub esp, 0xc
lea eax, [ebp - 0x38]
mov dword [ebp - 0x38], ebx
push eax
call fcn.00412680
add esp, 0x10
mov dword [ebp - 0x30], eax
mov word [ebp - 0x34], 2
push esi
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
pop edi
test eax, eax
jle 0x40f0b7
movzx eax, word [ebp + 0xc]
xchg al, ah
mov edx, 0x10
mov word [ebp - 0x32], ax
cmp word [ebp - 0x34], 0x17
mov eax, 0x1c
cmovne eax, edx
push edx
push eax
lea eax, [ebp - 0x34]
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
pop ecx
test eax, eax
jns 0x40f0ba
mov ecx, dword [0x464464]
mov edx, dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x40], ecx
mov dword [ebp - 0x3c], edx
call edx
sub esp, 0xc
push eax
call fcn.004037a9
mov edx, dword [ebp - 0x3c]
mov edi, eax
call edx
mov ecx, dword [ebp - 0x40]
mov dword [esp], edi
push eax
push ebx
push str.Call_to_connect_to__s_failed___d___s
push ecx
call fcn.0040423a
add esp, 0x14
push esi
call fcn.0040bf04
add esp, 0x10
or esi, 0xffffffff
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret