Function at 0x180016958
Capabilities:
Create pipe
Create thread
Terminate thread

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x40
mov r8d, dword [rcx + 0x60]
mov rbx, rcx
lea rdx, str._d__n
mov ecx, 0x15e
call fcn.180030818
xor ecx, ecx
cmp qword [rbx + 0x20], 0xffffffffffffffff
lea r14d, [rcx + 1]
lea ebp, [rcx + 2]
mov edi, ecx
mov esi, ecx
mov dword [rsp + 0x80], ecx
mov r13b, r14b
mov dword [rsp + 0x88], ebp
jne 0x1800169b0
xor eax, eax
jmp 0x180016c58
mov eax, r14d
lock cmpxchg dword [rbx + 0x60], ecx
test eax, eax
je 0x1800169a9
cmp dword [rbx + 0x30], ecx
jne 0x1800169da
xor eax, eax
lock cmpxchg dword [rbx + 0x60], r14d
cmp eax, r14d
jne 0x1800169a9
mov rcx, qword [rbx + 0x68]
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x1800169a9
mov eax, 8
cmp dword [rbx + 0x30], ebp
jne 0x1800169ff
mov rcx, qword [rbx + 0x20]
mov r8d, eax
mov edx, eax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
xor ecx, ecx
mov r12, rax
test rax, rax
jne 0x180016a07
jmp 0x1800169c1
mov r12, qword [rsp + 0x80]
mov eax, r14d
lock cmpxchg dword [rbx + 0x60], r14d
test eax, eax
jne 0x180016c05
mov r15, rcx
test r13b, r13b
je 0x180016a2f
mov r13b, cl
mov rcx, qword [rbx + 0x28]
mov rax, qword [rcx]
call qword [rax + 0x10]
xor ecx, ecx
test rdi, rdi
jne 0x180016a92
mov rcx, qword [rbx + 0x20]
lea edx, [rdi + 8]
lea r8d, [rdi + 0x10]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
xor ecx, ecx
mov rdi, rax
test rax, rax
je 0x180016b93
mov eax, dword [rbx + 0x50]
mov r9d, dword [rbx + 0x4c]
mov r8d, dword [rbx + 0x44]
mov edx, dword [rbx + 0x40]
mov qword [rsp + 0x38], rcx
mov dword [rsp + 0x30], ecx
mov rcx, qword [rbx + 0x38]
mov dword [rsp + 0x28], eax
mov eax, dword [rbx + 0x54]
mov dword [rsp + 0x20], eax
call qword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov qword [rdi], rax
cmp rax, 0xffffffffffffffff
je 0x180016b84
mov qword [rdi + 8], rbx
xor ecx, ecx
mov r9, qword [rdi]
mov qword [rsp + 0x28], rcx
mov dword [rsp + 0x20], ecx
lea r8, [0x180016dbc]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.msvcrt.dll__beginthreadex]
mov rsi, rax
test rax, rax
je 0x180016ba7
mov ebp, 1
mov eax, ebp
lock cmpxchg dword [rbx + 0x60], ebp
test eax, eax
jne 0x180016adb
lea edx, [rax + 0x64]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x180016ac0
mov eax, ebp
lock cmpxchg dword [rbx + 0x60], ebp
mov ebp, dword [rsp + 0x88]
je 0x180016bc4
cmp dword [rbx + 0x30], 1
jne 0x180016b06
mov rcx, rdi
call fcn.180016d74
mov esi, dword [rsp + 0x80]
jmp 0x180016b69
and qword [rsp + 0x28], 0
and dword [rsp + 0x20], 0
lea r8, [fcn.180016d74]
mov r9, rdi
xor edx, edx
xor ecx, ecx
call qword [sym.imp.msvcrt.dll__beginthreadex]
test rax, rax
je 0x180016b9e
mov esi, dword [rsp + 0x80]
mov qword [r15 + r12], rax
mov rcx, qword [rbx + 0x20]
xor edi, edi
mov r8, r12
add r15, 8
lea eax, [rdi + 1]
lea edx, [rdi + 8]
add r14d, eax
add esi, eax
mov r9d, r14d
mov dword [rsp + 0x80], esi
shl r9, 3
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
mov r12, rax
test rax, rax
je 0x180016b93
mov ecx, 1
mov eax, ecx
lock cmpxchg dword [rbx + 0x60], ecx
xor ecx, ecx
test eax, eax
jne 0x180016bff
jmp 0x180016a1b
mov rcx, qword [rbx + 0x20]
mov r8, rdi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov r14d, 1
mov ebp, r14d
jmp 0x180016c05
mov rcx, qword [rdi]
call qword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
mov rdx, rdi
mov rcx, rbx
call fcn.180036cbc
mov esi, dword [rsp + 0x80]
mov r14d, 1
mov ebp, r14d
jmp 0x180016c05
lea rdx, [rsp + 0x90]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetExitCodeThread]
cmp dword [rsp + 0x90], 0x103
jne 0x180016bed
xor edx, edx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_TerminateThread]
mov rdx, rdi
mov rcx, rbx
call fcn.180036cbc
mov esi, dword [rsp + 0x80]
mov r14d, 1
xor eax, eax
lock cmpxchg dword [rbx + 0x60], r14d
cmp dword [rbx + 0x30], 2
jne 0x180016c4c
or r9d, 0xffffffff
mov r8d, r14d
mov rdx, r12
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
test r12, r12
je 0x180016c3b
mov rcx, qword [rbx + 0x20]
mov r8, r12
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x180016c4c
lea rdx, str._HeapFree__NULL_n
mov ecx, 0x1c0
call fcn.180030818
mov rcx, qword [rbx + 0x68]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, ebp
mov rbx, qword [rsp + 0x98]
add rsp, 0x40
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret