Function at 0x40edf0
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 0x40ee0f
jecxz 0x40ee0f
cld
rep stosb byte es:[edi], al
cmp byte [ebx], 0x5b
jne 0x40ee40
push eax
push eax
lea eax, [ebx + 1]
push eax
lea eax, [ebp - 0x2c]
push eax
call fcn.0041f1aa
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 0x40efb2
sub esp, 0xc
push ebx
call fcn.0040edd5
add esp, 0x10
test eax, eax
je 0x40ef83
sub esp, 0xc
push 0x46cab0
call fcn.0040366a
pop esi
pop edi
push 0x20
push ebx
mov edi, 0x46cac0
call fcn.0040ecec
add esp, 0x10
mov ecx, 0x10
mov dword [ebp - 0x3c], eax
jecxz 0x40ee82
cld
repne scasd eax, dword es:[edi]
je 0x40ee87
mov edi, 4
sub edi, 4
test edi, edi
jne 0x40ef29
sub esp, 0xc
mov edi, dword [sym.imp.WS2_32.dll_gethostbyname]
mov dword [0x46cab0], 0
push ebx
call edi
add esp, 0xc
test eax, eax
jne 0x40eec6
push ecx
push ebx
push str.Cannot_get_host_by_name__s
push dword [0x463464]
call fcn.0040423a
jmp 0x40f020
mov edx, dword [eax + 0xc]
mov edx, dword [edx]
mov esi, dword [edx]
cmp esi, 0x100007f
jne 0x40eef7
push edx
movsx eax, word [eax + 0xa]
push eax
push str._localhost____u
push dword [0x463464]
call fcn.0040423a
mov dword [esp], ebx
call edi
add esp, 0xc
test eax, eax
je 0x40eeaf
sub esp, 0xc
push 0x46cab0
call fcn.0040366a
mov eax, dword [0x46cab4]
mov ecx, dword [ebp - 0x3c]
add esp, 0x10
mov dword [eax*4 + 0x46cac0], ecx
lea edi, [eax*4 + 0x46cac0]
inc eax
and eax, 0xf
mov dword [edi + 0x40], esi
mov dword [0x46cab4], eax
mov eax, dword [edi + 0x40]
mov dword [ebp - 0x30], eax
cmp eax, 0x100007f
je 0x40ef42
mov dword [0x46cab0], 0
jmp 0x40ef98
push eax
mov eax, dword [0x46cab4]
shl eax, 2
sub edi, eax
push edi
push str.2_localhost____u
push dword [0x463464]
call fcn.0040423a
mov dword [esp], ebx
call dword [sym.imp.WS2_32.dll_gethostbyname]
add esp, 0xc
test eax, eax
je 0x40ef36
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov esi, dword [eax]
cmp esi, 0x100007f
jne 0x40eef7
jmp 0x40ef36
sub esp, 0xc
lea eax, [ebp - 0x38]
mov dword [ebp - 0x38], ebx
push eax
call fcn.004125ec
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 0x40f023
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 0x40f026
mov ecx, dword [0x463464]
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.0040be6c
add esp, 0x10
or esi, 0xffffffff
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret