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

Disassembly:
mov qword [rsp + 8], rcx
mov qword [rsp + 0x10], rdx
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x20], r9
sub rsp, 0x78
mov qword [rsp + 0x48], 0
mov ecx, 0x4000
call qword [sym.imp.msvcrt.dll_malloc]
mov qword [rsp + 0x48], rax
cmp qword [rsp + 0x48], 0
je 0x404f3d
mov r8d, 0x2000
xor edx, edx
mov rcx, qword [rsp + 0x48]
call fcn.0040bdf0
jmp 0x404f42
jmp 0x4051c8
lea rax, [rsp + 0x88]
mov qword [rsp + 0x40], rax
mov r9, qword [rsp + 0x40]
mov r8, qword [rsp + 0x80]
mov edx, 0x2000
mov rcx, qword [rsp + 0x48]
call fcn.0040be50
mov qword [rsp + 0x40], 0
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.msvcrt.dll_wcslen]
mov dword [rsp + 0x50], eax
mov ecx, 0xfffffff5
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x50]
mov r8d, dword [rsp + 0x50]
mov rdx, qword [rsp + 0x48]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WriteConsoleW]
cmp dword [0x00424128], 1
jne 0x4051ac
mov qword [rsp + 0x58], 0xffffffffffffffff
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
xor r9d, r9d
mov r8d, 7
mov edx, 0x40000000
lea rcx, [0x0042437c]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsp + 0x58], rax
cmp qword [rsp + 0x58], 0xffffffffffffffff
jne 0x405062
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x60], eax
cmp dword [rsp + 0x60], 2
je 0x40501c
jmp 0x4051ac
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
mov r8d, 7
mov edx, 0x40000000
lea rcx, [0x0042437c]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rsp + 0x58], rax
cmp qword [rsp + 0x58], 0xffffffffffffffff
jne 0x405062
jmp 0x4051ac
lea rcx, [0x004240d0]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov r9d, 2
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov qword [rsp + 0x68], 0
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov r9d, 0xffffffff
mov r8, qword [rsp + 0x48]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [rsp + 0x50], eax
cmp dword [rsp + 0x50], 0
jne 0x4050d6
jmp 0x4051ac
mov eax, dword [rsp + 0x50]
mov rcx, rax
call qword [sym.imp.msvcrt.dll_malloc]
mov qword [rsp + 0x68], rax
cmp qword [rsp + 0x68], 0
je 0x405105
mov eax, dword [rsp + 0x50]
mov r8, rax
xor edx, edx
mov rcx, qword [rsp + 0x68]
call sub.msvcrt.dll_memset
jmp 0x40510a
jmp 0x4051ac
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov eax, dword [rsp + 0x50]
mov dword [rsp + 0x28], eax
mov rax, qword [rsp + 0x68]
mov qword [rsp + 0x20], rax
mov r9d, 0xffffffff
mov r8, qword [rsp + 0x48]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [rsp + 0x50], eax
mov eax, dword [rsp + 0x50]
dec eax
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x50]
mov r8d, eax
mov rdx, qword [rsp + 0x68]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_WriteFile]
cmp qword [rsp + 0x68], 0
je 0x40518a
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.msvcrt.dll_free]
mov qword [rsp + 0x68], 0
lea rcx, [0x004240d0]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
test eax, eax
jne 0x404fc5
cmp qword [rsp + 0x48], 0
je 0x4051c8
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.msvcrt.dll_free]
mov qword [rsp + 0x48], 0
add rsp, 0x78
ret