Function at 0x4045f2
Capabilities:
Get common file path

Disassembly:
push 0x254
mov eax, 0x420986
call fcn.0040c90a
xor esi, esi
mov edi, edx
mov dword [ebp - 0x25c], edi
mov dword [ebp - 0x254], ecx
cmp ecx, esi
je 0x404890
mov eax, dword [ecx + 0x14]
cmp eax, esi
je 0x404624
mov al, byte [eax]
jmp 0x404627
mov al, byte [ecx + 0x18]
test al, al
je 0x404890
mov eax, ecx
call fcn.004072ae
mov ebx, eax
lea eax, [ebp - 0x234]
call fcn.00401bf0
mov dword [ebp - 4], esi
lea eax, [ebp - 0x250]
call fcn.00401bf0
mov byte [ebp - 4], 1
push ebx
call dword [sym.imp.SHLWAPI.dll_PathIsFileSpecW]
add edi, 0xd4
test eax, eax
je 0x4046b2
push edi
push esi
push esi
push 0x8023
push esi
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov eax, edi
lea ecx, [eax + 2]
mov dx, word [eax]
add eax, 2
cmp dx, si
jne 0x40467a
sub eax, ecx
sar eax, 1
mov ecx, edi
lea esi, [ebp - 0x234]
call fcn.00401407
mov eax, ebx
lea ecx, [eax + 2]
mov dx, word [eax]
add eax, 2
test dx, dx
jne 0x40469b
sub eax, ecx
mov ecx, ebx
lea esi, [ebp - 0x250]
jmp 0x404708
push ebx
push 0x104
push edi
call fcn.0040b527
add esp, 0xc
push edi
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
mov ecx, eax
lea edx, [eax + 2]
mov si, word [eax]
add eax, 2
test si, si
jne 0x4046cd
sub eax, edx
sar eax, 1
lea esi, [ebp - 0x250]
call fcn.00401407
push edi
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
mov eax, edi
lea ecx, [eax + 2]
mov dx, word [eax]
add eax, 2
test dx, dx
jne 0x4046f3
sub eax, ecx
mov ecx, edi
lea esi, [ebp - 0x234]
sar eax, 1
call fcn.00401407
mov ebx, dword [ebp - 0x254]
test dword [ebx + 0x10], 0x20000
je 0x40479b
cmp dword [ebp - 0x23c], 8
mov ecx, dword [ebp - 0x250]
jae 0x404733
lea ecx, [ebp - 0x250]
cmp dword [ebp - 0x220], 8
mov eax, dword [ebp - 0x234]
jae 0x404748
lea eax, [ebp - 0x234]
push edi
push 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
je 0x40479b
push 0x104
lea eax, [ebp - 0x218]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
je 0x40479b
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x40479b
lea esi, [eax + 4]
lea eax, [ebp - 0x218]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x404781
sub eax, edx
sar eax, 1
lea ecx, [ebp - 0x218]
call fcn.00401407
mov eax, ebx
call fcn.004072ae
mov ebx, eax
push ebx
call fcn.0040b101
pop ecx
mov esi, 0x40000000
test eax, eax
je 0x40482f
mov eax, dword [ebp - 0x254]
test dword [eax + 0x10], 0x10000
je 0x4047cf
xor eax, eax
push eax
push 0x80
push 2
jmp 0x4047d9
xor eax, eax
push eax
push 0x80
push 4
push eax
push eax
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x258], eax
cmp eax, 0xffffffff
je 0x40482f
lea eax, [ebp - 0x260]
push eax
push edi
push 0x104
push 0
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_SearchPathW]
mov ebx, dword [ebp - 0x254]
test eax, eax
je 0x404821
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x404821
add eax, 4
push edi
push eax
call fcn.00401482
push dword [ebp - 0x258]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x404835
mov ebx, dword [ebp - 0x254]
test dword [ebx + 0xc], esi
je 0x404862
mov ecx, dword [ebp - 0x25c]
mov edx, ebx
call fcn.00404363
test dword [ebx + 0x10], 0x100000
je 0x404862
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push dword [ebp - 0x25c]
call fcn.004042e7
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x40486e
mov byte [eax], 0
jmp 0x404872
mov byte [ebx + 0x18], 0
mov byte [ebp - 4], 0
lea esi, [ebp - 0x250]
call fcn.00401075
or dword [ebp - 4], 0xffffffff
lea esi, [ebp - 0x234]
call fcn.00401075
call fcn.0040c98d
ret