Function at 0x4278b9
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 esi, dword [ebp + 0xc]
mov dword [ebp - 0x824], 0x4a0256
mov dword [ebp - 0x820], str.w__ccsUTF_8
mov dword [ebp - 0x81c], str.w__ccsUTF_16LE
test esi, esi
mov word [ebp - 0x828], 0
sete al
cmp dword [ebp + 0x10], 0
sete dl
or al, dl
jne 0x427d20
cmp dword [ebp + 8], 0
je 0x427d20
xor eax, eax
mov dword [ebp - 0x82c], eax
mov eax, dword [ebp + 8]
cmp byte [eax], 0
je 0x427d3f
cmp byte [esi], 0
je 0x427d3f
mov eax, dword [ebp + 0x10]
cmp byte [eax], 0
je 0x427d3f
mov eax, dword [ebp + 8]
call fcn.00426364
mov dword [ebp - 0x830], eax
test eax, eax
jne 0x427951
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
jmp 0x427966
mov eax, esi
call fcn.00426364
mov dword [ebp - 0x838], eax
test eax, eax
jne 0x427985
mov dword [esp + 4], esi
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 - 0x838], edx
jmp 0x427d2a
mov eax, dword [ebp + 0x10]
call fcn.00426364
mov dword [ebp - 0x83c], eax
test eax, eax
jne 0x4279a7
mov eax, dword [ebp + 0x10]
mov dword [esp], str.Could_not_convert__s_to_UTF_16
mov dword [esp + 4], eax
jmp 0x4279d2
mov eax, dword [ebp - 0x830]
mov dword [esp + 4], str.r__ccsUNICODE
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__wfopen]
mov edi, eax
test eax, eax
jne 0x4279dc
mov eax, dword [ebp + 8]
mov dword [esp], str.Could_not_open_file__s_n
mov dword [esp + 4], eax
call fcn.0043d9e0
jmp 0x427d2a
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x828]
mov dword [esp + 8], 1
mov dword [esp + 4], 2
mov dword [esp], eax
call sub.msvcrt.dll_fread
dec eax
je 0x427a23
mov eax, dword [ebp + 8]
mov dword [esp], str.Could_not_read_file__s_n
xor ebx, ebx
mov dword [esp + 4], eax
call fcn.0043d9e0
xor eax, eax
mov dword [ebp - 0x834], eax
jmp 0x427baa
mov dword [ebp - 0x834], 1
mov eax, dword [ebp - 0x828]
cmp ax, 0xbbef
je 0x427a4b
cmp ax, 0xfeff
sete al
movzx eax, al
add eax, eax
mov dword [ebp - 0x834], eax
xor eax, eax
mov dword [esp], edi
mov dword [esp + 8], eax
mov dword [esp + 4], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebp - 0x830]
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 ebx, eax
test eax, eax
jne 0x427a95
mov dword [esp], str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.0043d9e0
jmp 0x427baa
mov eax, dword [ebp - 0x830]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sub.msvcrt.dll_wcscpy
mov dword [esp], ebx
call sub.msvcrt.dll_wcslen
mov word [ebx + eax*2], 0x7e
mov eax, dword [ebp - 0x834]
mov dword [esp], ebx
mov eax, dword [ebp + eax*4 - 0x824]
mov dword [esp + 4], eax
call dword [sym.imp.msvcrt.dll__wfopen]
mov esi, eax
xor eax, eax
mov dword [ebp - 0x82c], eax
test esi, esi
jne 0x427b56
mov eax, dword [ebp + 8]
mov dword [esp], str.Could_not_open_temporary_output_file__s_n
mov dword [esp + 4], eax
call fcn.0043d9e0
jmp 0x427baa
mov dword [esp], ecx
mov dword [esp + 4], 0x4a0718
call sub.msvcrt.dll_wcsspn
mov dword [ebp - 0x840], eax
mov eax, dword [ebp - 0x838]
mov dword [esp], eax
call sub.msvcrt.dll_wcslen
mov edx, dword [ebp - 0x840]
lea ecx, [ebp - 0x818]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x838]
add edx, edx
add edx, ecx
mov dword [esp + 4], eax
mov dword [esp], edx
call dword [sym.imp.msvcrt.dll__wcsnicmp]
lea ecx, [ebp - 0x818]
mov dword [esp + 4], esi
test eax, eax
mov dword [esp], ecx
je 0x427b80
call sub.msvcrt.dll_fputws
lea ecx, [ebp - 0x818]
mov dword [esp + 8], edi
mov dword [esp], ecx
mov dword [esp + 4], 0x400
call sub.msvcrt.dll_fgetws
lea ecx, [ebp - 0x818]
test eax, eax
jne 0x427af5
jmp 0x427bb4
call sub.msvcrt.dll_fputws
mov eax, dword [ebp - 0x83c]
mov dword [esp + 4], 0x4a030e
mov dword [esp], esi
mov dword [esp + 8], eax
call sub.msvcrt.dll_fwprintf_s
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x82c], eax
jmp 0x427b56
xor ecx, ecx
xor esi, esi
mov dword [ebp - 0x82c], ecx
mov dword [esp], edi
call sub.msvcrt.dll_fclose
test esi, esi
je 0x427bc8
mov dword [esp], esi
call sub.msvcrt.dll_fclose
cmp dword [ebp - 0x82c], 0
je 0x427cdf
test ebx, ebx
je 0x427cec
cmp dword [ebp - 0x830], 0
je 0x427ce3
mov esi, dword [sym.imp.msvcrt.dll__wfopen]
mov dword [esp + 4], 0x49fd6e
mov dword [esp], ebx
call esi
mov dword [esp + 4], 0x4a0328
mov edi, eax
mov eax, dword [ebp - 0x830]
mov dword [esp], eax
call esi
mov esi, eax
test edi, edi
je 0x427cab
test eax, eax
je 0x427cab
xor edx, edx
cmp dword [ebp - 0x834], 2
sete dl
inc edx
lea eax, [ebp - 0x826]
mov dword [esp + 4], edx
mov dword [esp + 0xc], edi
mov dword [esp + 8], 1
mov dword [esp], eax
mov dword [ebp - 0x834], edx
call sub.msvcrt.dll_fread
mov edx, dword [ebp - 0x834]
dec eax
jne 0x427c99
cmp dword [ebp + 0x14], 0
je 0x427c6d
cmp byte [ebp - 0x826], 0xd
je 0x427c31
lea eax, [ebp - 0x826]
mov dword [esp + 4], edx
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp], eax
mov dword [ebp - 0x834], edx
call sub.msvcrt.dll_fwrite
mov edx, dword [ebp - 0x834]
jmp 0x427c31
mov dword [esp], edi
call sub.msvcrt.dll_fclose
mov dword [esp], esi
call sub.msvcrt.dll_fclose
jmp 0x427ce3
mov eax, dword [ebp + 8]
mov dword [esp], str.Could_not_write__s___original_file_has_been_left_unmodified_n
mov dword [esp + 4], eax
call fcn.0043d9e0
test edi, edi
je 0x427cc7
mov dword [esp], edi
jmp 0x427cd8
test esi, esi
jne 0x427cd5
xor esi, esi
mov dword [ebp - 0x82c], esi
jmp 0x427ce3
mov dword [esp], esi
call sub.msvcrt.dll_fclose
jmp 0x427ccb
test ebx, ebx
je 0x427cec
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll__wunlink]
mov eax, dword [ebp - 0x830]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov dword [esp], ebx
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x838]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x83c]
mov dword [esp], eax
call sub.msvcrt.dll_free
jmp 0x427d3f
xor ebx, ebx
mov dword [ebp - 0x82c], ebx
jmp 0x427d3f
xor eax, eax
xor ebx, ebx
mov dword [ebp - 0x82c], eax
mov dword [ebp - 0x834], eax
jmp 0x427bc8
mov eax, dword [ebp - 0x82c]
add esp, 0x84c
pop ebx
pop esi
pop edi
pop ebp
ret