Function at 0x40afd7
Capabilities:
Check if file exists
Get common file path
Get file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x550
and dword [ebp - 4], 0
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_lstrcpyA]
push edi
push dword [ebp + 8]
lea eax, [ebp - 0x208]
push eax
call esi
mov ebx, str..
push ebx
lea eax, [ebp - 0x550]
push eax
call esi
lea eax, [ebp - 0x208]
push 0x2a
push eax
call fcn.004025e3
test eax, eax
pop ecx
pop ecx
jne 0x40b030
lea eax, [ebp - 0x208]
push 0x3f
push eax
call fcn.004025e3
test eax, eax
pop ecx
pop ecx
je 0x40b05e
lea eax, [ebp - 0x208]
push eax
call fcn.00401ec6
pop ecx
lea ecx, [ebp - 0x208]
cmp eax, ecx
jbe 0x40b05e
lea edi, [eax - 1]
push edi
lea eax, [ebp - 0x550]
push eax
mov dword [ebp - 4], 1
call esi
mov byte [edi], 0
lea eax, [ebp - 0x208]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp eax, 4
jl 0x40b2b7
push pe_nt_image_headers32
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x208]
push eax
call edi
test eax, eax
je 0x40b2b7
push 0x104
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x208]
push eax
call edi
test eax, eax
je 0x40b2b7
mov eax, dword [0x418b08]
test eax, eax
je 0x40b0e9
push eax
lea eax, [ebp - 0x208]
push eax
call edi
test eax, eax
je 0x40b2b7
mov eax, dword [0x418b54]
cmp byte [eax], 0
je 0x40b105
push eax
lea eax, [ebp - 0x208]
push eax
call edi
test eax, eax
je 0x40b2b7
lea eax, [ebp - 0x208]
push eax
lea eax, [ebp - 0x108]
push eax
call esi
mov edi, dword [sym.imp.KERNEL32.dll_lstrcatA]
push ebx
lea eax, [ebp - 0x108]
push eax
call edi
lea eax, [ebp - 0x450]
push eax
lea eax, [ebp - 0x108]
push 0x17
push eax
call fcn.00401cc6
add esp, 0xc
mov ebx, 0x414474
jmp 0x40b1ae
test byte [ebp - 0x350], 0x10
je 0x40b1a1
cmp byte [ebp - 0x450], 0x2e
je 0x40b1a1
lea eax, [ebp - 0x208]
push eax
lea eax, [ebp - 0x108]
push eax
call esi
push ebx
lea eax, [ebp - 0x108]
push eax
call edi
lea eax, [ebp - 0x450]
push eax
lea eax, [ebp - 0x108]
push eax
call edi
lea eax, [ebp - 0x550]
push eax
lea eax, [ebp - 0x108]
push eax
call edi
push dword [ebp + 0xc]
lea eax, [ebp - 0x108]
push eax
call fcn.0040afd7
pop ecx
pop ecx
lea eax, [ebp - 0x450]
push eax
call fcn.00401d08
pop ecx
test eax, eax
je 0x40b144
lea eax, [ebp - 0x450]
push eax
call fcn.00401d45
cmp dword [ebp + 0xc], 0
pop ecx
je 0x40b2aa
lea eax, [ebp - 0x208]
push eax
lea eax, [ebp - 0x108]
push eax
call esi
cmp dword [ebp - 4], 0
jne 0x40b212
lea eax, [ebp - 0x208]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40b212
test al, 0x10
jne 0x40b212
lea eax, [ebp - 0x108]
push 0
push eax
call fcn.00401ca3
lea eax, [ebp - 0x108]
push eax
call fcn.00409691
add esp, 0xc
lea eax, [ebp - 0x550]
push eax
lea eax, [ebp - 0x108]
push eax
call edi
lea eax, [ebp - 0x450]
push eax
lea eax, [ebp - 0x108]
push 7
push eax
call fcn.00401cc6
add esp, 0xc
jmp 0x40b299
test byte [ebp - 0x350], 0x10
jne 0x40b28c
lea eax, [ebp - 0x208]
push eax
lea eax, [ebp - 0x108]
push eax
call esi
push ebx
lea eax, [ebp - 0x108]
push eax
call edi
lea eax, [ebp - 0x450]
push eax
lea eax, [ebp - 0x108]
push eax
call edi
lea eax, [ebp - 0x108]
push 0
push eax
call fcn.00401ca3
lea eax, [ebp - 0x108]
push eax
call fcn.00409691
add esp, 0xc
lea eax, [ebp - 0x450]
push eax
call fcn.00401d08
pop ecx
test eax, eax
je 0x40b23c
lea eax, [ebp - 0x450]
push eax
call fcn.00401d45
pop ecx
lea eax, [ebp - 0x208]
push eax
call fcn.0040302a
pop ecx
pop edi
pop esi
pop ebx
leave
ret