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

Disassembly:
mov qword [rsp + 8], rcx
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x98]
sub rsp, 0x198
xor edi, edi
lea rcx, [rsp + 0x78]
mov r13, r8
mov qword [rsp + 0x60], rdi
mov rbx, rdx
mov qword [rsp + 0x58], rdi
xor edx, edx
mov qword [rsp + 0x50], rdi
lea esi, [rdi + 0x18]
mov qword [rbp + 0xf0], rdi
mov r8d, esi
mov qword [rsp + 0x70], rdi
mov r12d, r9d
mov qword [rsp + 0x68], rdi
mov dword [rbp + 0xf8], edi
call fcn.14002cdf0
mov dword [rsp + 0x78], esi
lea r14d, [rdi + 1]
lea esi, [rdi + 0x68]
mov qword [rbp - 0x80], rdi
mov r8d, esi
mov dword [rbp - 0x78], r14d
xor edx, edx
lea rcx, [rbp - 0x50]
call fcn.14002cdf0
mov eax, r12d
mov dword [rbp - 0x50], esi
mov dword [rbp - 0x14], r14d
mov word [rbp - 0x10], di
and eax, 2
jne 0x140059b94
mov word [rbp - 0x10], r14w
neg eax
mov r15d, 0x20
sbb esi, esi
and esi, 0x10
add esi, r15d
test r12b, 0x40
je 0x140059bcc
mov rax, qword [rbp + 0x100]
test rax, rax
je 0x140059bcc
mov rcx, qword [rax + 0x18]
test rcx, rcx
je 0x140059bcc
mov dword [rbp - 0x14], 0x101
mov qword [rbp], rcx
jmp 0x140059c0a
mov eax, r12d
and eax, 0x14
cmp al, 0x14
jne 0x140059c14
xor r9d, r9d
lea r8, [rsp + 0x78]
lea rdx, [rsp + 0x58]
lea rcx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
je 0x140059c14
mov rax, qword [rsp + 0x60]
lea rcx, [rsp + 0x58]
bts dword [rbp - 0x14], 8
mov qword [rbp], rax
call fcn.140059a44
mov dword [rbp + 0xf8], r14d
mov esi, r15d
mov eax, r12d
and eax, 4
mov dword [rbp + 0xe8], eax
je 0x140059cb1
test r12b, 8
je 0x140059c6e
xor r9d, r9d
lea r8, [rsp + 0x78]
lea rdx, [rbp + 0xf0]
lea rcx, [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
je 0x140059c6e
mov rax, qword [rbp + 0xf0]
lea rcx, [rsp + 0x50]
bts dword [rbp - 0x14], 8
mov qword [rbp + 8], rax
call fcn.140059a44
and esi, 0xffffffef
mov dword [rbp + 0xf8], r14d
test r15b, r12b
je 0x140059cb1
xor r9d, r9d
lea r8, [rsp + 0x78]
lea rdx, [rsp + 0x68]
lea rcx, [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
je 0x140059cb1
mov rax, qword [rsp + 0x68]
lea rcx, [rsp + 0x70]
bts dword [rbp - 0x14], 8
mov qword [rbp + 0x10], rax
call fcn.140059a44
and esi, 0xffffffef
mov dword [rbp + 0xf8], r14d
test dword [rbp - 0x14], 0x100
je 0x140059cf9
cmp qword [rbp], rdi
jne 0x140059ccf
mov ecx, 0xfffffff6
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov qword [rbp], rax
cmp qword [rbp + 8], rdi
jne 0x140059ce4
mov ecx, 0xfffffff5
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov qword [rbp + 8], rax
cmp qword [rbp + 0x10], rdi
jne 0x140059cf9
mov ecx, 0xfffffff4
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov qword [rbp + 0x10], rax
mov rax, qword [rbp + 0xe0]
lea r14, [0x1401a8080]
test rax, rax
mov r15, r14
cmovne r15, rax
test rbx, rbx
mov rcx, r15
cmovne r14, rbx
mov qword [rbp + 0xe0], r14
call fcn.14001e0fc
mov rcx, r14
mov rbx, rax
call fcn.14001e0fc
mov rcx, qword [0x140210620]
add rax, rbx
xor edx, edx
lea r8, [rax*2 + 8]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
cmp word [r15], 0x22
mov r14, rax
mov rcx, rax
je 0x140059d81
lea rdx, [0x1401bfd3c]
call fcn.140148ebc
mov rdx, r15
mov rcx, r14
call fcn.140148ed8
lea rdx, [0x1401bfd3c]
mov rcx, r14
call fcn.140148ed8
jmp 0x140059d89
mov rdx, r15
call fcn.140148ebc
mov rbx, qword [rbp + 0xe0]
cmp word [rbx], di
je 0x140059daf
lea rdx, [0x1401bfd40]
mov rcx, r14
call fcn.140148ed8
mov rdx, rbx
mov rcx, r14
call fcn.140148ed8
test r13, r13
je 0x140059dc2
movzx eax, word [r13]
neg ax
sbb rcx, rcx
and r13, rcx
lea rax, [rbp - 0x70]
xor r9d, r9d
mov qword [rsp + 0x48], rax
xor r8d, r8d
lea rax, [rbp - 0x50]
mov rdx, r14
mov qword [rsp + 0x40], rax
xor ecx, ecx
mov eax, dword [rbp + 0xf8]
mov qword [rsp + 0x38], r13
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], esi
mov dword [rsp + 0x20], eax
call qword [sym.imp.KERNEL32.dll_CreateProcessW]
mov rcx, qword [rbp + 0xf0]
test eax, eax
je 0x140059ec4
test rcx, rcx
je 0x140059e17
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140059e27
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x140059e37
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp - 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test r12b, 1
je 0x140059e54
mov rcx, qword [rbp - 0x70]
or edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [rbp + 0xe8], edi
je 0x140059ebb
lea rcx, [0x140213aa0]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, 0x40
lea rcx, [0x140211ba0]
call fcn.140072b00
lea rcx, [0x140213aa0]
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rax, qword [rbp - 0x70]
mov qword [rdi], rax
mov eax, dword [rbp - 0x60]
mov dword [rdi + 8], eax
mov rax, qword [rsp + 0x50]
mov qword [rdi + 0x18], rax
mov rax, qword [rsp + 0x58]
mov qword [rdi + 0x10], rax
mov rax, qword [rsp + 0x70]
mov qword [rdi + 0x20], rax
mov dword [rdi + 0x28], r12d
jmp 0x14005a039
mov rcx, qword [rbp - 0x70]
jmp 0x14005a02e
test rcx, rcx
je 0x140059ecf
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x50]
test rcx, rcx
je 0x140059edf
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x140059eef
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140059eff
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x140059f0f
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x70]
test rcx, rcx
je 0x140059f1f
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test r12b, 0x78
jne 0x14005a039
test r13, r13
jne 0x140059f6b
mov rcx, r15
call fcn.14001e0fc
lea rbx, [r15 - 2]
lea rbx, [rbx + rax*2]
jmp 0x140059f4a
cmp word [rbx], 0x5c
je 0x140059f51
sub rbx, 2
cmp rbx, r15
ja 0x140059f40
jmp 0x140059f6b
mov rdx, r15
mov rcx, r14
call fcn.140148ebc
sub rbx, r15
mov r13, r14
sar rbx, 1
mov word [r14 + rbx*2 + 2], di
mov ebx, reloc.WS2_32.dll_WSASetLastError
lea rcx, [rbp + 0x20]
mov r8d, ebx
xor edx, edx
call fcn.14002cdf0
movzx eax, word [rbp - 0x10]
lea rcx, [rbp + 0x20]
mov dword [rbp + 0x50], eax
mov rax, qword [rbp + 0xe0]
mov qword [rbp + 0x40], rax
mov dword [rbp + 0x20], ebx
mov dword [rbp + 0x24], 0x540
mov qword [rbp + 0x30], rdi
mov qword [rbp + 0x48], r13
mov qword [rbp + 0x38], r15
call qword [sym.imp.SHELL32.dll_ShellExecuteExW]
test eax, eax
je 0x14005a039
test r12b, 1
je 0x140059fce
mov rcx, qword [rbp + 0x88]
or edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [rbp + 0xe8], edi
je 0x14005a027
lea rcx, [0x140213aa0]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, 0x40
lea rcx, [0x140211ba0]
call fcn.140072b00
lea rcx, [0x140213aa0]
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [rbp + 0x88]
or dword [rbx + 8], 0xffffffff
mov qword [rbx + 0x18], rdi
mov qword [rbx + 0x10], rdi
mov qword [rbx + 0x20], rdi
mov rdi, rbx
mov qword [rbx], rcx
mov dword [rbx + 0x28], r12d
jmp 0x14005a039
mov rcx, qword [rbp + 0x88]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, 1
mov rcx, qword [0x140210620]
mov r8, r14
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rax, rdi
add rsp, 0x198
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret