Function at 0x140023e8c
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, 0x8c8
lea rax, [0x140094476]
xor esi, esi
mov qword [rsp + 0x58], rax
mov r12, rcx
lea rdi, [rsp + 0x70]
mov rbp, rdx
lea rax, str.w__ccsUTF_8
mov ecx, 0xa
mov rbx, r8
mov qword [rsp + 0x928], r9
mov qword [rsp + 0x60], rax
lea rax, str.w__ccsUTF_16LE
mov qword [rsp + 0x68], rax
xor eax, eax
rep stosd dword [rdi], eax
lea rdi, [rsp + 0x98]
mov ecx, 0xa
mov word [rsp + 0x54], 0
rep stosd dword [rdi], eax
test r12, r12
je 0x140024390
test rdx, rdx
je 0x140024390
test r8, r8
je 0x140024390
test r9, r9
je 0x140024390
cmp byte [r12], 0
je 0x140024390
cmp byte [rdx], 0
je 0x140024390
cmp byte [r8], 0
je 0x140024390
mov rdx, r9
mov rcx, r8
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x140024390
mov rcx, r12
call fcn.140022712
mov rdx, r12
mov qword [rsp + 0x28], rax
test rax, rax
je 0x140023f79
mov rcx, rbp
call fcn.140022712
mov qword [rsp + 0x30], rax
test rax, rax
jne 0x140023f99
mov rdx, rbp
lea rcx, str.Could_not_convert__s_to_UTF_16
xor r14d, r14d
call fcn.1400380b9
xor eax, eax
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x30], rax
jmp 0x140024385
mov rcx, rbx
call fcn.140022712
mov qword [rsp + 0x40], rax
test rax, rax
jne 0x140023fc2
mov rdx, rbx
lea rcx, str.Could_not_convert__s_to_UTF_16
xor r14d, r14d
call fcn.1400380b9
jmp 0x140024385
mov rcx, qword [rsp + 0x928]
call fcn.140022712
mov r14, rax
test rax, rax
jne 0x140023fe8
mov rdx, qword [rsp + 0x928]
lea rcx, str.Could_not_convert__s_to_UTF_16
jmp 0x140024011
mov rcx, qword [rsp + 0x28]
mov rsi, qword [sym.imp.msvcrt.dll__wfopen]
lea rdx, str.r__ccsUNICODE
call rsi
mov qword [rsp + 0x38], rax
test rax, rax
jne 0x14002401b
mov rdx, r12
lea rcx, str.Could_not_open_file__s_n
call fcn.1400380b9
jmp 0x140024385
mov r9, qword [rsp + 0x38]
lea rcx, [rsp + 0x54]
mov r8d, 1
mov edx, 2
call sub.msvcrt.dll_fread
dec rax
je 0x140024062
mov rcx, qword [rsp + 0x38]
call sub.msvcrt.dll_feof
mov edi, eax
test eax, eax
jne 0x14002424a
mov rdx, r12
lea rcx, str.Could_not_read_file__s_n
call fcn.1400380b9
jmp 0x14002424c
mov eax, dword [rsp + 0x54]
mov edi, 1
cmp ax, 0xbbef
je 0x14002407d
xor edi, edi
cmp ax, 0xfeff
sete dil
add edi, edi
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 rbx, rax
test rax, rax
jne 0x1400240bd
lea rcx, str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.1400380b9
jmp 0x14002424e
mov rdx, qword [rsp + 0x28]
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, edi
mov rdx, qword [rsp + rax*8 + 0x58]
call rsi
xor esi, esi
mov rbp, rax
test rax, rax
jne 0x140024143
mov rdx, r12
lea rcx, str.Could_not_open_temporary_output_file__s_n
call fcn.1400380b9
jmp 0x14002424e
lea rdx, [0x1400949e8]
mov rcx, r13
call sub.msvcrt.dll_wcsspn
mov rcx, qword [rsp + 0x30]
mov r15, rax
call sub.msvcrt.dll_wcslen
lea rcx, [r15 + r15]
mov rdx, qword [rsp + 0x30]
add rcx, r13
mov r8, rax
call qword [sym.imp.msvcrt.dll__wcsnicmp]
test eax, eax
je 0x140024167
mov rdx, rbp
mov rcx, r13
call sub.msvcrt.dll_fputws
lea r13, [rsp + 0xc0]
mov r8, qword [rsp + 0x38]
mov edx, 0x400
mov rcx, r13
call sub.msvcrt.dll_fgetws
test rax, rax
jne 0x140024103
jmp 0x140024252
mov rcx, qword [rsp + 0x30]
call sub.msvcrt.dll_wcslen
lea rdx, [0x1400949e8]
add r15, rax
lea rcx, [r15 + r15]
add rcx, r13
call sub.msvcrt.dll_wcsspn
test rax, rax
je 0x140024138
lea rcx, [r15 + rax]
xor r15d, r15d
mov rdx, qword [rsp + 0x40]
add rcx, rcx
add rcx, r13
call sub.msvcrt.dll_wcsstr
mov qword [rsp + r15*8 + 0x70], rax
test rax, rax
jne 0x1400241ca
cmp qword [rsp + 0x70], 0
lea r13, [rsp + 0xc0]
je 0x140024138
xor esi, esi
lea r15, [rsp + 0x70]
jmp 0x140024202
mov rcx, qword [rsp + 0x40]
mov qword [rsp + 0x48], rax
inc r15
call sub.msvcrt.dll_wcslen
mov rdx, qword [rsp + 0x48]
mov rcx, rdx
mov word [rdx], 0
sub rcx, r13
sar rcx, 1
add rcx, rax
mov qword [rsp + r15*8 + 0x98], rcx
cmp r15, 4
jne 0x140024193
jmp 0x1400241ad
mov r8, qword [rsp + rsi*8 + 0x98]
add r8, r8
add r8, r13
cmp qword [r15 + rsi*8], 0
je 0x14002422e
mov r9, r14
lea rdx, [0x140094664]
mov rcx, rbp
inc rsi
call sub.msvcrt.dll_fwprintf_s
jmp 0x140024202
lea rdx, [0x14009466e]
mov rcx, rbp
call sub.msvcrt.dll_fwprintf_s
mov rsi, qword [rsp + 0x928]
jmp 0x140024143
xor edi, edi
xor ebx, ebx
xor esi, esi
xor ebp, ebp
mov rcx, qword [rsp + 0x38]
call sub.msvcrt.dll_fclose
test rbp, rbp
je 0x140024269
mov rcx, rbp
call sub.msvcrt.dll_fclose
test rsi, rsi
je 0x140024347
test rbx, rbx
je 0x140024355
cmp qword [rsp + 0x28], 0
je 0x14002434c
mov rbp, qword [sym.imp.msvcrt.dll__wfopen]
lea rdx, [0x140093f8e]
mov rcx, rbx
call rbp
mov rcx, qword [rsp + 0x28]
lea rdx, [0x140094548]
mov r13, rax
call rbp
mov rbp, rax
test r13, r13
je 0x14002431d
test rax, rax
je 0x14002431d
cmp edi, 2
lea r12, [rsp + 0x56]
sete dil
movzx edi, dil
inc rdi
mov r9, r13
mov r8d, 1
mov rdx, rdi
mov rcx, r12
call sub.msvcrt.dll_fread
dec rax
jne 0x14002430b
cmp dword [rsp + 0x930], 0
je 0x1400242f5
cmp byte [rsp + 0x56], 0xd
je 0x1400242cb
mov r9, rbp
mov r8d, 1
mov rdx, rdi
mov rcx, r12
call sub.msvcrt.dll_fwrite
jmp 0x1400242cb
mov rcx, r13
call sub.msvcrt.dll_fclose
mov rcx, rbp
call sub.msvcrt.dll_fclose
jmp 0x14002434c
lea rcx, str.Could_not_write__s___original_file_has_been_left_unmodified._n
mov rdx, r12
call fcn.1400380b9
mov rcx, r13
test r13, r13
jne 0x140024340
mov rcx, rbp
test rbp, rbp
jne 0x140024340
xor esi, esi
jmp 0x14002434c
call sub.msvcrt.dll_fclose
jmp 0x14002433c
test rbx, rbx
je 0x140024355
mov rcx, rbx
call qword [sym.imp.msvcrt.dll__wunlink]
mov rcx, qword [rsp + 0x28]
call sub.msvcrt.dll_free
mov rcx, rbx
call sub.msvcrt.dll_free
mov rcx, qword [rsp + 0x30]
call sub.msvcrt.dll_free
mov rcx, qword [rsp + 0x40]
call sub.msvcrt.dll_free
mov rcx, r14
call sub.msvcrt.dll_free
jmp 0x140024390
xor esi, esi
xor edi, edi
xor ebx, ebx
jmp 0x140024269
mov rax, rsi
add rsp, 0x8c8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret