Function at 0x140050260
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0xe48]
sub rsp, 0xf20
mov qword [rsp + 0x70], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x1401a0e90]
xor rax, rsp
mov qword [rbp + 0xe10], rax
mov rdi, rcx
xor r15d, r15d
cmp byte [rcx + 0x78], r15b
je 0x1400502b9
call fcn.1400506ac
test al, al
je 0x140050678
lea r14, [rdi + 0xb0]
mov rax, qword [r14 + 8]
or r12, 0xffffffffffffffff
lea esi, [r12 + 2]
cmp qword [r14], rax
jne 0x140050455
mov r8d, dword [0x1401a8d80]
mov ecx, r8d
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, 3
jne 0x14005033e
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
lea eax, [rsi + 3]
mul rcx
cmovo rax, r12
mov rcx, rax
call fcn.1400bc638
mov rcx, rax
call fcn.1400be0fc
lea rax, [rdi + 0xd0]
mov qword [rsp + 0x38], rax
lea r12, [rax + 8]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
cmp qword [rdi + 0x120], r15
jne 0x14005036f
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x140050678
lea rcx, [rdi + 0x100]
lea rdx, [rsp + 0x58]
call fcn.14002d7f0
mov rdx, rax
mov rcx, qword [rax]
test rcx, rcx
mov rax, r15
je 0x140050391
mov rax, qword [rcx]
mov rcx, qword [rax + 0x10]
sub rcx, rsi
and rcx, qword [rdx + 0x10]
mov rax, qword [rax + 8]
mov rdx, qword [rax + rcx*8]
add rdx, 8
mov rcx, r14
call fcn.140029f08
mov qword [rdi + 0xc8], r15
mov r9d, dword [0x1401a8d80]
lea ecx, [r9 + 1]
imul ecx, r9d
mov eax, 0x2e8ba2e9
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add edx, eax
imul edx, edx, 0x16
sub ecx, edx
cmp ecx, 0x11
jne 0x140050448
lea r13, [rbp - 0x80]
xor r10d, r10d
lea ebx, [r10 + 1]
lea ecx, [r15 + 1]
mov eax, r9d
cdq
idiv ecx
mov r8d, edx
mov ecx, r9d
sub ecx, r15d
imul r8d, ecx
mov eax, r9d
cdq
idiv ebx
add r8d, eax
sub r8d, r10d
mov edx, r8d
lea rcx, [0x140136e98]
call fcn.1400bd8cc
mov r10d, ebx
add r13, 4
cmp ebx, 4
jge 0x140050433
mov r9d, dword [0x1401a8d80]
jmp 0x1400503e8
add r15d, esi
cmp r15d, 0x16
jge 0x140050445
mov r9d, dword [0x1401a8d80]
jmp 0x1400503e5
xor r15d, r15d
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
or r12, 0xffffffffffffffff
mov dword [rsp + 0x30], r15d
mov rdx, qword [r14]
mov r8, qword [r14 + 8]
sub r8, rdx
lea rcx, [rdi + 0x80]
add rdx, qword [rdi + 0xc8]
mov qword [rsp + 0x20], rcx
lea r9, [rsp + 0x30]
mov rcx, qword [rdi + 0xa8]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x140050518
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x6d
je 0x1400504e3
cmp eax, 0x3e5
je 0x1400504dd
lea rax, str.Channel_write_failure
mov qword [rsp + 0x38], rax
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0x58]
call fcn.1400c0448
nop
lea rax, vtable.CRSimpleIPCException.0
mov qword [rsp + 0x58], rax
lea rdx, [0x14016be58]
lea rcx, [rsp + 0x58]
call fcn.1400c4e98
int3
mov byte [rdi + 0x78], sil
jmp 0x140050518
lea rcx, [rsp + 0x40]
call fcn.1400c04c0
nop
lea rax, vtable.CRSimpleIPCException.0
mov qword [rsp + 0x40], rax
lea rax, vtable.CRSimpleIPCExceptionDisconnected.0
add byte [rax - 0x77], cl
and al, 0x40
lea rdx, [0x14016be10]
lea rcx, [rsp + 0x40]
call fcn.1400c4e98
int3
cmp byte [rdi + 0x78], r15b
jne 0x140050678
mov eax, dword [rsp + 0x30]
add qword [rdi + 0xc8], rax
mov eax, dword [0x1401a8d80]
mov ecx, eax
imul ecx, eax
imul ecx, eax
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, 7
jne 0x1400505d1
mov word [rbp + 0xe0], r15w
xor edx, edx
mov r8d, 0xd20
lea rcx, [rbp + 0xe2]
call fcn.1400c2400
mov r10, r15
mov r9, r12
mov r8, r15
test r10, r10
je 0x1400505ab
test r8, r8
je 0x1400505ab
lea rcx, [r8 + r9]
lea rax, [r8 + r9]
movzx edx, word [rbp + rcx*2 + 0x90]
add dx, word [rbp + rax*2 + 0xe0]
add dx, si
lea rax, [r8 + r9]
mov word [rbp + rax*2 + 0xe2], dx
add r8, rsi
cmp r8, 0x29
jl 0x14005057a
add r10, rsi
add r9, 0x29
cmp r9, 0x690
jl 0x140050577
movsx eax, word [rbp + 0xe00]
mov dword [0x1401a8d80], eax
mov rax, qword [r14 + 8]
sub rax, qword [r14]
cmp qword [rdi + 0xc8], rax
jne 0x140050666
lea rax, [rdi + 0xd0]
mov qword [rsp + 0x38], rax
lea rbx, [rax + 8]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
cmp qword [rdi + 0x120], r15
je 0x140050644
mov rcx, qword [rdi + 0x110]
sub rcx, rsi
and rcx, qword [rdi + 0x118]
mov rax, qword [rdi + 0x108]
mov rcx, qword [rax + rcx*8]
mov rax, qword [rcx]
xor edx, edx
call qword [rax]
add qword [rdi + 0x120], r12
jne 0x14005063d
mov qword [rdi + 0x118], r15
jmp 0x140050644
add qword [rdi + 0x118], rsi
mov rax, qword [r14]
mov qword [r14 + 8], rax
mov qword [rdi + 0xc8], r15
cmp qword [rdi + 0x120], r15
setne sil
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [rdi + 0xa0]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov al, sil
jmp 0x14005067a
xor al, al
mov rcx, qword [rbp + 0xe10]
xor rcx, rsp
call fcn.1400bcfc0
lea r11, [rsp + 0xf20]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret