Function at 0x4289c7
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], 0x4a2ef6
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 0x428e2e
cmp dword [ebp + 8], 0
je 0x428e2e
xor eax, eax
mov dword [ebp - 0x82c], eax
mov eax, dword [ebp + 8]
cmp byte [eax], 0
je 0x428e4d
cmp byte [esi], 0
je 0x428e4d
mov eax, dword [ebp + 0x10]
cmp byte [eax], 0
je 0x428e4d
mov eax, dword [ebp + 8]
call fcn.0042747a
mov dword [ebp - 0x830], eax
test eax, eax
jne 0x428a5f
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
jmp 0x428a74
mov eax, esi
call fcn.0042747a
mov dword [ebp - 0x838], eax
test eax, eax
jne 0x428a93
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 - 0x83c], edx
mov dword [ebp - 0x838], edx
jmp 0x428e38
mov eax, dword [ebp + 0x10]
call fcn.0042747a
mov dword [ebp - 0x83c], eax
test eax, eax
jne 0x428ab5
mov eax, dword [ebp + 0x10]
mov dword [esp], str.Could_not_convert__s_to_UTF_16
mov dword [esp + 4], eax
jmp 0x428ae0
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 0x428aea
mov eax, dword [ebp + 8]
mov dword [esp], str.Could_not_open_file__s_n
mov dword [esp + 4], eax
call fcn.0043efa9
jmp 0x428e38
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 0x428b31
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.0043efa9
xor eax, eax
mov dword [ebp - 0x834], eax
jmp 0x428cb8
mov dword [ebp - 0x834], 1
mov eax, dword [ebp - 0x828]
cmp ax, 0xbbef
je 0x428b59
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 0x428ba3
mov dword [esp], str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.0043efa9
jmp 0x428cb8
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 0x428c64
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 0x428cb8
mov dword [esp], ecx
mov dword [esp + 4], 0x4a33b8
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 0x428c8e
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 0x428c03
jmp 0x428cc2
call sub.msvcrt.dll_fputws
mov eax, dword [ebp - 0x83c]
mov dword [esp + 4], 0x4a2fae
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 0x428c64
xor ecx, ecx
xor esi, esi
mov dword [ebp - 0x82c], ecx
mov dword [esp], edi
call sub.msvcrt.dll_fclose
test esi, esi
je 0x428cd6
mov dword [esp], esi
call sub.msvcrt.dll_fclose
cmp dword [ebp - 0x82c], 0
je 0x428ded
test ebx, ebx
je 0x428dfa
cmp dword [ebp - 0x830], 0
je 0x428df1
mov esi, dword [sym.imp.msvcrt.dll__wfopen]
mov dword [esp + 4], 0x4a2a0e
mov dword [esp], ebx
call esi
mov dword [esp + 4], 0x4a2fc8
mov edi, eax
mov eax, dword [ebp - 0x830]
mov dword [esp], eax
call esi
mov esi, eax
test edi, edi
je 0x428db9
test eax, eax
je 0x428db9
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 0x428da7
cmp dword [ebp + 0x14], 0
je 0x428d7b
cmp byte [ebp - 0x826], 0xd
je 0x428d3f
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 0x428d3f
mov dword [esp], edi
call sub.msvcrt.dll_fclose
mov dword [esp], esi
call sub.msvcrt.dll_fclose
jmp 0x428df1
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 edi, edi
je 0x428dd5
mov dword [esp], edi
jmp 0x428de6
test esi, esi
jne 0x428de3
xor esi, esi
mov dword [ebp - 0x82c], esi
jmp 0x428df1
mov dword [esp], esi
call sub.msvcrt.dll_fclose
jmp 0x428dd9
test ebx, ebx
je 0x428dfa
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 0x428e4d
xor ebx, ebx
mov dword [ebp - 0x82c], ebx
jmp 0x428e4d
xor eax, eax
xor ebx, ebx
mov dword [ebp - 0x82c], eax
mov dword [ebp - 0x834], eax
jmp 0x428cd6
mov eax, dword [ebp - 0x82c]
add esp, 0x84c
pop ebx
pop esi
pop edi
pop ebp
ret