Function at 0x4280dd
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], 0x4a2ef6
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 0x428476
cmp dword [ebp + 0x10], 0
je 0x428476
mov eax, dword [ebp + 0x10]
xor ecx, ecx
mov dword [ebp - 0x830], ecx
cmp byte [eax], 0
je 0x4285df
cmp byte [ebx], 0
je 0x4285df
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0
je 0x4285df
mov eax, dword [ebp + 0x10]
call fcn.0042747a
mov dword [ebp - 0x838], eax
test eax, eax
jne 0x428175
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
jmp 0x42818a
mov eax, ebx
call fcn.0042747a
mov dword [ebp - 0x834], eax
test eax, eax
jne 0x4281a9
mov dword [esp + 4], ebx
mov dword [esp], str.Could_not_convert__s_to_UTF_16
call fcn.0043efa9
xor edx, edx
mov dword [ebp - 0x83c], edx
mov dword [ebp - 0x834], edx
jmp 0x4285d5
mov eax, dword [ebp + 0xc]
call fcn.0042747a
mov dword [ebp - 0x83c], eax
test eax, eax
jne 0x4281cb
mov eax, dword [ebp + 0xc]
mov dword [esp], str.Could_not_convert__s_to_UTF_16
mov dword [esp + 4], eax
jmp 0x4281fa
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 0x428204
mov eax, dword [ebp + 0x10]
mov dword [esp], str.Could_not_open_file__s_n
mov dword [esp + 4], eax
call fcn.0043efa9
jmp 0x4285d5
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 0x428277
mov dword [ebp - 0x844], 1
mov eax, dword [ebp - 0x828]
cmp ax, 0xbbef
je 0x42825f
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 0x4282b0
mov dword [esp], str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.0043efa9
jmp 0x42831d
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 0x42835b
mov eax, dword [ebp + 0x10]
mov dword [esp], str.Could_not_open_temporary_output_file__s_n
mov dword [esp + 4], eax
call fcn.0043efa9
xor esi, esi
xor ebx, ebx
mov dword [ebp - 0x830], esi
jmp 0x428483
mov dword [esp + 4], 0x4a33b8
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 0x428384
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 0x42832c
jmp 0x42843e
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 0x42834f
mov eax, dword [ebp - 0x834]
mov dword [esp], eax
call sub.msvcrt.dll_wcslen
mov dword [esp + 4], 0x4a33b8
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 0x42834f
inc edi
mov dword [esp + 4], 0x4a33b8
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], 0x4a2fae
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 0x42835b
cmp dword [ebp - 0x830], 0
jne 0x428483
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 0x428483
xor ecx, ecx
mov dword [ebp - 0x830], ecx
jmp 0x4285df
mov eax, dword [ebp - 0x840]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
test ebx, ebx
je 0x42849d
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
cmp dword [ebp - 0x830], 0
je 0x428570
xor ebx, ebx
cmp dword [ebp - 0x82c], 0
je 0x4284ce
mov eax, dword [ebp - 0x82c]
mov dword [esp + 4], 0x4a2a0e
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__wfopen]
mov ebx, eax
mov eax, dword [ebp - 0x838]
mov dword [esp + 4], 0x4a2fc8
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__wfopen]
mov esi, eax
test ebx, ebx
je 0x428551
test eax, eax
je 0x428551
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 0x42853f
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 0x4284fe
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
mov dword [esp], esi
call sub.msvcrt.dll_fclose
jmp 0x428583
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.0043efa9
test ebx, ebx
je 0x42857a
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
xor ebx, ebx
mov dword [ebp - 0x830], ebx
jmp 0x428583
test esi, esi
je 0x428570
mov dword [esp], esi
jmp 0x42856b
cmp dword [ebp - 0x82c], 0
je 0x42859b
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 0x4285df
xor eax, eax
mov dword [ebp - 0x82c], eax
jmp 0x428570
mov eax, dword [ebp - 0x830]
add esp, 0x84c
pop ebx
pop esi
pop edi
pop ebp
ret