Function at 0x140139470
Capabilities:
Create pipe
Create thread

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 - 0x60], 0xfffffffffffffffe
mov qword [rsp + 0x150], rbx
mov rax, qword [0x14028c238]
xor rax, rsp
mov qword [rbp], rax
mov r15, r8
mov r14, rdx
mov qword [rbp - 0x48], rdx
xor r12d, r12d
lea r13, [0x14029af20]
nop word [rax + rax]
lea rdx, [rbp - 0x20]
mov rcx, r14
call fcn.140140ce0
cmp qword [rax + 0x18], 8
jb 0x1401394d6
mov rax, qword [rax]
mov qword [rsp + 0x38], r12
mov dword [rsp + 0x30], r12d
mov dword [rsp + 0x28], 0x1000
mov dword [rsp + 0x20], 0x1000
mov edx, 0x40000003
mov r9d, 0xff
mov r8d, 6
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov rsi, rax
mov r8, qword [rbp - 8]
cmp r8, 8
jb 0x140139527
inc r8
mov rdx, qword [rbp - 0x20]
lea rcx, [rbp - 0x20]
call fcn.1400c3a10
mov qword [rbp - 8], 7
mov qword [rbp - 0x10], r12
mov word [rbp - 0x20], r12w
lea rax, [rsi - 1]
cmp rax, 0xfffffffffffffffd
ja 0x1401397d2
xor r9d, r9d
xor r8d, r8d
lea edx, [r9 + 1]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [rbp - 0x68], rax
lea rax, [rbp - 0x80]
mov qword [rsp + 0x40], rax
lea r8, [rsp + 0x40]
lea rdx, [rsp + 0x48]
call fcn.14012bf20
nop
mov rax, qword [rbp - 0x68]
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x78], r15
lea rdx, [rbp - 0x80]
mov rcx, rsi
call fcn.1401382b0
movzx ebx, al
or r9d, 0xffffffff
xor r8d, r8d
lea rdx, [rsp + 0x70]
lea ecx, [r8 + 2]
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 1
je 0x1401398e8
test bl, bl
je 0x1401396a3
mov dword [rsp + 0x50], r12d
xor r9d, r9d
lea r8, [rsp + 0x50]
lea rdx, [rbp - 0x80]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x1401396a3
mov qword [rbp - 0x28], 7
mov qword [rbp - 0x30], r12
mov word [rbp - 0x40], r12w
lea r8d, [rax + 0x39]
lea rdx, str._Wa3rdPartyHost::ServerListen__GetOverlappedResult_failed
lea rcx, [rbp - 0x40]
call fcn.1400c3720
nop
call fcn.1400e04b0
mov rbx, rax
mov qword [rbp - 0x58], r13
mov rcx, r13
call fcn.14016ffac
test eax, eax
je 0x140139620
mov ecx, eax
call fcn.14016fae4
mov byte [rbp - 0x50], 1
cmp qword [rbx + 0x48], 0
je 0x140139660
mov dword [rsp + 0x40], 1
mov rdi, qword [rbx + 0x48]
test rdi, rdi
je 0x1401397ed
mov rax, qword [rdi]
mov rbx, qword [rax + 0x10]
mov rcx, rbx
call qword [fcn.140005fb0]
lea r8, [rsp + 0x40]
lea rdx, [rbp - 0x40]
mov rcx, rdi
call rbx
jmp 0x14013966d
lea rdx, [rbp - 0x40]
mov rcx, rbx
call fcn.1400dba60
nop
mov rcx, r13
call fcn.14016ffd0
test eax, eax
je 0x140139681
mov ecx, eax
call fcn.14016fae4
nop
mov r8, qword [rbp - 0x28]
cmp r8, 8
jb 0x14013969b
inc r8
mov rdx, qword [rbp - 0x40]
lea rcx, [rbp - 0x40]
call fcn.1400c3a10
mov rcx, rsi
jmp 0x1401397a3
mov qword [rbp - 0x28], 7
mov qword [rbp - 0x30], r12
mov word [rbp - 0x40], r12w
mov r8d, 0x2f
lea rdx, str._Wa3rdPartyHost::ServerListen__client_connected
lea rcx, [rbp - 0x40]
call fcn.1400c3720
nop
call fcn.1400e04b0
mov rbx, rax
mov qword [rsp + 0x58], r13
mov rcx, r13
call fcn.14016ffac
test eax, eax
je 0x1401396eb
mov ecx, eax
call fcn.14016fae4
mov byte [rsp + 0x60], 1
cmp qword [rbx + 0x48], 0
je 0x14013972c
mov dword [rsp + 0x40], 1
mov rdi, qword [rbx + 0x48]
test rdi, rdi
je 0x1401397f3
mov rax, qword [rdi]
mov rbx, qword [rax + 0x10]
mov rcx, rbx
call qword [fcn.140005fb0]
lea r8, [rsp + 0x40]
lea rdx, [rbp - 0x40]
mov rcx, rdi
call rbx
jmp 0x140139739
lea rdx, [rbp - 0x40]
mov rcx, rbx
call fcn.1400dba60
nop
mov rcx, r13
call fcn.14016ffd0
test eax, eax
je 0x14013974d
mov ecx, eax
call fcn.14016fae4
nop
mov r8, qword [rbp - 0x28]
cmp r8, 8
jb 0x140139767
inc r8
mov rdx, qword [rbp - 0x40]
lea rcx, [rbp - 0x40]
call fcn.1400c3a10
mov ecx, reloc.OLEAUT32.dll_SafeArrayGetDim
call fcn.14016e754
mov qword [rax + 8], rsi
mov qword [rax], r14
lea rcx, [rsp + 0x68]
mov qword [rsp + 0x28], rcx
mov dword [rsp + 0x20], r12d
mov r9, rax
lea r8, [0x140140380]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
test rax, rax
je 0x1401397f9
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
mov rbx, qword [rsp + 0x48]
test rbx, rbx
je 0x1401394c0
mov rcx, rbx
call fcn.140139b40
mov edx, 8
mov rcx, rbx
call fcn.14016ea38
jmp 0x1401394c0
mov edx, 0x1f4
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x1401399e4
jmp 0x1401394c0
call fcn.14016f984
nop
call fcn.14016f984
nop
mov qword [rbp - 0x28], 7
mov qword [rbp - 0x30], r12
mov word [rbp - 0x40], r12w
mov r8d, 0x32
lea rdx, str._Wa3rdPartyHost::ServerListen__CreateThread_failed
lea rcx, [rbp - 0x40]
call fcn.1400c3720
nop
call fcn.1400e04b0
mov rbx, rax
mov qword [rsp + 0x58], r13
mov rcx, r13
call fcn.14016ffac
test eax, eax
je 0x140139841
mov ecx, eax
call fcn.14016fae4
mov byte [rsp + 0x60], 1
cmp qword [rbx + 0x48], 0
je 0x140139884
mov dword [rsp + 0x40], 1
mov rdi, qword [rbx + 0x48]
test rdi, rdi
jne 0x140139864
call fcn.14016f984
int3
mov rax, qword [rdi]
mov rbx, qword [rax + 0x10]
mov rcx, rbx
call qword [fcn.140005fb0]
lea r8, [rsp + 0x40]
lea rdx, [rbp - 0x40]
mov rcx, rdi
call rbx
jmp 0x140139891
lea rdx, [rbp - 0x40]
mov rcx, rbx
call fcn.1400dba60
nop
mov rcx, r13
call fcn.14016ffd0
test eax, eax
je 0x1401398a5
mov ecx, eax
call fcn.14016fae4
nop
mov r8, qword [rbp - 0x28]
cmp r8, 8
jb 0x1401398c0
inc r8
mov rdx, qword [rbp - 0x40]
lea rcx, [rbp - 0x40]
call fcn.1400c3a10
nop
mov rbx, qword [rsp + 0x48]
test rbx, rbx
je 0x1401399e4
mov rcx, rbx
call fcn.140139b40
mov edx, 8
mov rcx, rbx
call fcn.14016ea38
jmp 0x1401399e4
mov qword [rbp - 0x28], 7
mov qword [rbp - 0x30], r12
mov word [rbp - 0x40], r12w
mov r8d, 0x34
lea rdx, str._Wa3rdPartyHost::ServerListen__cancelHandle_signaled
lea rcx, [rbp - 0x40]
call fcn.1400c3720
nop
call fcn.1400e04b0
mov rbx, rax
mov qword [rsp + 0x58], r13
mov rcx, r13
call fcn.14016ffac
test eax, eax
je 0x140139930
mov ecx, eax
call fcn.14016fae4
mov byte [rsp + 0x60], 1
cmp qword [rbx + 0x48], 0
je 0x140139973
mov dword [rsp + 0x40], 1
mov rdi, qword [rbx + 0x48]
test rdi, rdi
jne 0x140139953
call fcn.14016f984
int3
mov rax, qword [rdi]
mov rbx, qword [rax + 0x10]
mov rcx, rbx
call qword [fcn.140005fb0]
lea r8, [rsp + 0x40]
lea rdx, [rbp - 0x40]
mov rcx, rdi
call rbx
jmp 0x140139980
lea rdx, [rbp - 0x40]
mov rcx, rbx
call fcn.1400dba60
nop
mov rcx, r13
call fcn.14016ffd0
test eax, eax
je 0x140139994
mov ecx, eax
call fcn.14016fae4
nop
mov r8, qword [rbp - 0x28]
cmp r8, 8
jb 0x1401399ae
inc r8
mov rdx, qword [rbp - 0x40]
lea rcx, [rbp - 0x40]
call fcn.1400c3a10
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
mov rbx, qword [rsp + 0x48]
test rbx, rbx
je 0x1401399d8
mov rcx, rbx
call fcn.140139b40
mov edx, 8
mov rcx, rbx
call fcn.14016ea38
nop
mov rcx, r14
call fcn.1400d6630
mov al, 1
jmp 0x1401399ee
mov rcx, r14
call fcn.1400d6630
xor al, al
mov rcx, qword [rbp]
xor rcx, rsp
call fcn.14016e480
mov rbx, qword [rsp + 0x150]
add rsp, 0x110
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret