Function at 0x140046250
Capabilities:
Check if file exists
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x68
mov rdi, rdx
mov rsi, rcx
mov rax, qword [0x14033f038]
xor rax, rsp
mov qword [rsp + 0x60], rax
movabs rax, 0xaaaaaaaaaaaaaaaa
mov qword [rsp + 0x50], rax
movaps xmm0, xmmword [0x140301d60]
movaps xmmword [rsp + 0x40], xmm0
mov rax, qword [rdx]
mov rax, qword [rax + 0x38]
lea rdx, [rsp + 0x40]
mov rcx, rdi
call qword [case.0x140211850.0]
mov r15, qword [rsp + 0x40]
mov r12, qword [rsp + 0x48]
cmp r15, r12
jne 0x14004632a
lea r14, [rsi + 0xe0]
mov ebx, dword [rdi + 8]
mov rax, qword [rdi]
mov rax, qword [rax + 0x10]
mov rcx, rdi
call qword [case.0x140211850.0]
mov rcx, qword [rsi + 0x78]
mov qword [rsp + 0x20], r14
mov rdx, rax
mov r8d, ebx
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x140046439
mov byte [rsi + 0x12a], 1
lock inc dword [rsi + 8]
mov sil, 1
mov r15, qword [rsp + 0x40]
test r15, r15
jne 0x1400463d3
mov rcx, qword [rsp + 0x60]
xor rcx, rsp
call fcn.140171860
mov eax, esi
add rsp, 0x68
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov rbp, qword [sym.imp.KERNEL32.dll_GetLastError]
mov r13, qword [sym.imp.KERNEL32.dll_SetLastError]
mov qword [r15], 0xffffffffffffffff
mov dword [r15 + 8], 0
mov rax, qword [r15 + 0x10]
mov qword [r15 + 0x10], 0
inc rax
cmp rax, 2
jae 0x140046491
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
test rax, rax
je 0x14004650c
cmp qword [r15 + 0x18], 0
je 0x1400463bc
call rbp
mov ebx, eax
mov rax, qword [r15 + 0x18]
inc rax
cmp rax, 2
jb 0x1400463b7
call fcn.1400412c0
mov r14, qword [r15 + 0x18]
mov rcx, qword [0x14035abe0]
test rcx, rcx
je 0x14004649b
mov rax, qword [rcx]
mov rax, qword [rax]
mov rdx, r14
call qword [case.0x140211850.0]
mov qword [r15 + 0x18], 0
mov ecx, ebx
call r13
mov byte [r15 + 0x20], 0
add r15, 0x28
cmp r15, r12
je 0x1400462b4
jmp 0x140046338
mov rdi, qword [rsp + 0x48]
mov rcx, r15
cmp rdi, r15
je 0x14004642a
add rdi, 0xfffffffffffffff0
mov rax, qword [rdi]
lea rcx, [rax + 1]
cmp rcx, 1
ja 0x140046451
cmp byte [rdi + 8], 0
jne 0x140046451
inc rax
cmp rax, 2
jae 0x1400464ac
mov rax, qword [rdi - 8]
inc rax
cmp rax, 2
jae 0x1400464db
lea rax, [rdi - 0x28]
add rdi, 0xffffffffffffffe8
cmp rdi, r15
mov rdi, rax
jne 0x1400463e4
mov rcx, qword [rsp + 0x40]
mov qword [rsp + 0x48], r15
call fcn.14016eccc
jmp 0x14004630a
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x1400462ee
xor esi, esi
jmp 0x1400462fc
mov rbx, qword [rdi - 0x18]
lea r14, [rsp + 0x58]
mov qword [r14], rbx
mov rcx, rdi
call fcn.140069b90
xor ecx, ecx
mov dword [rsp + 0x28], ecx
mov dword [rsp + 0x20], ecx
mov dword [rsp + 0x30], 1
mov rcx, rax
mov rdx, rbx
xor r8d, r8d
mov r9, r14
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
mov rax, qword [rdi]
jmp 0x1400463f7
call fcn.1400412c0
jmp 0x140046360
call fcn.1400bf420
mov rcx, qword [0x14035abe0]
jmp 0x1400463a0
call fcn.1400412c0
mov rbx, qword [rdi]
mov rcx, qword [0x14035abe0]
test rcx, rcx
je 0x14004650f
mov rax, qword [rcx]
mov rax, qword [rax]
mov rdx, rbx
call qword [case.0x140211850.0]
mov qword [rdi], 0
jmp 0x140046404
call fcn.1400412c0
mov rbx, qword [rdi - 8]
mov rcx, qword [0x14035abe0]
test rcx, rcx
je 0x14004651d
mov rax, qword [rcx]
mov rax, qword [rax]
mov rdx, rbx
call qword [case.0x140211850.0]
mov qword [rdi - 8], 0
jmp 0x140046415
int3
call fcn.1400bf420
mov rcx, qword [0x14035abe0]
jmp 0x1400464c0
call fcn.1400bf420
mov rcx, qword [0x14035abe0]
jmp 0x1400464f0