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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x848
mov eax, dword [0x4f22ec]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0x818], 0x4d6b54
mov ecx, dword [0x4fad90]
mov eax, edx
mov dword [ebp - 0x830], eax
mov dword [ebp - 0x838], ecx
mov dword [ebp - 0x814], 0x4d6b58
mov dword [ebp - 0x810], str.w__ccsUTF_16LE
mov dword [ebp - 0x820], 0
mov dword [ebp - 0x83c], 0
mov dword [ebp - 0x81c], 0
mov dword [ebp - 0x844], 0
mov dword [ebp - 0x840], 0
mov dword [ebp - 0x82c], 0
push edi
test ecx, ecx
je 0x420bfb
test esi, esi
je 0x420bfb
test eax, eax
je 0x420bfb
cmp byte [ecx], 0
je 0x420bfb
cmp byte [esi], 0
je 0x420bfb
cmp byte [eax], 0
je 0x420bfb
mov edi, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push 0
push 0
push 0xffffffffffffffff
push ecx
push 0
push 0xfde9
call edi
mov ebx, eax
cmp ebx, 1
jle 0x420611
push 2
push ebx
call fcn.0049570f
add esp, 8
mov dword [ebp - 0x828], eax
test eax, eax
je 0x420611
push ebx
push eax
push 0xffffffffffffffff
push dword [ebp - 0x838]
push 0
push 0xfde9
call edi
cmp eax, ebx
je 0x420633
mov edi, dword [ebp - 0x828]
push edi
call fcn.004998ec
add esp, 4
push dword [ebp - 0x838]
mov dword [ebp - 0x828], 0
push str.Could_not_convert__s_to_UTF_16
call fcn.004407e0
add esp, 8
jmp 0x420bac
cmp byte [esi], 0
jne 0x420667
push 2
push 1
call fcn.0049570f
mov ebx, eax
add esp, 8
mov dword [ebp - 0x820], ebx
test ebx, ebx
jne 0x4206d6
push esi
push str.Could_not_convert__s_to_UTF_16
call fcn.004407e0
add esp, 8
jmp 0x420bac
push 0
push 0
push 0xffffffffffffffff
push esi
push 0
push 0xfde9
call edi
mov ebx, eax
cmp ebx, 1
jle 0x4206b3
push 2
push ebx
call fcn.0049570f
add esp, 8
mov dword [ebp - 0x820], eax
test eax, eax
je 0x4206b3
push ebx
push eax
push 0xffffffffffffffff
push esi
push 0
push 0xfde9
call edi
cmp eax, ebx
je 0x4206d0
push dword [ebp - 0x820]
call fcn.004998ec
add esp, 4
push esi
push str.Could_not_convert__s_to_UTF_16
mov dword [ebp - 0x820], 0
call fcn.004407e0
add esp, 8
jmp 0x420bac
mov ebx, dword [ebp - 0x820]
mov eax, dword [ebp - 0x830]
cmp byte [eax], 0
jne 0x420739
push 2
push 1
call fcn.0049570f
mov esi, eax
add esp, 8
mov dword [ebp - 0x81c], esi
test esi, esi
je 0x420794
mov edi, dword [ebp - 0x828]
push str.r__ccsUNICODE
push edi
call fcn.00499a7f
mov esi, eax
add esp, 8
mov dword [ebp - 0x824], esi
test esi, esi
jne 0x4207ac
push dword [ebp - 0x838]
push str.Could_not_open_file__s_n
call fcn.004407e0
add esp, 8
jmp 0x420bac
push 0
push 0
push 0xffffffffffffffff
push eax
push 0
push 0xfde9
call edi
mov esi, eax
cmp esi, 1
jle 0x42078a
push 2
push esi
call fcn.0049570f
add esp, 8
mov dword [ebp - 0x81c], eax
test eax, eax
je 0x42078a
push esi
push eax
push 0xffffffffffffffff
push dword [ebp - 0x830]
push 0
push 0xfde9
call edi
cmp eax, esi
je 0x4206fd
push dword [ebp - 0x81c]
call fcn.004998ec
add esp, 4
mov dword [ebp - 0x81c], 0
push dword [ebp - 0x830]
push str.Could_not_convert__s_to_UTF_16
call fcn.004407e0
add esp, 8
jmp 0x420bac
push esi
push 1
lea eax, [ebp - 0x844]
push 2
push eax
call fcn.004a2a0d
add esp, 0x10
cmp eax, 1
jne 0x420801
movzx eax, word [ebp - 0x844]
cmp eax, 0xbbef
je 0x4207ea
xor edx, edx
mov ecx, 2
cmp eax, 0xfeff
cmovne ecx, edx
mov dword [ebp - 0x840], ecx
jmp 0x4207f4
mov dword [ebp - 0x840], 1
push 0
push 0
push esi
call fcn.004a3516
add esp, 0xc
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x420806
sub ecx, edx
sar ecx, 1
push 2
lea eax, [ecx + 2]
push eax
call fcn.0049570f
mov edx, eax
add esp, 8
mov dword [ebp - 0x83c], edx
test edx, edx
jne 0x420847
push str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.004407e0
add esp, 4
push esi
call fcn.00499b6b
jmp 0x420ba9
mov ecx, edi
sub edx, ecx
jmp 0x420850
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x420850
mov edi, dword [ebp - 0x83c]
mov ecx, edi
lea edx, [ecx + 2]
jmp 0x420870
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x420870
sub ecx, edx
mov eax, 0x7e
sar ecx, 1
mov word [edi + ecx*2], ax
mov eax, dword [ebp - 0x840]
push dword [ebp + eax*4 - 0x818]
push edi
call fcn.00499a7f
mov edi, eax
add esp, 8
test edi, edi
jne 0x4208c2
push dword [ebp - 0x838]
push str.Could_not_open_temporary_output_file__s_n
call fcn.004407e0
push esi
call fcn.00499b6b
add esp, 0xc
jmp 0x420b9e
push esi
lea eax, [ebp - 0x80c]
push 0x400
push eax
call fcn.004a381b
add esp, 0xc
test eax, eax
je 0x420a2a
nop
lea eax, [ebp - 0x80c]
push 0x4cafe4
push eax
call fcn.004a3aa8
mov esi, eax
lea edx, [ebp - 0x80c]
movzx eax, word [edx + esi*2]
add esp, 8
lea edx, [edx + esi*2]
cmp eax, 0x3b
je 0x4209e6
cmp eax, 0x5b
je 0x4209e6
mov ecx, ebx
lea eax, [ecx + 2]
mov dword [ebp - 0x820], eax
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x420920
sub ecx, dword [ebp - 0x820]
sar ecx, 1
push ecx
push ebx
push edx
call fcn.004a3bfd
add esp, 0xc
test eax, eax
jne 0x4209e6
mov ecx, ebx
lea edx, [ecx + 2]
jmp 0x420950
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x420950
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 esi, eax
add esp, 8
lea eax, [ebp - 0x80c]
cmp word [ebp + esi*2 - 0x80c], 0x3d
jne 0x4209ec
inc esi
push 0x4cafe4
lea eax, [eax + esi*2]
push eax
call fcn.004a3aa8
add eax, esi
add esp, 8
add eax, eax
cmp eax, 0x800
jae 0x420c0e
xor ecx, ecx
mov word [ebp + eax - 0x80c], cx
lea eax, [ebp - 0x80c]
push edi
push eax
call fcn.004a31ed
mov esi, dword [ebp - 0x81c]
push esi
push 0x4d6c10
push edi
call fcn.00412f60
mov eax, dword [ebp - 0x830]
add esp, 0x14
mov dword [ebp - 0x82c], eax
jmp 0x4209fc
lea eax, [ebp - 0x80c]
push edi
push eax
call fcn.004a31ed
mov esi, dword [ebp - 0x81c]
add esp, 8
push dword [ebp - 0x824]
lea eax, [ebp - 0x80c]
push 0x400
push eax
call fcn.004a381b
add esp, 0xc
test eax, eax
jne 0x4208e0
mov eax, dword [ebp - 0x82c]
test eax, eax
je 0x420a30
jmp 0x420a46
mov esi, dword [ebp - 0x81c]
push esi
push ebx
push str._s___s_n
push edi
call fcn.00412f60
mov eax, dword [ebp - 0x830]
add esp, 0x10
mov dword [ebp - 0x82c], eax
mov eax, dword [ebp - 0x824]
push eax
call fcn.00499b6b
add esp, 4
push edi
call fcn.00499b6b
add esp, 4
mov dword [ebp - 0x830], ebx
mov dword [ebp - 0x824], esi
push 0x4d6638
push dword [ebp - 0x83c]
call fcn.00499a7f
mov edi, dword [ebp - 0x828]
mov esi, eax
push 0x4d6c2c
push edi
call fcn.00499a7f
add esp, 0x10
mov edi, eax
test esi, esi
je 0x420b49
test edi, edi
je 0x420b49
mov eax, dword [ebp - 0x824]
xor ebx, ebx
cmp dword [ebp - 0x840], 2
push esi
sete bl
mov dword [ebp - 0x81c], eax
mov eax, dword [ebp - 0x830]
inc ebx
push 1
mov dword [ebp - 0x820], eax
lea eax, [ebp - 0x834]
push ebx
push eax
call fcn.004a2a0d
add esp, 0x10
cmp eax, 1
jne 0x420b38
mov eax, dword [ebp - 0x82c]
mov dword [ebp - 0x82c], eax
mov eax, dword [ebp - 0x824]
mov dword [ebp - 0x81c], eax
mov eax, dword [ebp - 0x830]
mov dword [ebp - 0x820], eax
lea esp, [esp]
push edi
push 1
lea eax, [ebp - 0x834]
push ebx
push eax
call fcn.004a3a45
push esi
push 1
lea eax, [ebp - 0x834]
push ebx
push eax
call fcn.004a2a0d
add esp, 0x20
cmp eax, 1
je 0x420b10
push esi
call fcn.00499b6b
add esp, 4
push edi
call fcn.00499b6b
jmp 0x420b9b
push dword [ebp - 0x838]
push str.Could_not_write__s___original_file_has_been_left_unmodified_n
call fcn.004407e0
add esp, 8
mov dword [ebp - 0x82c], 0
test esi, esi
je 0x420b73
push esi
call fcn.00499b6b
add esp, 4
mov esi, dword [ebp - 0x824]
mov dword [ebp - 0x81c], esi
mov dword [ebp - 0x820], ebx
test edi, edi
je 0x420b9e
push edi
call fcn.00499b6b
mov dword [ebp - 0x81c], esi
mov dword [ebp - 0x820], ebx
add esp, 4
push dword [ebp - 0x83c]
call fcn.004a3d44
add esp, 4
push dword [ebp - 0x828]
call fcn.004998ec
add esp, 4
push dword [ebp - 0x83c]
call fcn.004998ec
add esp, 4
push dword [ebp - 0x820]
call fcn.004998ec
add esp, 4
push dword [ebp - 0x81c]
call fcn.004998ec
mov eax, dword [ebp - 0x82c]
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
call fcn.00491a70
int3