Function at 0x1400232db
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 rcx, rcx
mov r14, rdx
mov rbx, rcx
lea rax, str.w__ccsUTF_8
mov word [rsp + 0x44], 0
mov r12, r8
mov qword [rsp + 0x50], rax
lea rax, str.w__ccsUTF_16LE
mov qword [rsp + 0x58], rax
sete al
test rdx, rdx
sete dl
xor ebp, ebp
or al, dl
jne 0x1400236cd
test r8, r8
je 0x1400236cd
cmp byte [r8], 0
je 0x1400236cd
cmp byte [rcx], 0
je 0x1400236cd
cmp byte [r14], 0
je 0x1400236cd
mov rcx, r8
call fcn.140022712
mov rdx, r12
mov qword [rsp + 0x28], rax
test rax, rax
je 0x140023388
mov rcx, rbx
call fcn.140022712
mov qword [rsp + 0x20], rax
test rax, rax
jne 0x1400233a5
mov rdx, rbx
lea rcx, str.Could_not_convert__s_to_UTF_16
call fcn.1400380b9
xor eax, eax
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x20], rax
jmp 0x1400236c9
mov rcx, r14
call fcn.140022712
mov rdx, r14
lea rcx, str.Could_not_convert__s_to_UTF_16
mov qword [rsp + 0x30], rax
test rax, rax
je 0x1400233ea
mov rcx, qword [rsp + 0x28]
mov rbx, qword [sym.imp.msvcrt.dll__wfopen]
lea rdx, str.r__ccsUNICODE
call rbx
mov qword [rsp + 0x38], rax
test rax, rax
jne 0x1400233f4
mov rdx, r12
lea rcx, str.Could_not_open_file__s_n
call fcn.1400380b9
jmp 0x1400236c9
mov r9, qword [rsp + 0x38]
lea rcx, [rsp + 0x44]
mov edx, 2
xor r15d, r15d
mov r8d, 1
call sub.msvcrt.dll_fread
dec rax
jne 0x140023443
mov eax, dword [rsp + 0x44]
mov r15d, 1
cmp ax, 0xbbef
je 0x140023434
xor r15d, r15d
cmp ax, 0xfeff
sete r15b
add r15d, r15d
mov rcx, qword [rsp + 0x38]
xor r8d, r8d
xor edx, edx
call sub.msvcrt.dll_fseek
mov rcx, qword [rsp + 0x28]
call sub.msvcrt.dll_wcslen
mov edx, 2
lea rcx, [rax + 2]
call sub.msvcrt.dll_calloc
mov rsi, rax
test rax, rax
jne 0x140023471
lea rcx, str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.1400380b9
jmp 0x1400234b2
mov rdx, qword [rsp + 0x28]
mov rcx, rax
xor ebp, ebp
call sub.msvcrt.dll_wcscpy
mov rcx, rsi
call sub.msvcrt.dll_wcslen
mov rcx, rsi
mov word [rsi + rax*2], 0x7e
movsxd rax, r15d
mov rdx, qword [rsp + rax*8 + 0x48]
call rbx
mov rdi, rax
test rax, rax
jne 0x1400234e6
mov rdx, r12
lea rcx, str.Could_not_open_temporary_output_file__s_n
call fcn.1400380b9
xor ebp, ebp
xor edi, edi
jmp 0x1400235bd
lea rdx, [0x1400949e8]
mov rcx, r13
call sub.msvcrt.dll_wcsspn
mov rbx, rax
mov ax, word [rsp + rax*2 + 0x60]
sub eax, 0x3b
test ax, 0xffdf
jne 0x140023507
mov rdx, rdi
mov rcx, r13
call sub.msvcrt.dll_fputws
lea r13, [rsp + 0x60]
mov r8, qword [rsp + 0x38]
mov edx, 0x400
mov rcx, r13
call sub.msvcrt.dll_fgetws
test rax, rax
jne 0x1400234bb
jmp 0x14002359c
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_wcslen
lea rcx, [rbx + rbx]
mov rdx, qword [rsp + 0x20]
add rcx, r13
mov r8, rax
call qword [sym.imp.msvcrt.dll__wcsnicmp]
test eax, eax
jne 0x1400234db
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_wcslen
lea rdx, [0x1400949e8]
add rbx, rax
lea rcx, [rbx + rbx]
add rcx, r13
call sub.msvcrt.dll_wcsspn
add rbx, rax
cmp word [rsp + rbx*2 + 0x60], 0x3d
jne 0x1400234db
inc rbx
lea rdx, [0x1400949e8]
mov rbp, r14
lea rcx, [rbx + rbx]
add rcx, r13
call sub.msvcrt.dll_wcsspn
mov rdx, rdi
mov rcx, r13
add rbx, rax
mov word [rsp + rbx*2 + 0x60], 0
call sub.msvcrt.dll_fputws
mov r8, qword [rsp + 0x30]
lea rdx, [0x14009452e]
mov rcx, rdi
call sub.msvcrt.dll_fwprintf_s
jmp 0x1400234e6
test rbp, rbp
jne 0x1400235bd
mov r9, qword [rsp + 0x30]
mov r8, qword [rsp + 0x20]
mov rcx, rdi
mov rbp, r14
lea rdx, str._s___s_n
call sub.msvcrt.dll_fwprintf_s
mov rcx, qword [rsp + 0x38]
call sub.msvcrt.dll_fclose
test rdi, rdi
je 0x1400235d4
mov rcx, rdi
call sub.msvcrt.dll_fclose
test rbp, rbp
je 0x140023685
xor ebx, ebx
test rsi, rsi
mov rdi, qword [sym.imp.msvcrt.dll__wfopen]
je 0x1400235fa
lea rdx, [0x140093f8e]
mov rcx, rsi
call rdi
mov rbx, rax
mov rcx, qword [rsp + 0x28]
lea rdx, [0x140094548]
call rdi
mov rdi, rax
test rbx, rbx
je 0x140023669
test rax, rax
je 0x140023669
xor r12d, r12d
cmp r15d, 2
lea r13, [rsp + 0x46]
sete r12b
inc r12
mov r9, rbx
mov r8d, 1
mov rdx, r12
mov rcx, r13
call sub.msvcrt.dll_fread
dec rax
jne 0x140023657
mov r9, rdi
mov r8d, 1
mov rdx, r12
mov rcx, r13
call sub.msvcrt.dll_fwrite
jmp 0x140023628
mov rcx, rbx
call sub.msvcrt.dll_fclose
mov rcx, rdi
call sub.msvcrt.dll_fclose
jmp 0x140023693
mov rdx, r12
lea rcx, str.Could_not_write__s___original_file_has_been_left_unmodified_n
call fcn.1400380b9
test rbx, rbx
je 0x140023689
mov rcx, rbx
call sub.msvcrt.dll_fclose
xor ebp, ebp
jmp 0x140023693
mov rcx, rdi
test rdi, rdi
jne 0x140023680
jmp 0x140023685
test rsi, rsi
je 0x1400236a1
mov rcx, rsi
call qword [sym.imp.msvcrt.dll__wunlink]
mov rcx, qword [rsp + 0x28]
call sub.msvcrt.dll_free
mov rcx, rsi
call sub.msvcrt.dll_free
mov rcx, qword [rsp + 0x20]
call sub.msvcrt.dll_free
mov rcx, qword [rsp + 0x30]
call sub.msvcrt.dll_free
jmp 0x1400236cd
xor esi, esi
jmp 0x140023685
mov rax, rbp
add rsp, 0x868
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret