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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x880
mov eax, dword [0x4f22ec]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
mov ebx, ecx
mov dword [ebp - 0x840], 0x4d6b54
mov ecx, dword [ebp + 0xc]
mov eax, edx
xor edx, edx
mov dword [ebp - 0x85c], eax
mov dword [ebp - 0x86c], ebx
mov dword [ebp - 0x854], ecx
mov dword [ebp - 0x83c], 0x4d6b58
mov dword [ebp - 0x838], str.w__ccsUTF_16LE
mov dword [ebp - 0x844], 0
mov dword [ebp - 0x84c], 0
mov dword [ebp - 0x848], 0
mov dword [ebp - 0x850], 0
mov dword [ebp - 0x87c], 0
mov dword [ebp - 0x834], edx
mov dword [ebp - 0x830], edx
mov dword [ebp - 0x82c], edx
mov dword [ebp - 0x828], edx
mov dword [ebp - 0x824], edx
mov dword [ebp - 0x820], edx
mov dword [ebp - 0x81c], edx
mov dword [ebp - 0x818], edx
mov dword [ebp - 0x814], edx
mov dword [ebp - 0x810], edx
mov dword [ebp - 0x858], edx
push esi
push edi
mov edi, dword [ebp + 8]
test ebx, ebx
je 0x42214a
test eax, eax
je 0x42214a
test edi, edi
je 0x42214a
test ecx, ecx
je 0x42214a
cmp byte [ebx], dl
je 0x42214a
cmp byte [eax], dl
je 0x42214a
cmp byte [edi], dl
je 0x42214a
mov eax, edi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4218d0
test dl, dl
je 0x4218cc
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4218d0
add eax, 2
add ecx, 2
test dl, dl
jne 0x4218b0
xor eax, eax
jmp 0x4218d5
sbb eax, eax
or eax, 1
test eax, eax
je 0x42214a
mov esi, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push 0
push 0
push 0xffffffffffffffff
push ebx
push 0
push 0xfde9
call esi
mov ebx, eax
cmp ebx, 1
jle 0x421934
push 2
push ebx
call fcn.0049570f
add esp, 8
mov dword [ebp - 0x864], eax
test eax, eax
je 0x421934
push ebx
push eax
push 0xffffffffffffffff
push dword [ebp - 0x86c]
push 0
push 0xfde9
call esi
cmp eax, ebx
je 0x421956
push dword [ebp - 0x864]
call fcn.004998ec
add esp, 4
push dword [ebp - 0x86c]
mov dword [ebp - 0x864], 0
push str.Could_not_convert__s_to_UTF_16
call fcn.004407e0
add esp, 8
jmp 0x4220ed
mov eax, dword [ebp - 0x85c]
cmp byte [eax], 0
jne 0x421a0d
push 2
push 1
call fcn.0049570f
mov ebx, eax
add esp, 8
mov dword [ebp - 0x844], ebx
test ebx, ebx
je 0x421a6c
cmp byte [edi], 0
jne 0x421a84
push 2
push 1
call fcn.0049570f
mov ebx, eax
add esp, 8
mov dword [ebp - 0x848], ebx
test ebx, ebx
je 0x421ade
mov eax, dword [ebp - 0x854]
cmp byte [eax], 0
jne 0x421af1
push 2
push 1
call fcn.0049570f
mov ebx, eax
add esp, 8
mov dword [ebp - 0x850], ebx
test ebx, ebx
je 0x421b4d
mov edi, dword [ebp - 0x864]
push str.r__ccsUNICODE
push edi
call fcn.00499a7f
mov esi, eax
add esp, 8
mov dword [ebp - 0x868], esi
test esi, esi
jne 0x421b65
push dword [ebp - 0x86c]
push str.Could_not_open_file__s_n
call fcn.004407e0
add esp, 8
jmp 0x4220ed
push 0
push 0
push 0xffffffffffffffff
push eax
push 0
push 0xfde9
call esi
mov ebx, eax
cmp ebx, 1
jle 0x421a62
push 2
push ebx
call fcn.0049570f
add esp, 8
mov dword [ebp - 0x844], eax
test eax, eax
je 0x421a62
push ebx
push eax
push 0xffffffffffffffff
push dword [ebp - 0x85c]
push 0
push 0xfde9
call esi
cmp eax, ebx
je 0x421981
push dword [ebp - 0x844]
call fcn.004998ec
add esp, 4
mov dword [ebp - 0x844], 0
push dword [ebp - 0x85c]
push str.Could_not_convert__s_to_UTF_16
call fcn.004407e0
add esp, 8
jmp 0x4220ed
push 0
push 0
push 0xffffffffffffffff
push edi
push 0
push 0xfde9
call esi
mov ebx, eax
cmp ebx, 1
jle 0x421ad4
push 2
push ebx
call fcn.0049570f
add esp, 8
mov dword [ebp - 0x848], eax
test eax, eax
je 0x421ad4
push ebx
push eax
push 0xffffffffffffffff
push edi
push 0
push 0xfde9
call esi
cmp eax, ebx
je 0x4219a6
push dword [ebp - 0x848]
call fcn.004998ec
add esp, 4
mov dword [ebp - 0x848], 0
push edi
push str.Could_not_convert__s_to_UTF_16
call fcn.004407e0
add esp, 8
jmp 0x4220ed
push 0
push 0
push 0xffffffffffffffff
push eax
push 0
push 0xfde9
call esi
mov edi, eax
cmp edi, 1
jle 0x421b43
push 2
push edi
call fcn.0049570f
mov ebx, eax
mov dword [ebp - 0x850], eax
add esp, 8
test ebx, ebx
je 0x421b43
push edi
push ebx
push 0xffffffffffffffff
push dword [ebp - 0x854]
push 0
push 0xfde9
call esi
cmp eax, edi
je 0x4219d1
push ebx
call fcn.004998ec
add esp, 4
mov dword [ebp - 0x850], 0
push dword [ebp - 0x854]
push str.Could_not_convert__s_to_UTF_16
call fcn.004407e0
add esp, 8
jmp 0x4220ed
push esi
push 1
lea eax, [ebp - 0x87c]
push 2
push eax
call fcn.004a2a0d
add esp, 0x10
cmp eax, 1
je 0x421ba9
push esi
call fcn.004a3b56
add esp, 4
test eax, eax
jne 0x421b9e
push dword [ebp - 0x86c]
push str.Could_not_read_file__s_n
call fcn.004407e0
add esp, 8
push esi
call fcn.00499b6b
jmp 0x4220ea
movzx eax, word [ebp - 0x87c]
cmp eax, 0xbbef
je 0x421bc8
xor ecx, ecx
mov ebx, 2
cmp eax, 0xfeff
cmovne ebx, ecx
jmp 0x421bcd
mov ebx, 1
push 0
push 0
push esi
mov dword [ebp - 0x870], ebx
call fcn.004a3516
mov ecx, edi
add esp, 0xc
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x421be5
sub ecx, edx
sar ecx, 1
push 2
lea eax, [ecx + 2]
push eax
call fcn.0049570f
add esp, 8
mov dword [ebp - 0x84c], eax
test eax, eax
jne 0x421c24
push str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.004407e0
add esp, 4
push esi
call fcn.00499b6b
jmp 0x4220ea
mov edx, eax
mov ecx, edi
sub edx, edi
lea ebx, [ebx]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x421c30
mov ecx, dword [ebp - 0x84c]
lea edx, [ecx + 2]
lea esp, [esp]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x421c50
mov eax, dword [ebp - 0x84c]
sub ecx, edx
push dword [ebp + ebx*4 - 0x840]
sar ecx, 1
mov edx, 0x7e
push eax
mov word [eax + ecx*2], dx
call fcn.00499a7f
mov ebx, eax
add esp, 8
mov dword [ebp - 0x874], ebx
test ebx, ebx
jne 0x421ca8
push dword [ebp - 0x86c]
push str.Could_not_open_temporary_output_file__s_n
call fcn.004407e0
push esi
call fcn.00499b6b
add esp, 0xc
jmp 0x4220df
push esi
lea eax, [ebp - 0x80c]
push 0x400
push eax
call fcn.004a381b
add esp, 0xc
test eax, eax
je 0x421ea5
mov edi, dword [ebp - 0x844]
jmp 0x421cd0
lea eax, [ebp - 0x80c]
push 0x4cafe4
push eax
call fcn.004a3aa8
mov esi, eax
add esp, 8
mov eax, edi
lea edx, [eax + 2]
jmp 0x421cf0
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x421cf0
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x80c]
lea eax, [eax + esi*2]
push edi
push eax
call fcn.004a3bfd
add esp, 0xc
test eax, eax
je 0x421d2c
lea eax, [ebp - 0x80c]
push ebx
push eax
call fcn.004a31ed
add esp, 8
jmp 0x421e7a
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x421d31
sub ecx, edx
lea eax, [ebp - 0x80c]
sar ecx, 1
add esi, ecx
push 0x4cafe4
lea eax, [eax + esi*2]
push eax
call fcn.004a3aa8
add esp, 8
test eax, eax
jne 0x421d72
lea eax, [ebp - 0x80c]
push ebx
push eax
call fcn.004a31ed
add esp, 8
jmp 0x421e7a
mov ebx, dword [ebp - 0x848]
add esi, eax
mov dword [ebp - 0x820], 0
xor edi, edi
lea eax, [ebp - 0x80c]
lea eax, [eax + esi*2]
push ebx
push eax
call fcn.00492bcb
mov edx, eax
add esp, 8
mov dword [ebp + edi - 0x834], edx
test edx, edx
je 0x421de1
mov ecx, ebx
lea esi, [ecx + 2]
jmp 0x421db0
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x421db0
sub ecx, esi
lea eax, [ebp - 0x80c]
mov esi, edx
sar ecx, 1
sub esi, eax
xor eax, eax
sar esi, 1
add esi, ecx
mov word [edx], ax
mov dword [ebp + edi - 0x81c], esi
add edi, 4
cmp edi, 0x10
jb 0x421d86
cmp dword [ebp - 0x834], 0
mov ebx, dword [ebp - 0x874]
jne 0x421e02
lea eax, [ebp - 0x80c]
push ebx
push eax
call fcn.004a31ed
add esp, 8
jmp 0x421e74
xor esi, esi
xor eax, eax
jmp 0x421e10
mov eax, dword [ebp + eax - 0x820]
lea ecx, [ebp - 0x80c]
push dword [ebp - 0x850]
lea eax, [ecx + eax*2]
push eax
push 0x4d6d3c
push ebx
call fcn.00412f60
lea esi, [esi + 1]
add esp, 0x10
lea eax, [esi*4]
cmp dword [ebp + eax - 0x834], 0
jne 0x421e10
mov eax, dword [ebp + eax - 0x820]
lea ecx, [ebp - 0x80c]
lea eax, [ecx + eax*2]
push eax
push 0x4d6d48
push ebx
call fcn.00412f60
mov eax, dword [ebp - 0x854]
add esp, 0xc
mov dword [ebp - 0x858], eax
mov edi, dword [ebp - 0x844]
mov esi, dword [ebp - 0x868]
lea eax, [ebp - 0x80c]
push esi
push 0x400
push eax
call fcn.004a381b
add esp, 0xc
test eax, eax
jne 0x421cd0
mov ebx, dword [ebp - 0x858]
jmp 0x421ec5
mov eax, dword [ebp - 0x84c]
mov dword [ebp - 0x84c], eax
mov eax, dword [ebp - 0x870]
mov dword [ebp - 0x874], ebx
xor ebx, ebx
mov dword [ebp - 0x870], eax
push esi
call fcn.00499b6b
mov eax, dword [ebp - 0x850]
add esp, 4
mov esi, dword [ebp - 0x844]
mov edi, dword [ebp - 0x848]
mov dword [ebp - 0x858], ebx
push dword [ebp - 0x874]
mov ebx, dword [ebp - 0x84c]
mov dword [ebp - 0x878], esi
mov dword [ebp - 0x85c], edi
mov dword [ebp - 0x854], eax
mov dword [ebp - 0x868], ebx
call fcn.00499b6b
mov eax, dword [ebp - 0x858]
add esp, 4
mov dword [ebp - 0x848], edi
mov edi, dword [ebp - 0x854]
mov dword [ebp - 0x844], esi
mov dword [ebp - 0x850], edi
mov dword [ebp - 0x84c], ebx
test eax, eax
je 0x4220d9
push 0x4d6638
push ebx
call fcn.00499a7f
push 0x4d6c2c
push dword [ebp - 0x864]
mov esi, eax
call fcn.00499a7f
add esp, 0x10
mov edi, eax
test esi, esi
je 0x422052
test edi, edi
je 0x422052
mov eax, dword [ebp - 0x868]
xor ebx, ebx
cmp dword [ebp - 0x870], 2
mov dword [ebp - 0x84c], eax
mov eax, dword [ebp - 0x854]
sete bl
mov dword [ebp - 0x850], eax
inc ebx
mov eax, dword [ebp - 0x85c]
push esi
mov dword [ebp - 0x848], eax
mov eax, dword [ebp - 0x878]
push 1
mov dword [ebp - 0x844], eax
lea eax, [ebp - 0x860]
push ebx
push eax
call fcn.004a2a0d
add esp, 0x10
cmp eax, 1
jne 0x42203b
mov eax, dword [ebp - 0x868]
mov dword [ebp - 0x84c], eax
mov eax, dword [ebp - 0x858]
mov dword [ebp - 0x858], eax
mov eax, dword [ebp - 0x854]
mov dword [ebp - 0x850], eax
mov eax, dword [ebp - 0x85c]
mov dword [ebp - 0x848], eax
mov eax, dword [ebp - 0x878]
mov dword [ebp - 0x844], eax
cmp dword [ebp + 0x10], 0
je 0x422010
cmp byte [ebp - 0x860], 0xd
je 0x422023
push edi
push 1
lea eax, [ebp - 0x860]
push ebx
push eax
call fcn.004a3a45
add esp, 0x10
push esi
push 1
lea eax, [ebp - 0x860]
push ebx
push eax
call fcn.004a2a0d
add esp, 0x10
cmp eax, 1
je 0x422001
push esi
call fcn.00499b6b
add esp, 4
push edi
call fcn.00499b6b
add esp, 4
jmp 0x4220df
push dword [ebp - 0x86c]
push str.Could_not_write__s___original_file_has_been_left_unmodified._n
call fcn.004407e0
add esp, 8
mov dword [ebp - 0x858], 0
test esi, esi
je 0x42207c
push esi
call fcn.00499b6b
add esp, 4
mov eax, dword [ebp - 0x854]
mov esi, dword [ebp - 0x878]
mov dword [ebp - 0x850], eax
mov eax, dword [ebp - 0x85c]
mov dword [ebp - 0x84c], ebx
mov dword [ebp - 0x848], eax
mov dword [ebp - 0x844], esi
test edi, edi
je 0x4220df
push edi
call fcn.00499b6b
mov eax, dword [ebp - 0x854]
add esp, 4
mov dword [ebp - 0x850], eax
mov eax, dword [ebp - 0x85c]
mov dword [ebp - 0x84c], ebx
mov dword [ebp - 0x848], eax
mov dword [ebp - 0x844], esi
jmp 0x4220df
mov dword [ebp - 0x858], eax
push dword [ebp - 0x84c]
call fcn.004a3d44
add esp, 4
push dword [ebp - 0x864]
call fcn.004998ec
add esp, 4
push dword [ebp - 0x84c]
call fcn.004998ec
add esp, 4
push dword [ebp - 0x844]
call fcn.004998ec
add esp, 4
push dword [ebp - 0x848]
call fcn.004998ec
add esp, 4
push dword [ebp - 0x850]
call fcn.004998ec
mov eax, dword [ebp - 0x858]
add esp, 4
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00491940
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 8]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00491940
mov esp, ebp
pop ebp
ret