Function at 0x140012e20
Capabilities:
Connect pipe
Create pipe
Create thread
Resume thread

Disassembly:
mov rax, rsp
push rbx
push r12
sub rsp, 0xa8
mov qword [rax - 0x28], rdi
lea rdx, [rcx + 0x18]
mov qword [rax - 0x30], r14
mov rbx, rcx
mov qword [rax - 0x38], r15
xor r12d, r12d
mov dword [rax + 0x10], r12d
mov eax, dword [rcx + 8]
and eax, 1
mov byte [rcx + 0xc], 1
lea rcx, str.NamedPipeServer::ServerThread___Begin___s____OpenMode___x_n
lea r14d, [rax*2 + 0x40000001]
mov r8d, r14d
call fcn.1400213c0
lea r9, [rsp + 0xc0]
mov qword [rsp + 0xd0], r12
lea r8, [rsp + 0xd0]
mov dword [rsp + 0xc0], r12d
lea edx, [r12 + 1]
lea rcx, str.S:_ML__NW___LW_D:_A__0x12019f___WD_
call qword [sym.imp.ADVAPI32.dll_ConvertStringSecurityDescriptorToSecurityDescriptorW]
test eax, eax
je 0x140012ebd
mov rax, qword [rsp + 0xd0]
mov qword [rsp + 0x48], rax
mov dword [rsp + 0x40], reloc.ODBC32.dll_SQLAllocHandle
mov dword [rsp + 0x50], 1
jmp 0x140012f1c
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.NamedPipe::ServerThread:_SetSecurityDescriptorDacl_failed__d_n_n
mov edi, eax
call fcn.1400213c0
cmp edi, 0x70c
jne 0x140012f1c
mov edx, 1
lea rcx, [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x140012f1c
xor r9d, r9d
lea rcx, [rsp + 0x58]
xor r8d, r8d
lea edx, [r9 + 1]
call qword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
jne 0x140012f1c
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.NamedPipe::ServerThread:_SetSecurityDescriptorDacl_2_failed__d_n_n
call fcn.1400213c0
cmp byte [rbx + 0xc], r12b
je 0x14001309b
mov qword [rsp + 0xa0], rbp
mov qword [rsp + 0x98], rsi
nop word [rax + rax]
lea rax, [rsp + 0x40]
mov r9d, 0xff
mov qword [rsp + 0x38], rax
lea rcx, [rbx + 0x18]
mov dword [rsp + 0x30], 0x3e8
mov r8d, 6
mov dword [rsp + 0x28], 0x400
mov edx, r14d
mov dword [rsp + 0x20], 0x400
call qword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov qword [rbx + 0x228], rax
cmp rax, 0xffffffffffffffff
je 0x140013071
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x140012fbe
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
je 0x140012fbe
mov rcx, qword [rbx + 0x228]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
movzx eax, byte [rbx + 0xc]
jmp 0x140013083
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax]
mov rsi, rax
test rax, rax
je 0x14001306b
test byte [rbx + 8], 2
je 0x140012fdc
mov byte [rax + 0x39], 1
mov rcx, qword [rbx + 0x228]
mov qword [rax + 0x10], rcx
mov ecx, dword [rbx + 8]
shr ecx, 2
not ecx
and ecx, 1
mov dword [rax + 8], ecx
mov ecx, reloc.WS2_32.dll_recv
call fcn.140027a60
lea rcx, [rsp + 0xc8]
mov r9, rax
mov qword [rsp + 0x28], rcx
lea r8, [0x140012dd0]
xor ecx, ecx
mov dword [rsp + 0x20], 4
xor edx, edx
mov qword [rax], rbx
mov qword [rax + 8], rsi
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov qword [rsi + 0x18], rax
mov rbp, rax
test rax, rax
je 0x14001306b
mov edx, dword [rbx + 0x444]
lea rcx, [rbx + 0x438]
inc edx
call sym.KdsMntSvc.exe_public:_bool___cdecl_TARRAY_struct_ARGS____ptr64__1_::Resize_unsigned_int____ptr64
mov ecx, dword [rbx + 0x444]
mov rax, qword [rbx + 0x438]
dec ecx
mov qword [rax + rcx*8], rsi
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_ResumeThread]
movzx eax, byte [rbx + 0xc]
jmp 0x140013083
lea rcx, str.CreatePipe_failed_n
call fcn.1400213c0
xor al, al
mov byte [rbx + 0xc], r12b
test al, al
jne 0x140012f40
mov rsi, qword [rsp + 0x98]
mov rbp, qword [rsp + 0xa0]
mov rcx, qword [rbx + 0x438]
mov r15, qword [rsp + 0x80]
mov r14, qword [rsp + 0x88]
mov rdi, qword [rsp + 0x90]
test rcx, rcx
je 0x1400130df
cmp dword [rbx + 0x444], r12d
je 0x1400130df
call fcn.1400277b4
mov qword [rbx + 0x438], r12
mov qword [rbx + 0x440], 8
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, eax
lea rcx, str.NamedPipeServer::ServerThread__d___End_n
call fcn.1400213c0
xor eax, eax
add rsp, 0xa8
pop r12
pop rbx
ret