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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x844
mov eax, dword [0x4f22ec]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
xor esi, esi
mov dword [ebp - 0x830], ecx
mov dword [ebp - 0x820], eax
mov dword [ebp - 0x814], 0x4d6b54
mov dword [ebp - 0x810], 0x4d6b58
mov dword [ebp - 0x80c], str.w__ccsUTF_16LE
mov dword [ebp - 0x828], 0
mov dword [ebp - 0x818], 0
mov dword [ebp - 0x840], esi
mov dword [ebp - 0x81c], esi
push edi
test ecx, ecx
je 0x421794
test eax, eax
je 0x421794
cmp byte [ecx], 0
je 0x421794
cmp byte [eax], 0
je 0x421794
mov edi, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push esi
push esi
push 0xffffffffffffffff
push ecx
push esi
push 0xfde9
call edi
mov ebx, eax
cmp ebx, 1
jle 0x42126a
push 2
push ebx
call fcn.0049570f
add esp, 8
mov dword [ebp - 0x824], eax
test eax, eax
je 0x42126a
push ebx
push eax
push 0xffffffffffffffff
push dword [ebp - 0x830]
push esi
push 0xfde9
call edi
cmp eax, ebx
je 0x421288
push dword [ebp - 0x824]
call fcn.004998ec
add esp, 4
push dword [ebp - 0x830]
mov dword [ebp - 0x824], esi
push str.Could_not_convert__s_to_UTF_16
call fcn.004407e0
add esp, 8
jmp 0x4214dc
push 0
push 0
push 0xffffffffffffffff
push str._SetupData_
push 0
push 0xfde9
call edi
mov ebx, eax
cmp ebx, 1
jle 0x4212dc
push 2
push ebx
call fcn.0049570f
add esp, 8
mov dword [ebp - 0x828], eax
test eax, eax
je 0x4212dc
push ebx
push eax
push 0xffffffffffffffff
push str._SetupData_
push 0
push 0xfde9
call edi
cmp eax, ebx
je 0x4212f9
push dword [ebp - 0x828]
call fcn.004998ec
add esp, 4
push str._SetupData_
push str.Could_not_convert__s_to_UTF_16
mov dword [ebp - 0x828], esi
call fcn.004407e0
add esp, 8
jmp 0x4214dc
mov eax, dword [ebp - 0x820]
cmp byte [eax], 0
jne 0x421348
push 2
push 1
call fcn.0049570f
mov esi, eax
add esp, 8
test esi, esi
je 0x421392
mov edi, dword [ebp - 0x824]
push str.r__ccsUNICODE
push edi
call fcn.00499a7f
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x4213aa
push dword [ebp - 0x830]
push str.Could_not_open_file__s_n
call fcn.004407e0
add esp, 8
jmp 0x4214dc
push 0
push 0
push 0xffffffffffffffff
push eax
push 0
push 0xfde9
call edi
mov ebx, eax
cmp ebx, 1
jle 0x421390
push 2
push ebx
call fcn.0049570f
mov esi, eax
add esp, 8
test esi, esi
je 0x421390
push ebx
push esi
push 0xffffffffffffffff
push dword [ebp - 0x820]
push 0
push 0xfde9
call edi
cmp eax, ebx
je 0x421316
push esi
call fcn.004998ec
add esp, 4
xor esi, esi
push dword [ebp - 0x820]
push str.Could_not_convert__s_to_UTF_16
call fcn.004407e0
add esp, 8
jmp 0x4214dc
push ebx
push 1
lea eax, [ebp - 0x840]
push 2
push eax
call fcn.004a2a0d
add esp, 0x10
cmp eax, 1
je 0x4213e1
push dword [ebp - 0x830]
push str.Could_not_read_file__s_n
call fcn.004407e0
push ebx
call fcn.00499b6b
add esp, 0xc
jmp 0x4214dc
movzx eax, word [ebp - 0x840]
cmp eax, 0xbbef
je 0x421406
xor edx, edx
mov ecx, 2
cmp eax, 0xfeff
cmovne ecx, edx
mov dword [ebp - 0x838], ecx
jmp 0x421410
mov dword [ebp - 0x838], 1
push 0
push 0
push 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 0x421422
sub ecx, edx
sar ecx, 1
push 2
lea eax, [ecx + 2]
push eax
call fcn.0049570f
add esp, 8
mov dword [ebp - 0x818], eax
test eax, eax
jne 0x42145e
push str.Could_not_allocate_space_for_temporary_output_name_n
call fcn.004407e0
add esp, 4
push ebx
call fcn.00499b6b
jmp 0x4214d9
mov edx, eax
mov ecx, edi
sub edx, edi
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x421464
mov edx, dword [ebp - 0x818]
mov ecx, edx
lea edi, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x421480
sub ecx, edi
mov eax, 0x7e
sar ecx, 1
mov word [edx + ecx*2], ax
mov eax, dword [ebp - 0x838]
push dword [ebp + eax*4 - 0x814]
push edx
call fcn.00499a7f
mov edi, eax
add esp, 8
test edi, edi
jne 0x421526
push dword [ebp - 0x830]
push str.Could_not_open_temporary_output_file__s_n
call fcn.004407e0
push ebx
call fcn.00499b6b
add esp, 0xc
mov eax, dword [ebp - 0x818]
push eax
call fcn.004a3d44
add esp, 4
push dword [ebp - 0x824]
call fcn.004998ec
add esp, 4
push dword [ebp - 0x818]
call fcn.004998ec
add esp, 4
push dword [ebp - 0x828]
call fcn.004998ec
add esp, 4
push esi
call fcn.004998ec
mov eax, dword [ebp - 0x81c]
add esp, 4
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00491940
mov esp, ebp
pop ebp
ret
push ebx
lea eax, [ebp - 0x808]
push 0x400
push eax
call fcn.004a381b
add esp, 0xc
test eax, eax
je 0x4215f2
lea eax, [ebp - 0x808]
push 0x4cafe4
push eax
call fcn.004a3aa8
mov dword [ebp - 0x82c], eax
add esp, 8
mov eax, dword [ebp - 0x828]
mov edx, eax
lea ecx, [edx + 2]
mov dword [ebp - 0x83c], ecx
mov edi, edi
mov cx, word [edx]
add edx, 2
test cx, cx
jne 0x421570
sub edx, dword [ebp - 0x83c]
lea ecx, [ebp - 0x808]
sar edx, 1
push edx
push eax
mov eax, dword [ebp - 0x82c]
lea eax, [ecx + eax*2]
push eax
call fcn.004a3bfd
add esp, 0xc
test eax, eax
lea eax, [ebp - 0x808]
push edi
push eax
je 0x4215b3
call fcn.004a31ed
add esp, 8
jmp 0x4215d3
call fcn.004a31ed
push esi
push 0x4d6c10
push edi
call fcn.00412f60
mov eax, dword [ebp - 0x820]
add esp, 0x14
mov dword [ebp - 0x81c], eax
push ebx
lea eax, [ebp - 0x808]
push 0x400
push eax
call fcn.004a381b
add esp, 0xc
test eax, eax
jne 0x421543
jmp 0x421614
mov eax, dword [ebp - 0x818]
mov dword [ebp - 0x818], eax
mov eax, dword [ebp - 0x838]
mov dword [ebp - 0x838], eax
mov dword [ebp - 0x81c], 0
push ebx
call fcn.00499b6b
mov eax, dword [ebp - 0x81c]
add esp, 4
mov ebx, dword [ebp - 0x818]
mov dword [ebp - 0x820], esi
mov dword [ebp - 0x81c], eax
push edi
mov dword [ebp - 0x82c], ebx
call fcn.00499b6b
mov ecx, dword [ebp - 0x81c]
add esp, 4
mov eax, ebx
mov dword [ebp - 0x818], eax
test ecx, ecx
je 0x421789
push 0x4d6638
push ebx
call fcn.00499a7f
push 0x4d6c2c
push dword [ebp - 0x824]
mov edi, eax
call fcn.00499a7f
add esp, 0x10
mov ebx, eax
mov dword [ebp - 0x83c], ebx
test edi, edi
je 0x421731
test ebx, ebx
je 0x421731
mov eax, dword [ebp - 0x82c]
xor ebx, ebx
cmp dword [ebp - 0x838], 2
push edi
sete bl
mov dword [ebp - 0x818], eax
push 1
inc ebx
lea eax, [ebp - 0x834]
push ebx
push eax
call fcn.004a2a0d
add esp, 0x10
cmp eax, 1
jne 0x421715
mov eax, dword [ebp - 0x82c]
mov dword [ebp - 0x818], eax
mov eax, dword [ebp - 0x81c]
mov dword [ebp - 0x82c], esi
mov esi, dword [ebp - 0x83c]
mov dword [ebp - 0x81c], eax
push esi
push 1
lea eax, [ebp - 0x834]
push ebx
push eax
call fcn.004a3a45
push edi
push 1
lea eax, [ebp - 0x834]
push ebx
push eax
call fcn.004a2a0d
add esp, 0x20
cmp eax, 1
je 0x4216e7
mov esi, dword [ebp - 0x82c]
push edi
call fcn.00499b6b
add esp, 4
push dword [ebp - 0x83c]
call fcn.00499b6b
add esp, 4
jmp 0x4214cd
push dword [ebp - 0x830]
push str.Could_not_write__s___original_file_has_been_left_unmodified_n
call fcn.004407e0
add esp, 8
mov dword [ebp - 0x81c], 0
test edi, edi
je 0x42175b
push edi
call fcn.00499b6b
add esp, 4
mov edi, dword [ebp - 0x82c]
mov esi, dword [ebp - 0x820]
mov dword [ebp - 0x818], edi
test ebx, ebx
je 0x4214cd
push ebx
call fcn.00499b6b
add esp, 4
mov dword [ebp - 0x818], edi
jmp 0x4214cd
mov dword [ebp - 0x81c], ecx
jmp 0x4214d3
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00491940
mov esp, ebp
pop ebp
ret