Function at 0x14004e6b0
Capabilities:
Check if file exists
Delete file
Read file on windows
Write file on windows

Disassembly:
mov byte [rsp + 0x20], r9b
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x168]
sub rsp, 0x268
mov rax, qword [0x1402bf200]
xor rax, rsp
mov qword [rbp + 0x158], rax
mov r13, qword [rbp + 0x1b0]
mov r14, qword [rbp + 0x1b8]
mov qword [rbp + 0xa0], r14
mov rdi, qword [rbp + 0x1c0]
mov qword [rbp + 0xc0], rdi
xor r12d, r12d
mov dword [rsp + 0x40], r12d
xorps xmm0, xmm0
movups xmmword [r14], xmm0
mov qword [rsp + 0x30], r12
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
xor r9d, r9d
mov edx, 0x10005
lea r8d, [r12 + 7]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdx, rax
mov rcx, r14
call fcn.14004c770
mov dword [rsp + 0x40], 1
mov rax, qword [r14]
test rax, rax
je 0x14004e772
cmp qword [rax], 0xffffffffffffffff
je 0x14004e772
mov cl, 1
jmp 0x14004e774
xor cl, cl
test cl, cl
jne 0x14004ec14
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rsi, 0xffffffffffffffff
cmp eax, 2
je 0x14004e7dd
cmp eax, 3
jne 0x14004ed7c
mov qword [rbp - 0x40], rdi
mov rax, rsi
nop
inc rax
cmp word [rdi + rax*2], 0
jne 0x14004e7a0
mov qword [rbp - 0x38], rax
movaps xmm0, xmmword [rbp - 0x40]
movdqa xmmword [rbp + 0xb0], xmm0
lea rdx, [rbp + 0xb0]
lea rcx, [rbp - 0x70]
call fcn.1400579a0
nop
mov rcx, rax
call fcn.140057b20
nop
lea rcx, [rbp - 0x70]
call fcn.14002adf0
xorps xmm0, xmm0
movups xmmword [rbp - 0x30], xmm0
mov qword [rbp - 0x20], r12
mov qword [rbp - 0x18], r12
mov r8, rsi
nop
inc r8
cmp word [rdi + r8*2], 0
jne 0x14004e7f0
mov rdx, rdi
lea rcx, [rbp - 0x30]
call fcn.14002a920
nop
mov r8d, 5
lea rdx, str..tmp.
lea rcx, [rbp - 0x30]
call fcn.140023d10
xorps xmm0, xmm0
movups xmmword [rbp + 0xe0], xmm0
mov qword [rbp + 0xf0], r12
mov qword [rbp + 0xf8], r12
movups xmm0, xmmword [rax]
movups xmmword [rbp + 0xe0], xmm0
movups xmm1, xmmword [rax + 0x10]
movups xmmword [rbp + 0xf0], xmm1
mov qword [rax + 0x10], r12
mov qword [rax + 0x18], 7
mov word [rax], r12w
mov dword [rsp + 0x40], 5
lea rcx, [rbp - 0x30]
call fcn.14002adf0
call fcn.14005ffd0
mov r15, rax
mov qword [rsp + 0x60], rax
mov rbx, rax
shr rbx, 0x30
call fcn.14005ffd0
mov rdx, rax
mov qword [rsp + 0x68], rax
lea rax, str.:08x_:04x_:04x_:02x:02x_:02x:02x:02x:02x:02x:02x
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x78], 0x46
lea rax, [rbp + 0x10]
mov ecx, 0xb
nop dword [rax + rax]
mov qword [rax], r12
lea rax, [rax + 8]
sub rcx, 1
jne 0x14004e8b0
mov dword [rbp + 0x68], r15d
movabs rax, 0x2000000000000000
mov qword [rbp + 0x10], rax
movzx eax, word [rsp + 0x64]
mov dword [rbp + 0x6c], eax
movabs rax, 0x2000000000000004
mov qword [rbp + 0x18], rax
and ebx, 0xfff
bts ebx, 0xe
mov dword [rbp + 0x70], ebx
movabs rax, 0x2000000000000008
mov qword [rbp + 0x20], rax
and edx, 0x3f
bts edx, 7
mov dword [rbp + 0x74], edx
movabs rax, 0x200000000000000c
mov qword [rbp + 0x28], rax
movzx eax, byte [rsp + 0x69]
mov dword [rbp + 0x78], eax
movabs rax, 0x2000000000000010
mov qword [rbp + 0x30], rax
movzx eax, byte [rsp + 0x6a]
mov dword [rbp + 0x7c], eax
movabs rax, 0x2000000000000014
mov qword [rbp + 0x38], rax
movzx eax, byte [rsp + 0x6b]
mov dword [rbp + 0x80], eax
movabs rax, 0x2000000000000018
mov qword [rbp + 0x40], rax
movzx eax, byte [rsp + 0x6c]
mov dword [rbp + 0x84], eax
movabs rax, 0x200000000000001c
mov qword [rbp + 0x48], rax
movzx eax, byte [rsp + 0x6d]
mov dword [rbp + 0x88], eax
movabs rax, 0x2000000000000020
mov qword [rbp + 0x50], rax
movzx eax, byte [rsp + 0x6e]
mov dword [rbp + 0x8c], eax
movabs rax, 0x2000000000000024
mov qword [rbp + 0x58], rax
movzx eax, byte [rsp + 0x6f]
mov dword [rbp + 0x90], eax
movabs rax, 0x2000000000000028
mov qword [rbp + 0x60], rax
mov qword [rsp + 0x50], 0xb
lea rax, [rbp + 0x10]
mov qword [rsp + 0x58], rax
movaps xmm0, xmmword [rsp + 0x50]
movdqa xmmword [rbp - 0x50], xmm0
movaps xmm1, xmmword [rsp + 0x70]
movdqa xmmword [rbp - 0x80], xmm1
lea r8, [rbp - 0x50]
lea rdx, [rbp - 0x80]
lea rcx, [rbp - 0x10]
call fcn.1400150d0
mov dword [rsp + 0x40], 0x3d
lea rdx, [rbp - 0x10]
cmp qword [rbp + 8], 7
cmova rdx, qword [rbp - 0x10]
mov r8, qword [rbp]
lea rcx, [rbp + 0xe0]
call fcn.140023d10
nop
lea rcx, [rbp - 0x10]
call fcn.14002adf0
lea rcx, [rbp + 0xe0]
cmp qword [rbp + 0xf8], 7
cmova rcx, qword [rbp + 0xe0]
mov qword [rsp + 0x30], r12
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 1
xor r9d, r9d
mov edx, 0x10005
lea r8d, [r9 + 7]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
mov ecx, 0x18
call fcn.14019af70
mov rcx, rax
mov qword [rsp + 0x70], rax
xorps xmm0, xmm0
movups xmmword [rax], xmm0
mov dword [rax + 8], 1
mov dword [rax + 0xc], 1
lea rax, vtable.std::_Ref_count_obj2_class_asw::wrappers::basic_handle_void____ptr64__struct_asw::wrappers::detail::traits_file_handle__.0
mov qword [rcx], rax
lea rax, [rcx + 0x10]
mov qword [rax], rbx
mov dword [rsp + 0x40], 0x3f
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x78], rcx
lea rdx, [rsp + 0x70]
mov rcx, r14
call fcn.140050e50
mov rcx, qword [rsp + 0x78]
test rcx, rcx
je 0x14004eb0e
mov eax, esi
lock xadd dword [rcx + 8], eax
cmp eax, 1
jne 0x14004eb07
mov rbx, qword [rsp + 0x78]
mov rax, qword [rbx]
mov rcx, rbx
mov rax, qword [rax]
call qword [case.0x1400617cf.0]
mov eax, esi
lock xadd dword [rbx + 0xc], eax
cmp eax, 1
jne 0x14004eb07
mov rcx, qword [rsp + 0x78]
mov rax, qword [rcx]
mov rax, qword [rax + 8]
call qword [case.0x1400617cf.0]
mov rdi, qword [rbp + 0xc0]
mov rax, qword [r14]
test rax, rax
je 0x14004eb20
cmp qword [rax], 0xffffffffffffffff
je 0x14004eb20
mov cl, 1
jmp 0x14004eb22
xor cl, cl
test cl, cl
je 0x14004edd0
mov word [rbp + 0xcc], 0xbbef
mov byte [rbp + 0xce], 0xbf
mov dword [rbp + 0xd4], r12d
test rax, rax
je 0x14004eb4b
mov rcx, qword [rax]
jmp 0x14004eb4e
mov rcx, rsi
mov qword [rsp + 0x20], r12
lea r9, [rbp + 0xd4]
mov r8d, 3
lea rdx, [rbp + 0xcc]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x14004ee1c
mov qword [rsp + 0x50], rdi
mov rax, rsi
nop dword [rax]
inc rax
cmp word [rdi + rax*2], 0
jne 0x14004eb80
mov qword [rsp + 0x58], rax
mov rcx, qword [r14]
test rcx, rcx
je 0x14004eb9c
mov rcx, qword [rcx]
jmp 0x14004eb9f
mov rcx, rsi
movaps xmm0, xmmword [rsp + 0x50]
movdqa xmmword [rbp - 0x80], xmm0
lea rdx, [rbp - 0x80]
call fcn.140057cd0
test al, al
jne 0x14004ebd4
lea rcx, [rbp + 0xe0]
cmp qword [rbp + 0xf8], 7
cmova rcx, qword [rbp + 0xe0]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
nop
lea rcx, [rbp + 0xe0]
call fcn.14002adf0
xor eax, eax
mov word [rbp + 0xc8], ax
mov byte [rbp + 0xca], al
mov dword [rbp + 0xd8], r12d
xorps xmm0, xmm0
movups xmmword [rbp + 0x100], xmm0
movups xmmword [rbp + 0x110], xmm0
mov rcx, qword [r14]
test rcx, rcx
je 0x14004ec4c
mov rcx, qword [rcx]
jmp 0x14004ec4f
mov rsi, 0xffffffffffffffff
test rax, rax
je 0x14004ec25
mov rcx, qword [rax]
jmp 0x14004ec28
mov rcx, rsi
lea rdx, [rbp + 0x120]
call qword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
test eax, eax
je 0x14004ee3e
cmp dword [rbp + 0x148], 1
jne 0x14004ed5d
jmp 0x14004ebe0
mov rcx, rsi
lea rax, [rbp + 0x100]
mov qword [rsp + 0x20], rax
lea r9, [rbp + 0xd8]
mov r8d, 3
lea rdx, [rbp + 0xc8]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x14004ec88
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x26
jne 0x14004ee60
mov word [rbp + 0xd0], 0xbbef
movzx eax, word [rbp + 0xc8]
cmp ax, word [rbp + 0xd0]
jne 0x14004ecaa
cmp byte [rbp + 0xca], 0xbf
je 0x14004ecf3
cmp byte [rbp + 0x1c8], 0
jne 0x14004ed19
mov rax, qword [r14]
test rax, rax
je 0x14004ecbe
mov rsi, qword [rax]
lea rdx, [r13 + 0xb8]
mov rcx, rsi
call fcn.14004de00
mov r9b, 1
mov r8, rdi
lea rdx, [rbp - 0x50]
mov rcx, r13
call fcn.14004e6b0
mov rdx, rax
mov rcx, r14
call fcn.140050e50
lea rcx, [rbp - 0x50]
call fcn.1400060d0
mov rax, r14
mov rcx, qword [rbp + 0x158]
xor rcx, rsp
call fcn.14019acb0
add rsp, 0x268
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret
lea rax, str.BOM_not_present_in_
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x58], 0x17
movaps xmm0, xmmword [rsp + 0x50]
movdqa xmmword [rbp - 0x80], xmm0
lea r8, [rbp + 0xc0]
lea rdx, [rbp - 0x80]
lea rcx, [rbp - 0x70]
call fcn.140051110
lea rdx, [0x1402b9f88]
lea rcx, [rbp - 0x70]
call fcn.14019cd80
int3
mov edx, 0x649
lea rcx, [rbp - 0x70]
call fcn.14004bd90
lea rdx, [0x1402b9f88]
lea rcx, [rbp - 0x70]
call fcn.14019cd80
int3
lea rax, str.Failed_to_open_log_file_
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x68], 0x1c
call qword [sym.imp.KERNEL32.dll_GetLastError]
movaps xmm0, xmmword [rsp + 0x60]
movdqa xmmword [rsp + 0x50], xmm0
lea r9, [rbp + 0xc0]
lea r8, [rsp + 0x50]
mov edx, eax
lea rcx, [rbp + 0x120]
call fcn.140051040
lea rdx, [0x1402b9f88]
lea rcx, [rbp + 0x120]
call fcn.14019cd80
nop
lea rax, str.Failed_to_create_new_log_file_
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x58], 0x22
call qword [sym.imp.KERNEL32.dll_GetLastError]
movaps xmm0, xmmword [rsp + 0x50]
movdqa xmmword [rbp - 0x80], xmm0
lea r9, [rbp + 0xe0]
lea r8, [rbp - 0x80]
mov edx, eax
lea rcx, [rbp - 0x70]
call fcn.140031570
lea rdx, [0x1402b9f88]
lea rcx, [rbp - 0x70]
call fcn.14019cd80
int3
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp - 0x70]
call fcn.14004bd90
lea rdx, [0x1402b9f88]
lea rcx, [rbp - 0x70]
call fcn.14019cd80
nop
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp - 0x70]
call fcn.14004bd90
lea rdx, [0x1402b9f88]
lea rcx, [rbp - 0x70]
call fcn.14019cd80
int3
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [rbp - 0x70]
call fcn.14004bd90
lea rdx, [0x1402b9f88]
lea rcx, [rbp - 0x70]
call fcn.14019cd80
int3