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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x424
mov eax, dword [0x421018]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, ecx
mov dword [ebp - 0x420], edi
lea ebx, [edi + 0x2d1a]
test esi, esi
je 0x404717
xor eax, eax
cmp ax, word [esi]
je 0x404717
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp eax, 2
jl 0x40465f
movzx eax, word [esi + 2]
mov ecx, 0x3a
cmp cx, ax
je 0x404643
mov ecx, 0x5c
cmp cx, word [esi]
jne 0x40465f
cmp cx, ax
jne 0x40465f
push 0x104
push esi
push ebx
mov dword [edi + 0x2f24], 2
call dword [sym.imp.KERNEL32.dll_lstrcpynW]
jmp 0x40483c
lea eax, [edi + 0x2b10]
push eax
mov dword [edi + 0x2f24], 1
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
jne 0x404692
pop edi
pop esi
mov eax, 0x210000d5
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040939c
mov esp, ebp
pop ebp
ret 4
lea eax, [edi + 0x2b10]
push eax
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push 0x5c
push 0
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.SHLWAPI.dll_StrRChrW]
test eax, eax
jne 0x4046e1
push 0x2f
push eax
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.SHLWAPI.dll_StrRChrW]
test eax, eax
jne 0x4046e1
push 1
lea edx, [ebp - 0x210]
call fcn.004076a0
add esp, 4
jmp 0x4046e6
xor ecx, ecx
mov word [eax], cx
push esi
lea edx, [ebp - 0x210]
mov ecx, ebx
call fcn.004075f0
add esp, 4
test eax, eax
jne 0x40483c
pop edi
pop esi
mov eax, 0x210000d1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040939c
mov esp, ebp
pop ebp
ret 4
mov dword [edi + 0x2f24], 0
xor eax, eax
mov ecx, 0x82
mov edi, ebx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov edi, dword [ebp - 0x420]
lea eax, [edi + 0x2b10]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
mov dword [ebp - 0x424], eax
test eax, eax
je 0x404830
xor eax, eax
mov word [ebp - 0x210], ax
lea eax, [ebp - 0x210]
push eax
push 0xf4
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov esi, eax
test esi, esi
je 0x4047b8
push 0x104
lea eax, [ebp - 0x41c]
push eax
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
mov edi, eax
lea ecx, [edi - 1]
cmp ecx, 0x102
ja 0x4047b4
cmp edi, 0xf4
jae 0x4047b4
lea eax, [ebp - 0x41c]
push eax
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov esi, edi
test esi, esi
jne 0x4047ca
push str.c:_temp_
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenW]
lea eax, [ebp - 0x210]
push eax
call edi
push dword [ebp - 0x424]
call edi
mov esi, eax
lea eax, [ebp - 0x210]
push eax
call edi
add eax, 2
add eax, esi
cmp eax, 0x104
jg 0x40482a
push dword [ebp - 0x424]
lea edx, [ebp - 0x210]
mov ecx, ebx
call fcn.004075f0
add esp, 4
test eax, eax
je 0x40482a
push str..temp
push ebx
call dword [sym.imp.SHLWAPI.dll_PathRenameExtensionW]
mov edi, dword [ebp - 0x420]
test eax, eax
jne 0x40483c
jmp 0x404830
mov edi, dword [ebp - 0x420]
push 0
mov edx, ebx
call fcn.004076a0
add esp, 4
test ebx, ebx
je 0x40485e
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40485e
shr eax, 4
and al, 1
je 0x40485e
push ebx
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryEmptyW]
test eax, eax
je 0x404865
or dword [edi + 0x2f24], 0x10
push ebx
mov ecx, edi
call fcn.00405370
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.0040939c
mov esp, ebp
pop ebp
ret 4