Function at 0x14002350c
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, [0x14008f256]
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 0x140023a10
test rdx, rdx
je 0x140023a10
test r8, r8
je 0x140023a10
test r9, r9
je 0x140023a10
cmp byte [r12], 0
je 0x140023a10
cmp byte [rdx], 0
je 0x140023a10
cmp byte [r8], 0
je 0x140023a10
mov rdx, r9
mov rcx, r8
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x140023a10
mov rcx, r12
call fcn.140021d92
mov rdx, r12
mov qword [rsp + 0x28], rax
test rax, rax
je 0x1400235f9
mov rcx, rbp
call fcn.140021d92
mov qword [rsp + 0x30], rax
test rax, rax
jne 0x140023619
mov rdx, rbp
lea rcx, str.Could_not_convert__s_to_UTF_16
xor r14d, r14d
call fcn.140036717
xor eax, eax
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x30], rax
jmp 0x140023a05
mov rcx, rbx
call fcn.140021d92
mov qword [rsp + 0x40], rax
test rax, rax
jne 0x140023642
mov rdx, rbx
lea rcx, str.Could_not_convert__s_to_UTF_16
xor r14d, r14d
call fcn.140036717
jmp 0x140023a05
mov rcx, qword [rsp + 0x928]
call fcn.140021d92
mov r14, rax
test rax, rax
jne 0x140023668
mov rdx, qword [rsp + 0x928]
lea rcx, str.Could_not_convert__s_to_UTF_16
jmp 0x140023691
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 0x14002369b
mov rdx, r12
lea rcx, str.Could_not_open_file__s_n
call fcn.140036717
jmp 0x140023a05
mov r9, qword [rsp + 0x38]
lea rcx, [rsp + 0x54]
mov r8d, 1
mov edx, 2
call sub.msvcrt.dll_fread
dec rax
je 0x1400236e2
mov rcx, qword [rsp + 0x38]
call sub.msvcrt.dll_feof
mov edi, eax
test eax, eax
jne 0x1400238ca
mov rdx, r12
lea rcx, str.Could_not_read_file__s_n
call fcn.140036717
jmp 0x1400238cc
mov eax, dword [rsp + 0x54]
mov edi, 1
cmp ax, 0xbbef
je 0x1400236fd
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 0x14002373d
lea rcx, str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.140036717
jmp 0x1400238ce
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 0x1400237c3
mov rdx, r12
lea rcx, str.Could_not_open_temporary_output_file__s_n
call fcn.140036717
jmp 0x1400238ce
lea rdx, [0x14008f7c8]
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 0x1400237e7
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 0x140023783
jmp 0x1400238d2
mov rcx, qword [rsp + 0x30]
call sub.msvcrt.dll_wcslen
lea rdx, [0x14008f7c8]
add r15, rax
lea rcx, [r15 + r15]
add rcx, r13
call sub.msvcrt.dll_wcsspn
test rax, rax
je 0x1400237b8
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 0x14002384a
cmp qword [rsp + 0x70], 0
lea r13, [rsp + 0xc0]
je 0x1400237b8
xor esi, esi
lea r15, [rsp + 0x70]
jmp 0x140023882
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 0x140023813
jmp 0x14002382d
mov r8, qword [rsp + rsi*8 + 0x98]
add r8, r8
add r8, r13
cmp qword [r15 + rsi*8], 0
je 0x1400238ae
mov r9, r14
lea rdx, [0x14008f444]
mov rcx, rbp
inc rsi
call sub.msvcrt.dll_fwprintf_s
jmp 0x140023882
lea rdx, [0x14008f44e]
mov rcx, rbp
call sub.msvcrt.dll_fwprintf_s
mov rsi, qword [rsp + 0x928]
jmp 0x1400237c3
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 0x1400238e9
mov rcx, rbp
call sub.msvcrt.dll_fclose
test rsi, rsi
je 0x1400239c7
test rbx, rbx
je 0x1400239d5
cmp qword [rsp + 0x28], 0
je 0x1400239cc
mov rbp, qword [sym.imp.msvcrt.dll__wfopen]
lea rdx, [0x14008ed6e]
mov rcx, rbx
call rbp
mov rcx, qword [rsp + 0x28]
lea rdx, [0x14008f328]
mov r13, rax
call rbp
mov rbp, rax
test r13, r13
je 0x14002399d
test rax, rax
je 0x14002399d
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 0x14002398b
cmp dword [rsp + 0x930], 0
je 0x140023975
cmp byte [rsp + 0x56], 0xd
je 0x14002394b
mov r9, rbp
mov r8d, 1
mov rdx, rdi
mov rcx, r12
call sub.msvcrt.dll_fwrite
jmp 0x14002394b
mov rcx, r13
call sub.msvcrt.dll_fclose
mov rcx, rbp
call sub.msvcrt.dll_fclose
jmp 0x1400239cc
lea rcx, str.Could_not_write__s___original_file_has_been_left_unmodified._n
mov rdx, r12
call fcn.140036717
mov rcx, r13
test r13, r13
jne 0x1400239c0
mov rcx, rbp
test rbp, rbp
jne 0x1400239c0
xor esi, esi
jmp 0x1400239cc
call sub.msvcrt.dll_fclose
jmp 0x1400239bc
test rbx, rbx
je 0x1400239d5
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 0x140023a10
xor esi, esi
xor edi, edi
xor ebx, ebx
jmp 0x1400238e9
mov rax, rsi
add rsp, 0x8c8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret