Function at 0x14005fe50
Capabilities:
Write file on windows

Disassembly:
push rsi
push rdi
push r14
sub rsp, 0x70
mov qword [rsp + 0x30], 0xfffffffffffffffe
mov qword [rsp + 0xa0], rbx
mov rdi, rcx
cmp byte [rcx + 0x78], 0
je 0x14005fec4
call fcn.140060190
test al, al
jne 0x14005fec4
call fcn.14005e060
test al, al
jne 0x140060176
mov ecx, dword [0x1401c6d80]
mov edx, ecx
test ecx, ecx
je 0x14005feb5
dec edx
je 0x14005fea6
inc ecx
mov dword [0x1401c6d80], ecx
jmp 0x140060176
mov dword [0x1401c6d80], 0
jmp 0x140060176
mov dword [0x1401c6d80], 2
jmp 0x140060176
lea rsi, [rdi + 0xb0]
mov rax, qword [rsi + 8]
cmp qword [rsi], rax
jne 0x14005ff92
mov eax, dword [0x1401c6d80]
imul eax, eax
and eax, 0x8000000f
jge 0x14005feef
dec eax
or eax, 0xfffffff0
inc eax
cmp eax, 0xd
jne 0x14005ff0b
call fcn.1400cd268
mov ecx, dword [0x1401c6d80]
cmp ecx, eax
jne 0x14005ff0b
dec ecx
mov dword [0x1401c6d80], ecx
lea rax, [rdi + 0xd0]
mov qword [rsp + 0x98], rax
lea rbx, [rax + 8]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
cmp qword [rdi + 0x120], 0
jne 0x14005ff40
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x140060176
lea rcx, [rdi + 0x100]
lea rdx, [rsp + 0x50]
call fcn.140038790
mov rdx, rax
mov rax, qword [rax]
test rax, rax
je 0x14005ff5f
mov rax, qword [rax]
mov rcx, qword [rax + 0x10]
dec rcx
and rcx, qword [rdx + 0x10]
mov rax, qword [rax + 8]
mov rdx, qword [rax + rcx*8]
add rdx, 8
mov rcx, rsi
call fcn.140033900
mov qword [rdi + 0xc8], 0
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [rsp + 0x90], 0
mov rdx, qword [rsi]
mov r8, qword [rsi + 8]
sub r8, rdx
lea rcx, [rdi + 0x80]
add rdx, qword [rdi + 0xc8]
mov qword [rsp + 0x20], rcx
lea r9, [rsp + 0x90]
mov rcx, qword [rdi + 0xa8]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x140060064
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x6d
je 0x14006002f
cmp eax, 0x3e5
je 0x140060029
lea rax, str.Channel_write_failure
mov qword [rsp + 0x98], rax
lea rdx, [rsp + 0x98]
lea rcx, [rsp + 0x50]
call fcn.1400cfd38
nop
lea rax, vtable.CRSimpleIPCException.0
mov qword [rsp + 0x50], rax
lea rdx, [0x140189398]
lea rcx, [rsp + 0x50]
call fcn.1400d4788
int3
mov byte [rdi + 0x78], 1
jmp 0x140060064
lea rcx, [rsp + 0x38]
call fcn.1400cfdb0
nop
lea rax, vtable.CRSimpleIPCException.0
mov qword [rsp + 0x38], rax
lea rax, vtable.CRSimpleIPCExceptionDisconnected.0
mov qword [rsp + 0x38], rax
lea rdx, [0x140189350]
lea rcx, [rsp + 0x38]
call fcn.1400d4788
int3
cmp byte [rdi + 0x78], 0
jne 0x140060176
mov r8d, dword [0x1401c6d80]
lea ecx, [r8 + 1]
imul ecx, r8d
mov eax, 0x66666667
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*4]
shl eax, 2
sub ecx, eax
cmp ecx, 1
jne 0x1400600b6
call fcn.1400cd268
mov r8d, dword [0x1401c6d80]
cmp r8d, eax
jne 0x1400600b6
dec r8d
mov dword [0x1401c6d80], r8d
mov eax, dword [rsp + 0x90]
add qword [rdi + 0xc8], rax
mov r14b, 1
lea ecx, [r8 + 2]
lea eax, [r8 + 1]
imul ecx, eax
imul ecx, r8d
mov eax, 0x6bca1af3
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add edx, eax
imul edx, edx, 0x13
sub ecx, edx
cmp ecx, 0xb
jne 0x140060103
mov edx, ecx
lea r8d, [rcx + 1]
lea rcx, [0x14014f02c]
call fcn.1400cd1bc
mov rax, qword [rsi + 8]
sub rax, qword [rsi]
cmp qword [rdi + 0xc8], rax
jne 0x140060163
lea rax, [rdi + 0xd0]
mov qword [rsp + 0x98], rax
lea rbx, [rax + 8]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
lea rcx, [rdi + 0x100]
call fcn.1400605f0
mov rax, qword [rsi]
mov qword [rsi + 8], rax
mov qword [rdi + 0xc8], 0
cmp qword [rdi + 0x120], 0
setne r14b
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [rdi + 0xa0]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
movzx eax, r14b
jmp 0x140060178
xor al, al
mov rbx, qword [rsp + 0xa0]
add rsp, 0x70
pop r14
pop rdi
pop rsi
ret