Function at 0x140023ac5
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x868
lea rax, [0x140094476]
mov qword [rsp + 0x48], rax
test rdx, rdx
mov rbx, rdx
mov rdi, rcx
lea rax, str.w__ccsUTF_8
mov dword [rsp + 0x8c8], r9d
mov r15, r8
mov qword [rsp + 0x50], rax
lea rax, str.w__ccsUTF_16LE
mov qword [rsp + 0x58], rax
sete al
test r8, r8
sete dl
xor esi, esi
mov word [rsp + 0x44], 0
or al, dl
jne 0x140023e75
test rcx, rcx
je 0x140023e75
cmp byte [rcx], 0
je 0x140023e75
cmp byte [rbx], 0
je 0x140023e75
cmp byte [r8], 0
je 0x140023e75
call fcn.140022712
mov rdx, rdi
mov qword [rsp + 0x20], rax
test rax, rax
je 0x140023b74
mov rcx, rbx
call fcn.140022712
mov r13, rax
test rax, rax
jne 0x140023b8b
mov rdx, rbx
lea rcx, str.Could_not_convert__s_to_UTF_16
xor r14d, r14d
xor r13d, r13d
call fcn.1400380b9
jmp 0x140023e69
mov rcx, r15
call fcn.140022712
mov rdx, r15
lea rcx, str.Could_not_convert__s_to_UTF_16
mov r14, rax
test rax, rax
je 0x140023bce
mov rcx, qword [rsp + 0x20]
mov rsi, qword [sym.imp.msvcrt.dll__wfopen]
lea rdx, str.r__ccsUNICODE
call rsi
mov qword [rsp + 0x28], rax
test rax, rax
jne 0x140023bd8
mov rdx, rdi
lea rcx, str.Could_not_open_file__s_n
call fcn.1400380b9
jmp 0x140023e69
mov r9, qword [rsp + 0x28]
lea rcx, [rsp + 0x44]
mov r8d, 1
mov edx, 2
call sub.msvcrt.dll_fread
dec rax
je 0x140023c10
mov rdx, rdi
lea rcx, str.Could_not_read_file__s_n
xor r12d, r12d
xor ebx, ebx
call fcn.1400380b9
jmp 0x140023d3f
mov eax, dword [rsp + 0x44]
mov r12d, 1
cmp ax, 0xbbef
je 0x140023c2e
xor r12d, r12d
cmp ax, 0xfeff
sete r12b
add r12d, r12d
mov rcx, qword [rsp + 0x28]
xor r8d, r8d
xor edx, edx
call sub.msvcrt.dll_fseek
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_wcslen
mov edx, 2
lea rcx, [rax + 2]
call sub.msvcrt.dll_calloc
mov rbx, rax
test rax, rax
jne 0x140023c6e
lea rcx, str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.1400380b9
jmp 0x140023d3f
mov rdx, qword [rsp + 0x20]
mov rcx, rax
call sub.msvcrt.dll_wcscpy
mov rcx, rbx
call sub.msvcrt.dll_wcslen
mov rcx, rbx
mov word [rbx + rax*2], 0x7e
movsxd rax, r12d
mov rdx, qword [rsp + rax*8 + 0x48]
call rsi
xor esi, esi
mov rbp, rax
test rax, rax
jne 0x140023d00
mov rdx, rdi
lea rcx, str.Could_not_open_temporary_output_file__s_n
call fcn.1400380b9
jmp 0x140023d3f
mov rcx, qword [rsp + 0x30]
lea rdx, [0x1400949e8]
call sub.msvcrt.dll_wcsspn
mov rcx, r13
mov qword [rsp + 0x38], rax
call sub.msvcrt.dll_wcslen
mov rdx, qword [rsp + 0x38]
mov r8, rax
mov rax, qword [rsp + 0x30]
add rdx, rdx
lea rcx, [rax + rdx]
mov rdx, r13
call qword [sym.imp.msvcrt.dll__wcsnicmp]
mov rcx, qword [rsp + 0x30]
mov rdx, rbp
test eax, eax
je 0x140023d23
call sub.msvcrt.dll_fputws
lea rax, [rsp + 0x60]
mov r8, qword [rsp + 0x28]
mov edx, 0x400
mov rcx, rax
mov qword [rsp + 0x30], rax
call sub.msvcrt.dll_fgetws
test rax, rax
jne 0x140023cb4
jmp 0x140023d43
call sub.msvcrt.dll_fputws
mov r8, r14
mov rcx, rbp
mov rsi, r15
lea rdx, [0x14009452e]
call sub.msvcrt.dll_fwprintf_s
jmp 0x140023d00
xor esi, esi
xor ebp, ebp
mov rcx, qword [rsp + 0x28]
call sub.msvcrt.dll_fclose
test rbp, rbp
je 0x140023d5a
mov rcx, rbp
call sub.msvcrt.dll_fclose
test rsi, rsi
je 0x140023e37
test rbx, rbx
je 0x140023e45
cmp qword [rsp + 0x20], 0
je 0x140023e3c
mov rbp, qword [sym.imp.msvcrt.dll__wfopen]
lea rdx, [0x140093f8e]
mov rcx, rbx
call rbp
mov rcx, qword [rsp + 0x20]
lea rdx, [0x140094548]
mov r15, rax
call rbp
mov rbp, rax
test r15, r15
je 0x140023e0d
test rax, rax
je 0x140023e0d
xor edi, edi
cmp r12d, 2
lea r12, [rsp + 0x46]
sete dil
inc rdi
mov r9, r15
mov r8d, 1
mov rdx, rdi
mov rcx, r12
call sub.msvcrt.dll_fread
dec rax
jne 0x140023dfb
cmp dword [rsp + 0x8c8], 0
je 0x140023de5
cmp byte [rsp + 0x46], 0xd
je 0x140023dbb
mov r9, rbp
mov r8d, 1
mov rdx, rdi
mov rcx, r12
call sub.msvcrt.dll_fwrite
jmp 0x140023dbb
mov rcx, r15
call sub.msvcrt.dll_fclose
mov rcx, rbp
call sub.msvcrt.dll_fclose
jmp 0x140023e3c
lea rcx, str.Could_not_write__s___original_file_has_been_left_unmodified_n
mov rdx, rdi
call fcn.1400380b9
mov rcx, r15
test r15, r15
jne 0x140023e30
mov rcx, rbp
test rbp, rbp
jne 0x140023e30
xor esi, esi
jmp 0x140023e3c
call sub.msvcrt.dll_fclose
jmp 0x140023e2c
test rbx, rbx
je 0x140023e45
mov rcx, rbx
call qword [sym.imp.msvcrt.dll__wunlink]
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_free
mov rcx, rbx
call sub.msvcrt.dll_free
mov rcx, r13
call sub.msvcrt.dll_free
mov rcx, r14
call sub.msvcrt.dll_free
jmp 0x140023e75
xor esi, esi
xor r12d, r12d
xor ebx, ebx
jmp 0x140023d5a
mov rax, rsi
add rsp, 0x868
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret