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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x84c
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x824], 0x4a0256
mov dword [ebp - 0x820], str.w__ccsUTF_8
mov dword [ebp - 0x81c], str.w__ccsUTF_16LE
test ebx, ebx
mov word [ebp - 0x828], 0
sete al
cmp dword [ebp + 0xc], 0
sete dl
or al, dl
jne 0x427360
cmp dword [ebp + 0x10], 0
je 0x427360
mov eax, dword [ebp + 0x10]
xor ecx, ecx
mov dword [ebp - 0x830], ecx
cmp byte [eax], 0
je 0x4274c9
cmp byte [ebx], 0
je 0x4274c9
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0
je 0x4274c9
mov eax, dword [ebp + 0x10]
call fcn.00426364
mov dword [ebp - 0x838], eax
test eax, eax
jne 0x42705f
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
jmp 0x427074
mov eax, ebx
call fcn.00426364
mov dword [ebp - 0x834], eax
test eax, eax
jne 0x427093
mov dword [esp + 4], ebx
mov dword [esp], str.Could_not_convert__s_to_UTF_16
call fcn.0043d9e0
xor edx, edx
mov dword [ebp - 0x83c], edx
mov dword [ebp - 0x834], edx
jmp 0x4274bf
mov eax, dword [ebp + 0xc]
call fcn.00426364
mov dword [ebp - 0x83c], eax
test eax, eax
jne 0x4270b5
mov eax, dword [ebp + 0xc]
mov dword [esp], str.Could_not_convert__s_to_UTF_16
mov dword [esp + 4], eax
jmp 0x4270e4
mov eax, dword [ebp - 0x838]
mov dword [esp + 4], str.r__ccsUNICODE
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__wfopen]
mov dword [ebp - 0x840], eax
test eax, eax
jne 0x4270ee
mov eax, dword [ebp + 0x10]
mov dword [esp], str.Could_not_open_file__s_n
mov dword [esp + 4], eax
call fcn.0043d9e0
jmp 0x4274bf
mov eax, dword [ebp - 0x840]
mov dword [esp + 8], 1
mov dword [esp + 4], 2
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x828]
mov dword [esp], eax
call sub.msvcrt.dll_fread
xor edx, edx
dec eax
mov dword [ebp - 0x844], edx
jne 0x427161
mov dword [ebp - 0x844], 1
mov eax, dword [ebp - 0x828]
cmp ax, 0xbbef
je 0x427149
cmp ax, 0xfeff
sete al
movzx eax, al
add eax, eax
mov dword [ebp - 0x844], eax
xor eax, eax
mov dword [esp + 8], eax
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x840]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebp - 0x838]
mov dword [esp], eax
call sub.msvcrt.dll_wcslen
mov dword [esp + 4], 2
add eax, 2
mov dword [esp], eax
call sub.msvcrt.dll_calloc
mov dword [ebp - 0x82c], eax
test eax, eax
jne 0x42719a
mov dword [esp], str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.0043d9e0
jmp 0x427207
mov eax, dword [ebp - 0x838]
xor edi, edi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x82c]
mov dword [esp], eax
call sub.msvcrt.dll_wcscpy
mov eax, dword [ebp - 0x82c]
mov dword [esp], eax
call sub.msvcrt.dll_wcslen
mov ecx, dword [ebp - 0x82c]
mov word [ecx + eax*2], 0x7e
mov eax, dword [ebp - 0x844]
mov dword [esp], ecx
mov eax, dword [ebp + eax*4 - 0x824]
mov dword [esp + 4], eax
call dword [sym.imp.msvcrt.dll__wfopen]
mov dword [ebp - 0x830], edi
mov ebx, eax
test eax, eax
jne 0x427245
mov eax, dword [ebp + 0x10]
mov dword [esp], str.Could_not_open_temporary_output_file__s_n
mov dword [esp + 4], eax
call fcn.0043d9e0
xor esi, esi
xor ebx, ebx
mov dword [ebp - 0x830], esi
jmp 0x42736d
mov dword [esp + 4], 0x4a0718
mov dword [esp], esi
call sub.msvcrt.dll_wcsspn
mov edi, eax
mov ax, word [ebp + eax*2 - 0x818]
sub eax, 0x3b
test ax, 0xffdf
jne 0x42726e
mov dword [esp + 4], ebx
mov dword [esp], esi
call sub.msvcrt.dll_fputws
mov eax, dword [ebp - 0x840]
lea esi, [ebp - 0x818]
mov dword [esp + 4], 0x400
mov dword [esp], esi
mov dword [esp + 8], eax
call sub.msvcrt.dll_fgetws
test eax, eax
jne 0x427216
jmp 0x427328
mov eax, dword [ebp - 0x834]
mov dword [esp], eax
call sub.msvcrt.dll_wcslen
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x834]
mov dword [esp + 4], eax
lea eax, [edi + edi]
add eax, esi
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__wcsnicmp]
test eax, eax
jne 0x427239
mov eax, dword [ebp - 0x834]
mov dword [esp], eax
call sub.msvcrt.dll_wcslen
mov dword [esp + 4], 0x4a0718
add edi, eax
lea eax, [edi + edi]
add eax, esi
mov dword [esp], eax
call sub.msvcrt.dll_wcsspn
add edi, eax
cmp word [ebp + edi*2 - 0x818], 0x3d
jne 0x427239
inc edi
mov dword [esp + 4], 0x4a0718
lea eax, [edi + edi]
add eax, esi
mov dword [esp], eax
call sub.msvcrt.dll_wcsspn
mov dword [esp + 4], ebx
mov dword [esp], esi
add edi, eax
mov word [ebp + edi*2 - 0x818], 0
call sub.msvcrt.dll_fputws
mov eax, dword [ebp - 0x83c]
mov dword [esp + 4], 0x4a030e
mov dword [esp], ebx
mov dword [esp + 8], eax
call sub.msvcrt.dll_fwprintf_s
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x830], eax
jmp 0x427245
cmp dword [ebp - 0x830], 0
jne 0x42736d
mov eax, dword [ebp - 0x83c]
mov dword [esp + 4], str._s___s_n
mov dword [esp], ebx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x834]
mov dword [esp + 8], eax
call sub.msvcrt.dll_fwprintf_s
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x830], eax
jmp 0x42736d
xor ecx, ecx
mov dword [ebp - 0x830], ecx
jmp 0x4274c9
mov eax, dword [ebp - 0x840]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
test ebx, ebx
je 0x427387
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
cmp dword [ebp - 0x830], 0
je 0x42745a
xor ebx, ebx
cmp dword [ebp - 0x82c], 0
je 0x4273b8
mov eax, dword [ebp - 0x82c]
mov dword [esp + 4], 0x49fd6e
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__wfopen]
mov ebx, eax
mov eax, dword [ebp - 0x838]
mov dword [esp + 4], 0x4a0328
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__wfopen]
mov esi, eax
test ebx, ebx
je 0x42743b
test eax, eax
je 0x42743b
xor eax, eax
cmp dword [ebp - 0x844], 2
sete al
mov edi, eax
inc edi
lea edx, [ebp - 0x826]
mov dword [esp + 0xc], ebx
mov dword [esp], edx
mov dword [esp + 8], 1
mov dword [esp + 4], edi
call sub.msvcrt.dll_fread
lea edx, [ebp - 0x826]
dec eax
jne 0x427429
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], edi
mov dword [esp], edx
call sub.msvcrt.dll_fwrite
jmp 0x4273e8
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
mov dword [esp], esi
call sub.msvcrt.dll_fclose
jmp 0x42746d
mov eax, dword [ebp + 0x10]
mov dword [esp], str.Could_not_write__s___original_file_has_been_left_unmodified_n
mov dword [esp + 4], eax
call fcn.0043d9e0
test ebx, ebx
je 0x427464
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
xor ebx, ebx
mov dword [ebp - 0x830], ebx
jmp 0x42746d
test esi, esi
je 0x42745a
mov dword [esp], esi
jmp 0x427455
cmp dword [ebp - 0x82c], 0
je 0x427485
mov eax, dword [ebp - 0x82c]
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__wunlink]
mov eax, dword [ebp - 0x838]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x82c]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x834]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x83c]
mov dword [esp], eax
call sub.msvcrt.dll_free
jmp 0x4274c9
xor eax, eax
mov dword [ebp - 0x82c], eax
jmp 0x42745a
mov eax, dword [ebp - 0x830]
add esp, 0x84c
pop ebx
pop esi
pop edi
pop ebp
ret