Function at 0x4221d4
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0xa83dc3
mov eax, dword fs:[0]
push eax
sub esp, 0x98
push ebx
push esi
push edi
mov eax, dword [0xac62f0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov eax, dword [ebp + 0xc]
lea ecx, [ebp - 0x6c]
mov byte [eax], 1
call fcn.0040dd30
lea ecx, [ebp - 0x44]
call fcn.00409d70
mov ebx, dword [ebp + 8]
push 0
push dword [ebx]
lea ecx, [ebp - 0x6c]
mov dword [ebp - 4], 0
call fcn.0040e1d0
test al, al
je 0x422349
mov eax, dword [edi + 0x48]
cmp eax, 2
je 0x4223d8
test eax, eax
jne 0x4221f3
mov ecx, ebx
call fcn.0040ab70
inc eax
push eax
lea eax, [ebp - 0x34]
push eax
mov ecx, ebx
call fcn.0041b4e0
lea ecx, [ebp - 0x44]
push ecx
push eax
lea eax, [ebp - 0x28]
push eax
mov byte [ebp - 4], 1
call fcn.0040a030
push dword [ebp - 0x34]
mov byte [ebp - 4], 3
call fcn.009fe809
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x50]
add esp, 4
cmp byte [edi + 0x3b], 0
mov dword [ebp - 0x10], eax
je 0x422154
lea esi, [edi + 0xd8]
jmp 0x422156
xor esi, esi
cmp byte [edi + 0xcb], 0
je 0x422167
lea edx, [edi + 0xc0]
jmp 0x422169
xor edx, edx
mov ecx, dword [edi + 0x50]
lea ebx, [ebp - 0x1c]
mov eax, dword [ecx]
push ebx
push esi
push edx
push dword [edi + 0x74]
lea edx, [ebp - 0x6c]
push edx
lea edx, [ebp - 0x14]
push edx
push dword [ebp - 0x28]
push ecx
call dword [eax + 0x14]
mov ebx, dword [ebp + 8]
mov esi, eax
test esi, esi
jne 0x42222b
mov eax, dword [ebp - 0x1c]
cmp eax, 5
ja case.default.0x42219f
jmp dword [eax*4 + 0x4223fc]
push dword [ebp - 0x28]
mov esi, 0x80004004
call fcn.009fe809
add esp, 4
jmp 0x4223da
mov dword [edi + 0x48], 2
push dword [ebp - 0x28]
xor esi, esi
call fcn.009fe809
add esp, 4
jmp 0x4223da
mov dword [edi + 0x48], 1
jmp case.0x42219f.0
mov dword [edi + 0x48], 3
push dword [ebp - 0x28]
mov byte [ebp - 4], 0
call fcn.009fe809
add esp, 4
mov eax, dword [edi + 0x48]
cmp eax, 3
jne 0x422247
push ebx
call fcn.0041c390
test al, al
jne 0x42223b
push ebx
push str.Cannot_create_file_with_auto_name
mov ecx, edi
call fcn.004240d0
mov esi, eax
test esi, esi
jne 0x4223da
mov esi, 0x80004005
jmp 0x4223da
mov esi, 0x80004005
push dword [ebp - 0x28]
call fcn.009fe809
add esp, 4
jmp 0x4223da
mov byte [edi + 0x174], 1
jmp 0x4223d2
cmp eax, 4
jne 0x4222e1
push ebx
lea ecx, [ebp - 0x18]
call fcn.00409bf0
lea eax, [ebp - 0x18]
push eax
mov byte [ebp - 4], 4
call fcn.0041c390
test al, al
jne 0x422291
push ebx
push str.Cannot_create_file_with_auto_name
mov ecx, edi
call fcn.004240d0
push dword [ebp - 0x18]
test eax, eax
mov esi, 0x80004005
cmovne esi, eax
call fcn.009fe809
add esp, 4
jmp 0x4223da
push dword [ebp - 0x18]
push dword [ebx]
call fcn.0040da20
test al, al
jne 0x4222d1
call fcn.0040ee30
push ebx
lea ecx, [ebp - 0x18]
push ecx
push str.Cannot_rename_existing_file
push eax
mov ecx, edi
call fcn.00423ff0
mov esi, eax
test esi, esi
jne 0x4222c1
mov esi, 0x80004005
push dword [ebp - 0x18]
call fcn.009fe809
add esp, 4
jmp 0x4223da
push dword [ebp - 0x18]
call fcn.009fe809
add esp, 4
jmp 0x4223d2
mov eax, dword [ebp - 0x4c]
push dword [ebx]
shr eax, 4
test al, 1
je 0x422316
call fcn.0040dae0
test al, al
jne 0x4223d2
push ebx
push str.Cannot_delete_output_folder
mov ecx, edi
call fcn.00424150
mov esi, eax
test esi, esi
jne 0x4223da
jmp 0x4223d8
call fcn.0040df80
test al, al
je 0x4223d2
push dword [ebx]
call fcn.0040d6f0
test al, al
jne 0x4223d2
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x4223d2
push ebx
push str.Cannot_delete_output_file
jmp 0x422300
push dword [ebx]
call fcn.0040f3d0
mov esi, eax
test esi, esi
js 0x4223d2
mov ecx, dword [ebx]
cmp word [ecx + esi*2 + 2], 0
je 0x4223d2
push ebx
lea ecx, [ebp - 0x18]
call fcn.00409bf0
mov byte [ebp - 4], 5
cmp esi, dword [ebp - 0x14]
jae 0x42237e
mov eax, dword [ebp - 0x18]
xor ecx, ecx
mov dword [ebp - 0x14], esi
mov word [eax + esi*2], cx
lea ecx, [ebp - 0xa4]
call fcn.0040dd30
lea ecx, [ebp - 0x7c]
call fcn.00409d70
push 0
push dword [ebp - 0x18]
lea ecx, [ebp - 0xa4]
mov byte [ebp - 4], 6
call fcn.0040e1d0
test al, al
je 0x4223bf
mov eax, dword [ebp - 0x84]
test al, 1
je 0x4223bf
and eax, 0xfffffffe
push eax
push dword [ebp - 0x18]
call fcn.0040dbb0
push dword [ebp - 0x7c]
call fcn.009fe809
push dword [ebp - 0x18]
call fcn.009fe809
add esp, 8
mov eax, dword [ebp + 0xc]
mov byte [eax], 0
xor esi, esi
push dword [ebp - 0x44]
call fcn.009fe809
add esp, 4
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8