Function at 0x140005040
Capabilities:
Check if file exists
Get file attributes
Write file on windows

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
lea rbp, [rsp - 0x10]
sub rsp, 0x110
mov qword [rsp + 0x48], 0xfffffffffffffffe
mov rax, qword [0x140065ec0]
xor rax, rsp
mov qword [rbp + 8], rax
mov rsi, r9
mov r12, r8
mov r13, rdx
mov r14, rcx
mov qword [rbp - 0x58], rdx
mov qword [rbp - 0x60], r8
mov qword [rbp - 0x50], r9
lea rcx, [rbp - 0x48]
call fcn.140014680
nop
lea rcx, [rbp - 0x48]
cmp qword [rbp - 0x30], 8
cmovae rcx, qword [rbp - 0x48]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x140005134
shr eax, 4
not eax
and eax, 1
je 0x140005134
cmp qword [rbp - 0x30], 8
jb 0x1400050c7
mov rcx, qword [rbp - 0x48]
call fcn.14002747c
mov qword [rbp - 0x30], 7
xor ebx, ebx
mov qword [rbp - 0x38], rbx
mov word [rbp - 0x48], bx
cmp qword [r13 + 0x18], 8
jb 0x1400050e9
mov rcx, qword [r13]
call fcn.14002747c
mov qword [r13 + 0x18], 7
mov qword [r13 + 0x10], rbx
mov word [r13], bx
cmp qword [r12 + 0x18], 8
jb 0x14000510b
mov rcx, qword [r12]
call fcn.14002747c
mov qword [r12 + 0x18], 7
mov qword [r12 + 0x10], rbx
mov word [r12], bx
cmp qword [rsi + 0x18], 8
jb 0x14000512d
mov rcx, qword [rsi]
call fcn.14002747c
xor eax, eax
jmp 0x1400053d5
mov qword [rbp - 0x70], 7
xor ebx, ebx
mov qword [rbp - 0x78], rbx
mov word [rsp + 0x78], bx
or r9, 0xffffffffffffffff
xor r8d, r8d
mov rdx, rsi
lea rcx, [rsp + 0x78]
call fcn.140003080
lea rdx, [rsp + 0x78]
lea rcx, [rbp - 0x20]
call fcn.140014230
nop
lea rdx, [rbp - 0x20]
cmp qword [rbp - 8], 0x10
cmovae rdx, qword [rbp - 0x20]
mov qword [rsp + 0x68], 0xf
mov qword [rsp + 0x60], rbx
mov byte [rsp + 0x50], bl
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, rdx
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
lea rcx, [rsp + 0x50]
call fcn.140002a30
lea rdx, [rsp + 0x50]
mov rcx, r14
call fcn.1400014c0
mov r14, rax
mov dword [rsp + 0x40], ebx
test rax, rax
jne 0x14000524d
cmp qword [rbp - 8], 0x10
jb 0x1400051d3
mov rcx, qword [rbp - 0x20]
call fcn.14002747c
mov qword [rbp - 8], 0xf
mov qword [rbp - 0x10], rbx
mov byte [rbp - 0x20], 0
cmp qword [rbp - 0x30], 8
jb 0x1400051f3
mov rcx, qword [rbp - 0x48]
call fcn.14002747c
mov qword [rbp - 0x30], 7
mov qword [rbp - 0x38], rbx
mov word [rbp - 0x48], bx
cmp qword [r13 + 0x18], 8
jb 0x140005213
mov rcx, qword [r13]
call fcn.14002747c
mov qword [r13 + 0x18], 7
mov qword [r13 + 0x10], rbx
mov word [r13], bx
cmp qword [r12 + 0x18], 8
jb 0x140005235
mov rcx, qword [r12]
call fcn.14002747c
mov qword [r12 + 0x18], 7
mov qword [r12 + 0x10], rbx
mov word [r12], bx
jmp 0x14000511e
lea rcx, [rbp - 0x48]
cmp qword [rbp - 0x30], 8
cmovae rcx, qword [rbp - 0x48]
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x140005318
cmp qword [rbp - 8], 0x10
jb 0x14000529e
mov rcx, qword [rbp - 0x20]
call fcn.14002747c
mov qword [rbp - 8], 0xf
mov qword [rbp - 0x10], rbx
mov byte [rbp - 0x20], 0
cmp qword [rbp - 0x30], 8
jb 0x1400052be
mov rcx, qword [rbp - 0x48]
call fcn.14002747c
mov qword [rbp - 0x30], 7
mov qword [rbp - 0x38], rbx
mov word [rbp - 0x48], bx
cmp qword [r13 + 0x18], 8
jb 0x1400052de
mov rcx, qword [r13]
call fcn.14002747c
mov qword [r13 + 0x18], 7
mov qword [r13 + 0x10], rbx
mov word [r13], bx
cmp qword [r12 + 0x18], 8
jb 0x140005300
mov rcx, qword [r12]
call fcn.14002747c
mov qword [r12 + 0x18], 7
mov qword [r12 + 0x10], rbx
mov word [r12], bx
jmp 0x14000511e
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x40]
mov r8d, dword [r14]
mov rdx, qword [r14 + 8]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
cmp qword [rbp - 8], 0x10
jb 0x14000534c
mov rcx, qword [rbp - 0x20]
call fcn.14002747c
mov qword [rbp - 8], 0xf
mov qword [rbp - 0x10], rbx
mov byte [rbp - 0x20], 0
cmp qword [rbp - 0x30], 8
jb 0x14000536c
mov rcx, qword [rbp - 0x48]
call fcn.14002747c
mov qword [rbp - 0x30], 7
mov qword [rbp - 0x38], rbx
mov word [rbp - 0x48], bx
cmp qword [r13 + 0x18], 8
jb 0x14000538c
mov rcx, qword [r13]
call fcn.14002747c
mov qword [r13 + 0x18], 7
mov qword [r13 + 0x10], rbx
mov word [r13], bx
cmp qword [r12 + 0x18], 8
jb 0x1400053ae
mov rcx, qword [r12]
call fcn.14002747c
mov qword [r12 + 0x18], 7
mov qword [r12 + 0x10], rbx
mov word [r12], bx
cmp qword [rsi + 0x18], 8
jb 0x1400053d0
mov rcx, qword [rsi]
call fcn.14002747c
mov eax, 1
mov qword [rsi + 0x18], 7
mov qword [rsi + 0x10], rbx
mov word [rsi], bx
mov rcx, qword [rbp + 8]
xor rcx, rsp
call fcn.1400274a0
add rsp, 0x110
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret