Function at 0x180002794
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
push rbp
push rdi
push r14
mov rbp, rsp
sub rsp, 0x70
mov qword [rbp - 0x40], 0xfffffffffffffffe
mov qword [rax + 0x18], rbx
mov qword [rax + 0x20], rsi
mov rbx, rcx
cmp byte [rcx + 0x78], 0
je 0x1800027c8
call fcn.180002a3c
test al, al
je 0x180002a25
lea rsi, [rbx + 0xb0]
mov rax, qword [rsi + 8]
mov edi, 1
cmp qword [rsi], rax
jne 0x1800028b3
lea rax, [rbx + 0xd0]
mov qword [rbp + 0x28], rax
lea r14, [rax + 8]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
cmp qword [rbx + 0x120], 0
jne 0x180002812
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x180002a25
lea rcx, [rbx + 0x100]
lea rdx, [rbp - 0x20]
call fcn.1800037d0
mov rdx, rax
mov rcx, qword [rax]
test rcx, rcx
jne 0x180002831
xor eax, eax
jmp 0x180002834
mov rax, qword [rcx]
mov rcx, qword [rax + 0x10]
sub rcx, rdi
and rcx, qword [rdx + 0x10]
mov rax, qword [rax + 8]
mov rdx, qword [rax + rcx*8]
add rdx, 8
mov rcx, rsi
call fcn.1800032c8
mov r8d, dword [0x18002ede8]
lea ecx, [r8 + 2]
lea eax, [r8 + 1]
imul ecx, eax
imul ecx, r8d
mov eax, 0x2aaaaaab
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*2]
shl eax, 3
sub ecx, eax
cmp ecx, edi
jne 0x1800028a2
mov ecx, edi
cmp r8d, edi
jle 0x18000289c
mov eax, r8d
cdq
idiv ecx
inc ecx
add ecx, edx
cmp ecx, r8d
jl 0x18000288d
mov dword [0x18002ede8], ecx
and qword [rbx + 0xc8], 0
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
and dword [rbp + 0x20], 0
mov rdx, qword [rsi]
mov r8, qword [rsi + 8]
sub r8, rdx
lea rcx, [rbx + 0x80]
add rdx, qword [rbx + 0xc8]
mov qword [rsp + 0x20], rcx
lea r9, [rbp + 0x20]
mov rcx, qword [rbx + 0xa8]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x180002967
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x6d
je 0x180002936
cmp eax, 0x3e5
je 0x180002930
lea rax, str.Channel_write_failure
mov qword [rbp + 0x28], rax
lea rdx, [rbp + 0x28]
lea rcx, [rbp - 0x20]
call fcn.18000bd58
nop
lea rax, [0x1800249d8]
mov qword [rbp - 0x20], rax
lea rdx, [0x18002b2f0]
lea rcx, [rbp - 0x20]
call fcn.18000c558
int3
mov byte [rbx + 0x78], dil
jmp 0x180002967
lea rcx, [rbp - 0x38]
call fcn.18000bdd0
nop
lea rax, [0x1800249d8]
mov qword [rbp - 0x38], rax
lea rax, [0x1800249f8]
mov qword [rbp - 0x38], rax
lea rdx, [0x18002b2a8]
lea rcx, [rbp - 0x38]
call fcn.18000c558
int3
cmp byte [rbx + 0x78], 0
jne 0x180002a25
mov eax, dword [rbp + 0x20]
add qword [rbx + 0xc8], rax
mov rax, qword [rsi + 8]
sub rax, qword [rsi]
cmp qword [rbx + 0xc8], rax
jne 0x180002a13
lea rax, [rbx + 0xd0]
mov qword [rbp + 0x28], rax
lea r14, [rax + 8]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
cmp qword [rbx + 0x120], 0
je 0x1800029ef
mov rcx, qword [rbx + 0x110]
sub rcx, rdi
and rcx, qword [rbx + 0x118]
mov rax, qword [rbx + 0x108]
mov rcx, qword [rax + rcx*8]
mov rax, qword [rcx]
xor edx, edx
call qword [rax]
dec qword [rbx + 0x120]
jne 0x1800029e8
and qword [rbx + 0x118], 0
jmp 0x1800029ef
add qword [rbx + 0x118], rdi
mov rax, qword [rsi]
mov qword [rsi + 8], rax
and qword [rbx + 0xc8], 0
cmp qword [rbx + 0x120], 0
setne dil
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [rbx + 0xa0]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov al, dil
jmp 0x180002a27
xor al, al
lea r11, [rsp + 0x70]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret