Function at 0x140001840
Capabilities:
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Read file on windows
Read pipe

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x60]
sub rsp, 0x160
mov qword [rbp - 0x60], 0xfffffffffffffffe
mov qword [rsp + 0x1b0], rbx
mov rax, qword [0x14002d8a0]
xor rax, rsp
mov qword [rbp + 0x50], rax
mov rsi, rdx
mov rbx, rcx
mov qword [rbp + 0x20], rdx
xor r15d, r15d
mov dword [rsp + 0x68], r15d
mov dword [rbp - 0x78], 0x18
mov qword [rbp - 0x70], r15
mov dword [rbp - 0x68], 1
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x60], r15
mov r9d, 0x2800
lea r8, [rbp - 0x78]
lea rdx, [rsp + 0x60]
lea rcx, [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
jne 0x140001980
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea rdx, str.Create_pipe_failed_lasterror_
lea rcx, [0x14002d190]
call fcn.140009e30
mov rcx, rax
mov edx, edi
call fcn.140005170
mov rcx, rax
lea rdx, [0x140026e88]
call fcn.140009e30
mov r13, rax
mov dl, 0xa
mov rcx, rax
call fcn.140005350
mov r12d, r15d
mov rcx, qword [r13]
movsxd rcx, dword [rcx + 4]
test byte [rcx + r13 + 0x10], 6
jne 0x140001931
mov rcx, qword [rcx + r13 + 0x48]
mov rdx, qword [rcx]
call qword [rdx + 0x68]
mov edi, 4
cmp eax, 0xffffffff
cmove r12d, edi
mov rax, qword [r13]
movsxd rcx, dword [rax + 4]
add rcx, r13
test r12d, r12d
je 0x140001959
mov edx, dword [rcx + 0x10]
or edx, r12d
cmp qword [rcx + 0x48], 0
jne 0x140001951
or edx, 4
xor r8d, r8d
call fcn.140001540
mov qword [rbx + 0x18], 0xf
mov qword [rbx + 0x10], r15
mov byte [rbx], 0
xor r8d, r8d
lea rdx, [0x140026eaf]
mov rcx, rbx
call fcn.140007d60
nop
jmp 0x140001f8b
mov dword [rbp - 0x50], 0x68
xor edx, edx
lea r8d, [rdx + 0x60]
lea rcx, [rbp - 0x48]
call fcn.14000ecc0
xor edx, edx
mov qword [rsp + 0x70], rdx
mov qword [rsp + 0x78], rdx
mov qword [rbp - 0x80], rdx
mov dword [rbp - 0x14], 0x101
mov eax, 5
mov word [rbp - 0x10], ax
mov rax, qword [rsp + 0x60]
mov qword [rbp + 8], rax
mov qword [rbp + 0x10], rax
cmp qword [rsi + 0x18], 0x10
jb 0x1400019cf
mov rdx, qword [rsi]
jmp 0x1400019d2
mov rdx, rsi
lea rax, [rsp + 0x70]
mov qword [rsp + 0x48], rax
lea rax, [rbp - 0x50]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x38], r15
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], 0x8000000
mov dword [rsp + 0x20], 1
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
jne 0x140001ae5
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea rdx, str.ERROR:CreateProcess_failed__GetLasterr_
lea rcx, [0x14002d190]
call fcn.140009e30
mov rcx, rax
mov edx, edi
call fcn.140005170
mov rcx, rax
lea rdx, [0x140026e88]
call fcn.140009e30
mov r13, rax
mov dl, 0xa
mov rcx, rax
call fcn.140005350
mov r12d, r15d
mov rcx, qword [r13]
movsxd rcx, dword [rcx + 4]
test byte [rcx + r13 + 0x10], 6
jne 0x140001a96
mov rcx, qword [rcx + r13 + 0x48]
mov rdx, qword [rcx]
call qword [rdx + 0x68]
mov edi, 4
cmp eax, 0xffffffff
cmove r12d, edi
mov rax, qword [r13]
movsxd rcx, dword [rax + 4]
add rcx, r13
test r12d, r12d
je 0x140001abe
mov edx, dword [rcx + 0x10]
or edx, r12d
cmp qword [rcx + 0x48], 0
jne 0x140001ab6
or edx, 4
xor r8d, r8d
call fcn.140001540
mov qword [rbx + 0x18], 0xf
mov qword [rbx + 0x10], r15
mov byte [rbx], 0
xor r8d, r8d
lea rdx, [0x140026eaf]
mov rcx, rbx
call fcn.140007d60
nop
jmp 0x140001f8b
or edx, 0xffffffff
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [rsp + 0x68], r15d
mov dword [rsp + 0x50], r15d
mov qword [rsp + 0x28], r15
lea rax, [rsp + 0x50]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
jne 0x140001c18
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea rdx, str.ERROR:PeekNamedPipe_failed_Getlasterr_
lea rcx, [0x14002d190]
call fcn.140009e30
mov rcx, rax
mov edx, edi
call fcn.140005170
mov rcx, rax
lea rdx, [0x140026e88]
call fcn.140009e30
mov r13, rax
mov dl, 0xa
mov rcx, rax
call fcn.140005350
mov r12d, r15d
mov rcx, qword [r13]
movsxd rcx, dword [rcx + 4]
test byte [rcx + r13 + 0x10], 6
jne 0x140001bc9
mov rcx, qword [rcx + r13 + 0x48]
mov rdx, qword [rcx]
call qword [rdx + 0x68]
mov edi, 4
cmp eax, 0xffffffff
cmove r12d, edi
mov rax, qword [r13]
movsxd rcx, dword [rax + 4]
add rcx, r13
test r12d, r12d
je 0x140001bf1
mov edx, dword [rcx + 0x10]
or edx, r12d
cmp qword [rcx + 0x48], 0
jne 0x140001be9
or edx, 4
xor r8d, r8d
call fcn.140001540
mov qword [rbx + 0x18], 0xf
mov qword [rbx + 0x10], r15
mov byte [rbx], 0
xor r8d, r8d
lea rdx, [0x140026eaf]
mov rcx, rbx
call fcn.140007d60
nop
jmp 0x140001f8b
mov eax, dword [rsp + 0x50]
test eax, eax
jne 0x140001c65
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbx + 0x18], 0xf
mov qword [rbx + 0x10], r15
mov byte [rbx], 0
xor r8d, r8d
lea rdx, [0x140026eaf]
mov rcx, rbx
call fcn.140007d60
nop
mov rcx, rsi
call fcn.1400050c0
jmp 0x140001fa9
mov qword [rbp + 0x40], 0xf
mov qword [rbp + 0x38], r15
mov byte [rbp + 0x28], 0
lea ecx, [rax + 1]
lea rdx, [0x14002f171]
call fcn.14000c7e4
mov r12, rax
test rax, rax
jne 0x140001d75
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea rdx, str.ERROR:PeekNamedPipe_failed_Getlasterr_
lea rcx, [0x14002d190]
call fcn.140009e30
mov rcx, rax
mov edx, edi
call fcn.140005170
mov rcx, rax
lea rdx, [0x140026e88]
call fcn.140009e30
mov r13, rax
mov dl, 0xa
mov rcx, rax
call fcn.140005350
mov r12d, r15d
mov rcx, qword [r13]
movsxd rcx, dword [rcx + 4]
test byte [rcx + r13 + 0x10], 6
jne 0x140001d06
mov rcx, qword [rcx + r13 + 0x48]
mov rdx, qword [rcx]
call qword [rdx + 0x68]
mov edi, 4
cmp eax, 0xffffffff
cmove r12d, edi
mov rax, qword [r13]
movsxd rcx, dword [rax + 4]
add rcx, r13
test r12d, r12d
je 0x140001d2e
mov edx, dword [rcx + 0x10]
or edx, r12d
cmp qword [rcx + 0x48], 0
jne 0x140001d26
or edx, 4
xor r8d, r8d
call fcn.140001540
mov qword [rbx + 0x18], 0xf
mov qword [rbx + 0x10], r15
mov byte [rbx], 0
xor r8d, r8d
lea rdx, [0x140026eaf]
mov rcx, rbx
call fcn.140007d60
nop
cmp qword [rbp + 0x40], 0x10
jb 0x140001d60
mov rcx, qword [rbp + 0x28]
call fcn.14000d68c
mov qword [rbp + 0x40], 0xf
mov qword [rbp + 0x38], r15
mov byte [rbp + 0x28], 0
jmp 0x140001f8b
mov r8d, dword [rsp + 0x50]
inc r8d
xor edx, edx
mov rcx, rax
call fcn.14000ecc0
mov qword [rsp + 0x20], r15
lea r9, [rsp + 0x68]
mov r8d, dword [rsp + 0x50]
mov rdx, r12
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140001dc6
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, r12
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
mov rdx, r12
lea rcx, [rbp + 0x28]
call fcn.140006620
mov rcx, r12
call fcn.14000d684
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea r14, [rbp + 0x28]
cmp qword [rbp + 0x40], 0x10
cmovae r14, qword [rbp + 0x28]
cmp qword [rsi + 0x18], 0x10
jb 0x140001df3
mov rdi, qword [rsi]
jmp 0x140001df6
mov rdi, rsi
lea rdx, str.execute_result_
lea rcx, [0x14002d190]
call fcn.140009e30
mov rcx, rax
mov rdx, rdi
call fcn.140009e30
mov rcx, rax
lea rdx, [0x140026f08]
call fcn.140009e30
mov r13, rax
mov dl, 0xa
mov rcx, rax
call fcn.140005350
mov r12d, r15d
mov rcx, qword [r13]
movsxd rcx, dword [rcx + 4]
mov edi, 4
test byte [rcx + r13 + 0x10], 6
jne 0x140001e5a
mov rcx, qword [rcx + r13 + 0x48]
mov rax, qword [rcx]
call qword [rax + 0x68]
cmp eax, 0xffffffff
cmove r12d, edi
mov rax, qword [r13]
movsxd rcx, dword [rax + 4]
add rcx, r13
test r12d, r12d
je 0x140001e81
mov edx, dword [rcx + 0x10]
or edx, r12d
cmp qword [rcx + 0x48], 0
jne 0x140001e79
or edx, edi
xor r8d, r8d
call fcn.140001540
mov rdx, r14
mov rcx, r13
call fcn.140009e30
mov r13, rax
mov dl, 0xa
mov rcx, rax
call fcn.140005350
mov r12d, r15d
mov rcx, qword [r13]
movsxd rcx, dword [rcx + 4]
test byte [rcx + r13 + 0x10], 6
jne 0x140001ebe
mov rcx, qword [rcx + r13 + 0x48]
mov rdx, qword [rcx]
call qword [rdx + 0x68]
cmp eax, 0xffffffff
cmove r12d, edi
mov rax, qword [r13]
movsxd rcx, dword [rax + 4]
add rcx, r13
test r12d, r12d
je 0x140001ee5
mov edx, dword [rcx + 0x10]
or edx, r12d
cmp qword [rcx + 0x48], 0
jne 0x140001edd
or edx, edi
xor r8d, r8d
call fcn.140001540
mov qword [rbx + 0x18], 0xf
mov qword [rbx + 0x10], r15
mov byte [rbx], 0
lea rax, [rbp + 0x28]
cmp rbx, rax
je 0x140001f68
cmp qword [rbx + 0x18], 0x10
jb 0x140001f0c
mov rcx, qword [rbx]
call fcn.14000d68c
mov qword [rbx + 0x18], 0xf
mov qword [rbx + 0x10], r15
mov byte [rbx], 0
mov rcx, qword [rbp + 0x40]
cmp rcx, 0x10
jae 0x140001f3e
mov r8, qword [rbp + 0x38]
inc r8
lea rdx, [rbp + 0x28]
mov rcx, rbx
call fcn.14000c4b0
mov rcx, qword [rbp + 0x40]
jmp 0x140001f49
mov rax, qword [rbp + 0x28]
mov qword [rbx], rax
mov qword [rbp + 0x28], r15
mov rax, qword [rbp + 0x38]
mov qword [rbx + 0x10], rax
mov qword [rbx + 0x18], rcx
mov eax, 0xf
mov qword [rbp + 0x40], rax
mov qword [rbp + 0x38], r15
mov byte [rbp + 0x28], 0
jmp 0x140001f6c
mov rax, qword [rbp + 0x40]
cmp rax, 0x10
jb 0x140001f7b
mov rcx, qword [rbp + 0x28]
call fcn.14000d68c
mov qword [rbp + 0x40], 0xf
mov qword [rbp + 0x38], r15
mov byte [rbp + 0x28], 0
cmp qword [rsi + 0x18], 0x10
jb 0x140001f9a
mov rcx, qword [rsi]
call fcn.14000d68c
mov qword [rsi + 0x18], 0xf
mov qword [rsi + 0x10], r15
mov byte [rsi], 0
mov rax, rbx
mov rcx, qword [rbp + 0x50]
xor rcx, rsp
call fcn.14000c100
mov rbx, qword [rsp + 0x1b0]
add rsp, 0x160
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret