Function at 0x140065b40
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
push rsi
push rdi
push r14
sub rsp, 0x70
mov qword [rax - 0x58], 0xfffffffffffffffe
mov qword [rax + 0x18], rbx
mov qword [rax + 0x20], rbp
mov rdi, rcx
cmp byte [rcx + 0x78], 0
je 0x140065b71
call fcn.140065e80
test al, al
je 0x140065e61
lea rsi, [rdi + 0xb0]
mov rax, qword [rsi + 8]
xor r14d, r14d
cmp qword [rsi], rax
jne 0x140065c9a
lea rax, [rdi + 0xd0]
mov qword [rsp + 0x98], rax
lea rbx, [rax + 8]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
mov r9d, dword [0x1401d5d60]
mov ecx, r9d
imul ecx, r9d
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, 8
jne 0x140065bf9
mov r8d, 1
cmp r9d, r8d
jle 0x140065bf2
nop dword [rax]
mov eax, r9d
cdq
idiv r8d
inc r8d
add r8d, edx
cmp r8d, r9d
jl 0x140065be0
mov dword [0x1401d5d60], r8d
cmp qword [rdi + 0x120], 0
jne 0x140065c11
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x140065e61
lea rcx, [rdi + 0x100]
lea rdx, [rsp + 0x50]
call fcn.14003a7f0
mov rdx, rax
mov rax, qword [rax]
test rax, rax
jne 0x140065c32
mov rax, r14
jmp 0x140065c35
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.140035890
mov qword [rdi + 0xc8], r14
call fcn.1400638e0
test al, al
jne 0x140065c91
mov ecx, dword [0x1401d5d60]
mov edx, ecx
test ecx, ecx
je 0x140065c87
dec edx
je 0x140065c7e
inc ecx
mov dword [0x1401d5d60], ecx
jmp 0x140065c91
mov dword [0x1401d5d60], r14d
jmp 0x140065c91
mov dword [0x1401d5d60], 2
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [rsp + 0x90], r14d
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 0x140065d69
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x6d
je 0x140065d34
cmp eax, 0x3e5
je 0x140065d2e
lea rax, str.Channel_write_failure
mov qword [rsp + 0x98], rax
lea rdx, [rsp + 0x98]
lea rcx, [rsp + 0x50]
call fcn.1400d6c68
nop
lea rax, vtable.CRSimpleIPCException.0
mov qword [rsp + 0x50], rax
lea rdx, [0x140198428]
lea rcx, [rsp + 0x50]
call fcn.1400db6b8
int3
mov byte [rdi + 0x78], 1
jmp 0x140065d69
lea rcx, [rsp + 0x38]
call fcn.1400d6ce0
nop
lea rax, vtable.CRSimpleIPCException.0
mov qword [rsp + 0x38], rax
lea rax, vtable.CRSimpleIPCExceptionDisconnected.0
mov qword [rsp + 0x38], rax
lea rdx, [0x1401983e0]
lea rcx, [rsp + 0x38]
call fcn.1400db6b8
int3
cmp byte [rdi + 0x78], 0
jne 0x140065e61
mov eax, dword [rsp + 0x90]
add qword [rdi + 0xc8], rax
mov bpl, 1
mov r8d, dword [0x1401d5d60]
lea ecx, [r8 + 1]
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, 1
jne 0x140065df2
mov eax, 0x51eb851f
imul r8d
sar edx, 5
mov eax, edx
shr eax, 0x1f
add edx, eax
imul edx, edx, 0x64
sub r8d, edx
add r8d, 0x141
movsxd rcx, r8d
mov eax, 4
mul rcx
mov rcx, 0xffffffffffffffff
cmovo rax, rcx
mov rcx, rax
call fcn.1400d2e28
mov rcx, rax
call fcn.1400d3f08
mov rax, qword [rsi + 8]
sub rax, qword [rsi]
cmp qword [rdi + 0xc8], rax
jne 0x140065e4e
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.1400664a0
mov rax, qword [rsi]
mov qword [rsi + 8], rax
mov qword [rdi + 0xc8], r14
cmp qword [rdi + 0x120], 0
setne bpl
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [rdi + 0xa0]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
movzx eax, bpl
jmp 0x140065e63
xor al, al
lea r11, [rsp + 0x70]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsp, r11
pop r14
pop rdi
pop rsi
ret