Function at 0x140059af0
Capabilities:
Connect pipe
Create pipe

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x10]
sub rsp, 0x110
mov qword [rbp - 0x58], 0xfffffffffffffffe
mov qword [rsp + 0x160], rbx
mov rax, qword [0x1401ace90]
xor rax, rsp
mov qword [rbp], rax
mov r13, rdx
mov r12, rcx
lea rcx, [rsp + 0x70]
call fcn.140059a30
mov r8, qword [rax]
mov qword [rbp - 0x10], r8
mov rax, qword [rax + 8]
mov qword [rbp - 8], rax
lea rdx, [rbp - 0x10]
lea rcx, [rbp - 0x30]
call fcn.140059890
nop
lea r8, [rbp - 0x30]
lea rcx, [rbp - 0x50]
call fcn.14005bf20
nop
lea rcx, [rbp - 0x50]
cmp qword [rbp - 0x38], 8
cmovae rcx, qword [rbp - 0x50]
xor ebx, ebx
mov qword [rsp + 0x38], rbx
mov dword [rsp + 0x30], ebx
mov dword [rsp + 0x28], 0x2000
mov dword [rsp + 0x20], 0x2000
lea r9d, [rbx + 1]
xor r8d, r8d
mov edx, 0x40000001
call qword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov r15, rax
mov rdi, rax
mov qword [rsp + 0x68], rax
mov edx, dword [0x1401b4d80]
lea r8d, [rdx + 2]
lea ecx, [rdx + 1]
imul r8d, ecx
imul r8d, edx
mov eax, 0x2e8ba2e9
imul r8d
sar edx, 2
mov eax, edx
shr eax, 0x1f
add edx, eax
imul edx, edx, 0x16
sub r8d, edx
cmp r8d, 1
jne 0x140059c01
lea eax, [rbx + 4]
mov r8d, 0x88
test r8d, r8d
je 0x140059bf8
mov ecx, r8d
cdq
idiv r8d
mov r8d, edx
mov eax, ecx
test ecx, ecx
jne 0x140059be3
add eax, r8d
mov dword [0x1401b4d80], eax
test r15, r15
jne 0x140059c4c
lea rax, str.Failure_to_create_pipes_0
mov qword [rsp + 0x40], rax
lea rdx, [rsp + 0x40]
lea rcx, [rsp + 0x70]
call fcn.1400cb068
nop
lea rax, vtable.CRSimpleIPCException.0
mov qword [rsp + 0x70], rax
lea rax, vtable.CRSimpleIPCExceptionServerException.0
mov qword [rsp + 0x70], rax
lea rdx, [0x140177bd8]
lea rcx, [rsp + 0x70]
call fcn.1400cfab8
int3
mov qword [rbp - 0x78], rbx
xor eax, eax
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], rax
mov qword [rbp - 0x60], rax
xor r9d, r9d
xor r8d, r8d
lea edx, [rax + 1]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov rsi, rax
mov qword [rsp + 0x70], rax
mov ecx, dword [0x1401b4d80]
imul ecx, ecx
mov eax, 0x92492493
imul ecx
add edx, ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add edx, eax
imul edx, edx, 0xe
sub ecx, edx
cmp ecx, 0xc
jne 0x140059cc4
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], ebx
mov dword [rsp + 0x20], ebx
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateFileW]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_FindNextFileW]
mov qword [rbp - 0x60], rsi
test rsi, rsi
jne 0x140059d13
lea rax, str.Failure_to_create_pipes_1
mov qword [rsp + 0x40], rax
lea rdx, [rsp + 0x40]
lea rcx, [rsp + 0x50]
call fcn.1400cb068
nop
lea rax, vtable.CRSimpleIPCException.0
mov qword [rsp + 0x50], rax
lea rax, vtable.CRSimpleIPCExceptionServerException.0
mov qword [rsp + 0x50], rax
lea rdx, [0x140177bd8]
lea rcx, [rsp + 0x50]
call fcn.1400cfab8
int3
lea rdx, [rbp - 0x78]
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x140059f68
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x140059f68
lea rcx, [rbp - 0x50]
cmp qword [rbp - 0x38], 8
cmovae rcx, qword [rbp - 0x50]
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], 0x40000000
mov dword [rsp + 0x20], 3
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r14, rax
mov rbx, rax
mov qword [rsp + 0x40], rax
test rax, rax
jne 0x140059dc3
lea rax, str.Failure_to_create_pipes_3
mov qword [rsp + 0x48], rax
lea rdx, [rsp + 0x48]
lea rcx, [rsp + 0x50]
call fcn.1400cb068
nop
lea rax, vtable.CRSimpleIPCException.0
mov qword [rsp + 0x50], rax
lea rax, vtable.CRSimpleIPCExceptionServerException.0
mov qword [rsp + 0x50], rax
lea rdx, [0x140177bd8]
lea rcx, [rsp + 0x50]
call fcn.1400cfab8
int3
mov edx, 0x7d0
mov rcx, qword [rbp - 0x60]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x140059e1c
lea rax, str.Failure_to_create_pipes_4
mov qword [rsp + 0x48], rax
lea rdx, [rsp + 0x48]
lea rcx, [rsp + 0x50]
call fcn.1400cb068
nop
lea rax, vtable.CRSimpleIPCException.0
mov qword [rsp + 0x50], rax
lea rax, vtable.CRSimpleIPCExceptionServerException.0
mov qword [rsp + 0x50], rax
lea rdx, [0x140177bd8]
lea rcx, [rsp + 0x50]
call fcn.1400cfab8
int3
lea rax, [rsp + 0x40]
cmp r12, rax
je 0x140059e4b
xor ebx, ebx
mov qword [rsp + 0x40], rbx
mov rcx, qword [r12]
cmp r14, rcx
je 0x140059e4b
test rcx, rcx
je 0x140059e47
cmp rcx, 0xffffffffffffffff
je 0x140059e47
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [r12], r14
mov r8d, dword [0x1401b4d80]
mov ecx, r8d
imul ecx, r8d
imul ecx, r8d
mov eax, 0x38e38e39
imul ecx
sar edx, 1
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*8]
sub ecx, eax
cmp ecx, 3
jne 0x140059eb9
mov eax, 0x51eb851f
imul r8d
sar edx, 5
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
imul edx, edx, 0x64
sub r8d, edx
add r8d, 0x7b
movsxd rcx, r8d
mov eax, 4
mul rcx
mov rcx, 0xffffffffffffffff
cmovo rax, rcx
mov rcx, rax
call fcn.1400c7228
mov rcx, rax
call fcn.1400c8c8c
lea rax, [rsp + 0x68]
xor r14d, r14d
cmp r13, rax
je 0x140059eec
mov edi, r14d
mov qword [rsp + 0x68], r14
mov rcx, qword [r13]
cmp r15, rcx
je 0x140059eec
test rcx, rcx
je 0x140059ee8
cmp rcx, 0xffffffffffffffff
je 0x140059ee8
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [r13], r15
lea rax, [rbx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140059f00
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
cmp rsi, 0xffffffffffffffff
je 0x140059f10
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
lea rax, [rdi - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140059f24
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
cmp qword [rbp - 0x38], 8
jb 0x140059f34
mov rcx, qword [rbp - 0x50]
call fcn.1400c7bc0
mov qword [rbp - 0x38], 7
mov qword [rbp - 0x40], r14
mov word [rbp - 0x50], r14w
cmp qword [rbp - 0x18], 8
jb 0x140059f55
mov rcx, qword [rbp - 0x30]
call fcn.1400c7bc0
mov qword [rbp - 0x18], 7
mov qword [rbp - 0x20], r14
mov word [rbp - 0x30], r14w
jmp 0x140059fae
lea rax, str.Failure_to_create_pipes_2
mov qword [rsp + 0x48], rax
lea rdx, [rsp + 0x48]
lea rcx, [rsp + 0x50]
call fcn.1400cb068
nop
lea rax, vtable.CRSimpleIPCException.0
mov qword [rsp + 0x50], rax
lea rax, vtable.CRSimpleIPCExceptionServerException.0
mov qword [rsp + 0x50], rax
lea rdx, [0x140177bd8]
lea rcx, [rsp + 0x50]
call fcn.1400cfab8
nop
mov rcx, qword [rbp]
xor rcx, rsp
call fcn.1400c7be0
mov rbx, qword [rsp + 0x160]
add rsp, 0x110
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret