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

Disassembly:
push 0x26c
mov eax, 0x5babb6
call fcn.0058ec94
and dword [ebp - 4], 0
mov eax, dword [ebp + 8]
and dword [ebp - 0x25c], 0
mov dword [ebp - 0x258], eax
mov eax, dword [ebp + 0xc]
push eax
lea esi, [ebp - 0x234]
mov dword [ebp - 0x254], eax
call fcn.0040820f
xor ebx, ebx
inc ebx
mov dword [ebp - 4], ebx
push ebx
mov esi, 0x682320
push esi
lea eax, [ebp - 0x234]
call fcn.00409be7
push ebx
mov edi, eax
push esi
lea eax, [ebp - 0x234]
call fcn.00409c91
cmp eax, 0xffffffff
je 0x404967
sub eax, edi
dec eax
push eax
inc edi
push edi
lea eax, [ebp - 0x278]
push eax
lea eax, [ebp - 0x234]
push eax
call fcn.00408405
mov byte [ebp - 4], 2
push 0xffffffffffffffff
push 0
lea ecx, [ebp - 0x234]
call fcn.00409acd
mov byte [ebp - 4], bl
push 0
push ebx
lea esi, [ebp - 0x278]
call fcn.00409da6
xor eax, eax
cmp dword [ebp - 0x21c], 8
mov word [ebp - 0x218], ax
mov eax, dword [ebp - 0x230]
jae 0x404985
lea eax, [ebp - 0x230]
mov edi, 0x104
push edi
lea ecx, [ebp - 0x218]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
jne 0x404b63
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x404b4c
lea eax, [ebp - 0x234]
push eax
lea esi, [ebp - 0x250]
call fcn.0040822e
mov byte [ebp - 4], 3
and dword [ebp - 0x254], 0
mov dword [ebp - 0x26c], 0x6810b8
mov dword [ebp - str.WA_DeleteOnClose], 0x6823a4
mov dword [ebp - 0x264], str..dll
mov dword [ebp - 0x260], str..com
cmp dword [ebp - 0x21c], 8
mov eax, dword [ebp - 0x230]
jae 0x404a0a
lea eax, [ebp - 0x230]
push eax
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.00582276
mov eax, dword [ebp - 0x254]
mov esi, dword [ebp + eax*4 - 0x26c]
push esi
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.0058216d
add esp, 0x18
push edi
lea eax, [ebp - 0x218]
push eax
push eax
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
jne 0x404b39
push edi
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push 0x6810d0
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.0058216d
mov eax, dword [ebp - 0x230]
add esp, 0xc
cmp dword [ebp - 0x21c], 8
jae 0x404a85
lea eax, [ebp - 0x230]
push eax
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.0058216d
push esi
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.0058216d
add esp, 0x18
lea ecx, [ebp - 0x218]
call fcn.00404738
test al, al
jne 0x404b39
push edi
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push 0x6810d0
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.0058216d
mov eax, dword [ebp - 0x230]
add esp, 0xc
cmp dword [ebp - 0x21c], 8
jae 0x404aef
lea eax, [ebp - 0x230]
push eax
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.0058216d
push esi
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.0058216d
add esp, 0x18
lea ecx, [ebp - 0x218]
call fcn.00404738
test al, al
jne 0x404b39
xor eax, eax
inc dword [ebp - 0x254]
cmp dword [ebp - 0x254], 3
mov word [ebp - 0x218], ax
jle 0x4049f5
mov byte [ebp - 4], bl
push 0
push ebx
lea esi, [ebp - 0x250]
call fcn.00409da6
jmp 0x404b63
push edi
push dword [ebp - 0x254]
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.005815d0
add esp, 0x10
mov esi, dword [ebp - 0x258]
lea eax, [ebp - 0x218]
push eax
call fcn.0040820f
mov dword [ebp - 0x25c], ebx
mov byte [ebp - 4], 0
push 0
push ebx
lea esi, [ebp - 0x234]
call fcn.00409da6
mov eax, dword [ebp - 0x258]
call fcn.0058ed17
ret