Function at 0x428e5e
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], 0x4a2ef6
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 0x42944d
test esi, esi
je 0x42944d
test ebx, ebx
je 0x42944d
cmp dword [ebp + 0x14], 0
je 0x42944d
xor eax, eax
mov dword [ebp - 0x860], eax
mov eax, dword [ebp + 8]
cmp byte [eax], 0
je 0x429470
cmp byte [esi], 0
je 0x429470
cmp byte [ebx], 0
je 0x429470
mov eax, dword [ebp + 0x14]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x429470
mov eax, dword [ebp + 8]
call fcn.0042747a
mov dword [ebp - 0x868], eax
test eax, eax
jne 0x428f2f
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
jmp 0x428f44
mov eax, esi
call fcn.0042747a
mov dword [ebp - 0x86c], eax
test eax, eax
jne 0x428f69
mov dword [esp + 4], esi
mov dword [esp], str.Could_not_convert__s_to_UTF_16
call fcn.0043efa9
xor edx, edx
mov dword [ebp - 0x878], edx
mov dword [ebp - 0x874], edx
mov dword [ebp - 0x86c], edx
jmp 0x429457
mov eax, ebx
call fcn.0042747a
mov dword [ebp - 0x874], eax
test eax, eax
jne 0x428f97
mov dword [esp + 4], ebx
mov dword [esp], str.Could_not_convert__s_to_UTF_16
call fcn.0043efa9
xor eax, eax
mov dword [ebp - 0x878], eax
jmp 0x429457
mov eax, dword [ebp + 0x14]
call fcn.0042747a
mov dword [ebp - 0x878], eax
test eax, eax
jne 0x428fb9
mov eax, dword [ebp + 0x14]
mov dword [esp], str.Could_not_convert__s_to_UTF_16
mov dword [esp + 4], eax
jmp 0x428fe8
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 0x428ff2
mov eax, dword [ebp + 8]
mov dword [esp], str.Could_not_open_file__s_n
mov dword [esp + 4], eax
call fcn.0043efa9
jmp 0x429457
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 0x429051
mov eax, dword [ebp - 0x870]
mov dword [esp], eax
call sub.msvcrt.dll_feof
mov dword [ebp - 0x864], eax
test eax, eax
jne 0x4292b5
mov eax, dword [ebp + 8]
mov dword [esp], str.Could_not_read_file__s_n
mov dword [esp + 4], eax
call fcn.0043efa9
jmp 0x4292bd
mov dword [ebp - 0x864], 1
mov eax, dword [ebp - 0x850]
cmp ax, 0xbbef
je 0x429079
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 0x4290cd
mov dword [esp], str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.0043efa9
jmp 0x4292c5
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 0x42918b
mov eax, dword [ebp + 8]
mov dword [esp], str.Could_not_open_temporary_output_file__s_n
mov dword [esp + 4], eax
call fcn.0043efa9
jmp 0x4292c5
mov dword [esp + 4], 0x4a33b8
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 0x4291b4
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 0x42913f
jmp 0x4292cf
mov eax, dword [ebp - 0x86c]
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
test eax, eax
je 0x42917f
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 0x429228
xor esi, esi
cmp dword [ebp - 0x840], 0
jne 0x429258
lea eax, [ebp - 0x818]
mov dword [esp + 4], ebx
mov dword [esp], eax
jmp 0x429186
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 0x4291e2
jmp 0x42920b
mov eax, dword [ebp + esi*4 - 0x82c]
add eax, eax
cmp dword [ebp + esi*4 - 0x840], 0
lea eax, [ebp + eax - 0x818]
je 0x429293
mov ecx, dword [ebp - 0x878]
mov dword [esp + 8], eax
inc esi
mov dword [esp + 4], 0x4a30e4
mov dword [esp + 0xc], ecx
mov dword [esp], ebx
call sub.msvcrt.dll_fwprintf_s
jmp 0x429258
mov dword [esp + 8], eax
mov dword [esp + 4], 0x4a30ee
mov dword [esp], ebx
call sub.msvcrt.dll_fwprintf_s
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x860], eax
jmp 0x42918b
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 0x4292e9
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
cmp dword [ebp - 0x860], 0
je 0x4293ed
cmp dword [ebp - 0x85c], 0
je 0x429405
cmp dword [ebp - 0x868], 0
je 0x4293f6
mov eax, dword [ebp - 0x85c]
mov ebx, dword [sym.imp.msvcrt.dll__wfopen]
mov dword [esp + 4], 0x4a2a0e
mov dword [esp], eax
call ebx
mov dword [esp + 4], 0x4a2fc8
mov esi, eax
mov eax, dword [ebp - 0x868]
mov dword [esp], eax
call ebx
mov ebx, eax
test esi, esi
je 0x4293b9
test eax, eax
je 0x4293b9
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 0x4293a7
cmp dword [ebp + 0x18], 0
je 0x429387
cmp byte [ebp - 0x84e], 0xd
je 0x429357
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 0x429357
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
jmp 0x4293f6
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.0043efa9
test esi, esi
je 0x4293d5
mov dword [esp], esi
jmp 0x4293e6
test ebx, ebx
jne 0x4293e3
xor eax, eax
mov dword [ebp - 0x860], eax
jmp 0x4293f6
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
jmp 0x4293d9
cmp dword [ebp - 0x85c], 0
je 0x429405
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 0x429470
xor edi, edi
mov dword [ebp - 0x860], edi
jmp 0x429470
xor eax, eax
mov dword [ebp - 0x860], eax
mov dword [ebp - 0x864], eax
mov dword [ebp - 0x85c], eax
jmp 0x4292e9
mov eax, dword [ebp - 0x860]
add esp, 0x87c
pop ebx
pop esi
pop edi
pop ebp
ret