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

Disassembly:
push ebp
xor eax, eax
mov ecx, 5
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x840]
push ebx
sub esp, 0x87c
cmp dword [ebp + 8], 0
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x84c], 0x4a0256
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x82c]
mov ebx, dword [ebp + 0x10]
mov ecx, 5
rep stosd dword es:[edi], eax
mov dword [ebp - 0x848], str.w__ccsUTF_8
mov dword [ebp - 0x844], str.w__ccsUTF_16LE
mov word [ebp - 0x850], 0
je 0x42833f
test esi, esi
je 0x42833f
test ebx, ebx
je 0x42833f
cmp dword [ebp + 0x14], 0
je 0x42833f
xor eax, eax
mov dword [ebp - 0x860], eax
mov eax, dword [ebp + 8]
cmp byte [eax], 0
je 0x428362
cmp byte [esi], 0
je 0x428362
cmp byte [ebx], 0
je 0x428362
mov eax, dword [ebp + 0x14]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x428362
mov eax, dword [ebp + 8]
call fcn.00426364
mov dword [ebp - 0x868], eax
test eax, eax
jne 0x427e21
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
jmp 0x427e36
mov eax, esi
call fcn.00426364
mov dword [ebp - 0x86c], eax
test eax, eax
jne 0x427e5b
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 - 0x878], edx
mov dword [ebp - 0x874], edx
mov dword [ebp - 0x86c], edx
jmp 0x428349
mov eax, ebx
call fcn.00426364
mov dword [ebp - 0x874], eax
test eax, eax
jne 0x427e89
mov dword [esp + 4], ebx
mov dword [esp], str.Could_not_convert__s_to_UTF_16
call fcn.0043d9e0
xor eax, eax
mov dword [ebp - 0x878], eax
jmp 0x428349
mov eax, dword [ebp + 0x14]
call fcn.00426364
mov dword [ebp - 0x878], eax
test eax, eax
jne 0x427eab
mov eax, dword [ebp + 0x14]
mov dword [esp], str.Could_not_convert__s_to_UTF_16
mov dword [esp + 4], eax
jmp 0x427eda
mov eax, dword [ebp - 0x868]
mov dword [esp + 4], str.r__ccsUNICODE
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__wfopen]
mov dword [ebp - 0x870], eax
test eax, eax
jne 0x427ee4
mov eax, dword [ebp + 8]
mov dword [esp], str.Could_not_open_file__s_n
mov dword [esp + 4], eax
call fcn.0043d9e0
jmp 0x428349
mov eax, dword [ebp - 0x870]
mov dword [esp + 8], 1
mov dword [esp + 4], 2
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x850]
mov dword [esp], eax
call sub.msvcrt.dll_fread
dec eax
je 0x427f43
mov eax, dword [ebp - 0x870]
mov dword [esp], eax
call sub.msvcrt.dll_feof
mov dword [ebp - 0x864], eax
test eax, eax
jne 0x4281a7
mov eax, dword [ebp + 8]
mov dword [esp], str.Could_not_read_file__s_n
mov dword [esp + 4], eax
call fcn.0043d9e0
jmp 0x4281af
mov dword [ebp - 0x864], 1
mov eax, dword [ebp - 0x850]
cmp ax, 0xbbef
je 0x427f6b
cmp ax, 0xfeff
sete al
movzx eax, al
add eax, eax
mov dword [ebp - 0x864], eax
xor eax, eax
mov dword [esp + 8], eax
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x870]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebp - 0x868]
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 - 0x85c], eax
test eax, eax
jne 0x427fbf
mov dword [esp], str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.0043d9e0
jmp 0x4281b7
mov eax, dword [ebp - 0x868]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x85c]
mov dword [esp], eax
call sub.msvcrt.dll_wcscpy
mov eax, dword [ebp - 0x85c]
mov dword [esp], eax
call sub.msvcrt.dll_wcslen
mov ecx, dword [ebp - 0x85c]
mov word [ecx + eax*2], 0x7e
mov eax, dword [ebp - 0x864]
mov dword [esp], ecx
mov eax, dword [ebp + eax*4 - 0x84c]
mov dword [esp + 4], eax
call dword [sym.imp.msvcrt.dll__wfopen]
mov ebx, eax
xor eax, eax
mov dword [ebp - 0x860], eax
test ebx, ebx
jne 0x42807d
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 0x4281b7
mov dword [esp + 4], 0x4a0718
mov dword [esp], esi
call sub.msvcrt.dll_wcsspn
mov edi, eax
mov eax, dword [ebp - 0x86c]
mov dword [esp], eax
call sub.msvcrt.dll_wcslen
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x86c]
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
je 0x4280a6
mov dword [esp + 4], ebx
mov dword [esp], esi
call sub.msvcrt.dll_fputws
mov eax, dword [ebp - 0x870]
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 0x428031
jmp 0x4281c1
mov eax, dword [ebp - 0x86c]
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
test eax, eax
je 0x428071
lea edx, [edi + eax]
xor esi, esi
mov eax, dword [ebp - 0x874]
add edx, edx
mov dword [esp + 4], eax
lea eax, [ebp - 0x818]
add edx, eax
mov dword [esp], edx
call sub.msvcrt.dll_wcsstr
mov dword [ebp + esi*4 - 0x840], eax
mov edi, eax
test eax, eax
jne 0x42811a
xor esi, esi
cmp dword [ebp - 0x840], 0
jne 0x42814a
lea eax, [ebp - 0x818]
mov dword [esp + 4], ebx
mov dword [esp], eax
jmp 0x428078
mov eax, dword [ebp - 0x874]
inc esi
mov dword [esp], eax
call sub.msvcrt.dll_wcslen
mov edx, edi
lea ecx, [ebp - 0x818]
mov word [edi], 0
sub edx, ecx
sar edx, 1
add edx, eax
mov dword [ebp + esi*4 - 0x82c], edx
cmp esi, 4
jne 0x4280d4
jmp 0x4280fd
mov eax, dword [ebp + esi*4 - 0x82c]
add eax, eax
cmp dword [ebp + esi*4 - 0x840], 0
lea eax, [ebp + eax - 0x818]
je 0x428185
mov ecx, dword [ebp - 0x878]
mov dword [esp + 8], eax
inc esi
mov dword [esp + 4], 0x4a0444
mov dword [esp + 0xc], ecx
mov dword [esp], ebx
call sub.msvcrt.dll_fwprintf_s
jmp 0x42814a
mov dword [esp + 8], eax
mov dword [esp + 4], 0x4a044e
mov dword [esp], ebx
call sub.msvcrt.dll_fwprintf_s
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x860], eax
jmp 0x42807d
xor esi, esi
mov dword [ebp - 0x864], esi
xor ebx, ebx
mov dword [ebp - 0x85c], ebx
xor ecx, ecx
xor ebx, ebx
mov dword [ebp - 0x860], ecx
mov eax, dword [ebp - 0x870]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
test ebx, ebx
je 0x4281db
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
cmp dword [ebp - 0x860], 0
je 0x4282df
cmp dword [ebp - 0x85c], 0
je 0x4282f7
cmp dword [ebp - 0x868], 0
je 0x4282e8
mov eax, dword [ebp - 0x85c]
mov ebx, dword [sym.imp.msvcrt.dll__wfopen]
mov dword [esp + 4], 0x49fd6e
mov dword [esp], eax
call ebx
mov dword [esp + 4], 0x4a0328
mov esi, eax
mov eax, dword [ebp - 0x868]
mov dword [esp], eax
call ebx
mov ebx, eax
test esi, esi
je 0x4282ab
test eax, eax
je 0x4282ab
xor eax, eax
cmp dword [ebp - 0x864], 2
sete al
mov edi, eax
inc edi
lea eax, [ebp - 0x84e]
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.msvcrt.dll_fread
dec eax
jne 0x428299
cmp dword [ebp + 0x18], 0
je 0x428279
cmp byte [ebp - 0x84e], 0xd
je 0x428249
lea eax, [ebp - 0x84e]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], edi
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
jmp 0x428249
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
jmp 0x4282e8
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 esi, esi
je 0x4282c7
mov dword [esp], esi
jmp 0x4282d8
test ebx, ebx
jne 0x4282d5
xor eax, eax
mov dword [ebp - 0x860], eax
jmp 0x4282e8
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
jmp 0x4282cb
cmp dword [ebp - 0x85c], 0
je 0x4282f7
mov eax, dword [ebp - 0x85c]
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__wunlink]
mov eax, dword [ebp - 0x868]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x85c]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x86c]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x874]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [ebp - 0x878]
mov dword [esp], eax
call sub.msvcrt.dll_free
jmp 0x428362
xor edi, edi
mov dword [ebp - 0x860], edi
jmp 0x428362
xor eax, eax
mov dword [ebp - 0x860], eax
mov dword [ebp - 0x864], eax
mov dword [ebp - 0x85c], eax
jmp 0x4281db
mov eax, dword [ebp - 0x860]
add esp, 0x87c
pop ebx
pop esi
pop edi
pop ebp
ret