Function at 0x412122
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x414
push ebx
push esi
mov eax, dword [ecx + 0x34]
push edi
mov dword [ecx + 0x2c], 1
mov esi, ecx
xor ebx, ebx
mov edx, dword [eax + 0x18]
mov ecx, dword [esi + 0x3c]
mov edi, dword [edx + ecx*4]
mov eax, dword [esi + 0x38]
add eax, 0x5b6
cmp byte [eax], 0
je 0x412174
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x412174
mov eax, dword [esi + 0x38]
add eax, 0x5b6
push eax
push eax
call fcn.0040c3be
add esp, 8
test eax, eax
je 0x41217a
inc ebx
cmp ebx, 5
jl 0x412145
mov eax, dword [esi + 0x38]
cmp byte [eax + 0x5b6], 0
je 0x4121ce
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x412190
mov eax, dword [edi + 0x10]
push 0x41f958
push eax
call fcn.00418af0
add esp, 8
test eax, eax
jne 0x4121ce
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x4121ac
mov eax, dword [edi + 0x10]
push eax
lea ecx, [ebp - 0x414]
mov eax, dword [esi + 0x38]
add eax, 0x5b6
push eax
push ecx
call fcn.0040c48f
mov byte [ebp - 0x311], 0
add esp, 0xc
jmp 0x4121ed
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x4121d8
mov eax, dword [edi + 0x10]
push 0x104
lea ecx, [ebp - 0x414]
push eax
push ecx
call fcn.0040b640
add esp, 0xc
xor edi, edi
push esi
call fcn.00401196
add esp, 4
mov eax, dword [esi + 0x30]
mov dword [ebp - 0x10], 0x401126
mov dword [ebp - 0xc], 3
lea ecx, [ebp - 0x414]
mov dword [ebp - 0x14], eax
mov eax, dword [esi + 0x38]
add eax, 0x5b6
push eax
push str.All_Files_._
push str.Save_file
push ecx
lea ecx, [ebp - 0x14]
call fcn.0040bfc6
push esi
mov dword [ebp - 4], eax
call fcn.00401214
add esp, 4
mov dword [esi + 0x20], edi
cmp dword [ebp - 4], edi
je 0x412374
mov eax, dword [esi + 0x34]
mov ecx, dword [esi + 0x3c]
mov edx, dword [eax + 0x18]
mov eax, dword [esi + 0x38]
add eax, 0x5b6
mov ebx, dword [edx + ecx*4]
push eax
lea ecx, [ebp - 0x414]
push ecx
call fcn.0040c3be
add esp, 8
lea ecx, [ebp - 0x414]
push ecx
push ecx
call fcn.0040c357
add esp, 8
mov eax, dword [ebx + 0xc]
test eax, eax
je 0x41228a
push eax
call fcn.004188b0
add esp, 4
lea eax, [ebp - 0x414]
push eax
call fcn.0041ad10
add esp, 4
mov dword [ebx + 0xc], eax
mov dword [ebx + 0x2c], 1
mov eax, dword [esi + 0x34]
mov dword [ebp - 8], edi
cmp dword [eax + 0x1c], edi
jle 0x412355
xor ebx, ebx
mov eax, dword [esi + 0x34]
mov edx, dword [eax + 0x18]
mov ecx, dword [edx + ebx]
cmp dword [ecx + 0x2c], 0
je 0x4122f8
mov eax, dword [ecx + 0xc]
test eax, eax
jne 0x4122cd
mov eax, dword [ecx + 0x10]
push eax
lea ecx, [ebp - 0x414]
mov eax, dword [esi + 0x38]
add eax, 0x5b6
push eax
push ecx
call fcn.0040c48f
add esp, 0xc
lea ecx, [ebp - 0x414]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x41230b
add ebx, 4
mov ecx, dword [esi + 0x34]
inc dword [ebp - 8]
mov eax, dword [ebp - 8]
cmp dword [ecx + 0x1c], eax
jg 0x4122b4
jmp 0x412355
mov ecx, dword [esi + 0x30]
push 0x31
mov eax, dword [ecx]
push str.Attention
push str.same_file_name_exists._r_nOverwrite_OK_
call dword [eax + 0x90]
dec eax
cmp eax, 1
sbb eax, eax
neg eax
mov dword [ebp - 4], eax
cmp eax, edi
jne 0x412355
xor ecx, ecx
mov eax, dword [esi + 0x34]
cmp dword [eax + 0x1c], edi
jle 0x412355
xor edx, edx
mov eax, dword [esi + 0x34]
inc ecx
mov ebx, dword [eax + 0x18]
mov eax, dword [ebx + edx]
add edx, 4
mov dword [eax + 0x2c], edi
mov eax, dword [esi + 0x34]
cmp dword [eax + 0x1c], ecx
jg 0x41233d
cmp dword [ebp - 4], edi
je 0x4121ef
push 1
mov ecx, dword [esi + 0x38]
call fcn.0040e6db
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
jmp 0x41236d