Function at 0x405f08
Capabilities:
Get common file path
Get program files directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x72c
mov eax, dword [0x4c6018]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push esi
dec ecx
push edi
mov esi, edx
cmp ecx, 7
ja case.default.0x405e34
jmp dword [ecx*4 + 0x4060d0]
push 0x104
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
lea eax, [ebp - 0x20c]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x405e56
sub eax, edx
mov edi, eax
lea eax, [ebp - 0x20c]
jmp 0x406084
push 0x104
lea ecx, [ebp - 0x310]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea eax, [ebp - 0x310]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x405e87
sub eax, edx
mov edi, eax
lea eax, [ebp - 0x310]
jmp 0x406084
call fcn.004090a0
test al, al
je 0x406089
push 0
push 0x25
lea edx, [ebp - 0x720]
push edx
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
cmp eax, 1
jne 0x406089
push esi
lea eax, [ebp - 0x720]
call fcn.00401ff0
jmp 0x406089
lea eax, [ebp - 0x414]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea eax, [ebp - 0x414]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x405ef2
sub eax, edx
mov edi, eax
lea eax, [ebp - 0x414]
jmp 0x406084
push 0
push 0x26
lea ecx, [ebp - 0x518]
push ecx
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
lea eax, [ebp - 0x518]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x405f24
sub eax, edx
mov edi, eax
lea eax, [ebp - 0x518]
jmp 0x406084
call fcn.004090a0
test al, al
je 0x406089
push 0x104
lea edx, [ebp - 0x61c]
push edx
push str._ProgramW6432_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
test eax, eax
je 0x406089
push esi
lea eax, [ebp - 0x61c]
call fcn.00401ff0
jmp 0x406089
cmp dword [eax + 0x14], 0x10
mov dword [ebp - 0x724], 0
jb 0x405f89
mov eax, dword [eax]
lea ecx, [ebp - 0x724]
push ecx
push 1
push 0
push eax
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x405fc3
mov edx, dword [ebp - 0x724]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00449013
mov esp, ebp
pop ebp
ret 8
lea eax, [ebp - 0x728]
push eax
mov eax, dword [ebp - 0x724]
lea ecx, [ebp - 0x108]
push ecx
lea edx, [ebp - 0x72c]
push edx
push 0
push str.Path
push eax
mov dword [ebp - 0x728], 0x104
mov dword [ebp - 0x72c], 1
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x406023
mov ecx, dword [ebp - 0x724]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00449013
mov esp, ebp
pop ebp
ret 8
push esi
lea eax, [ebp - 0x108]
call fcn.00401ff0
jmp 0x406089
push 0x104
lea edx, [ebp - 0x108]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
dec eax
js 0x40606a
cmp byte [ebp + eax - 0x108], 0x5c
je 0x40606a
dec eax
mov byte [ebp + eax - 0x107], 0
jns 0x406055
lea eax, [ebp - 0x108]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406073
sub eax, edx
mov edi, eax
lea eax, [ebp - 0x108]
call fcn.00402610
cmp dword [ebp + 0xc], 0
je 0x4060bb
push 1
mov eax, 0x4a3178
mov ecx, esi
call fcn.00409fe0
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00449013
mov esp, ebp
pop ebp
ret 8
xor edi, edi
mov eax, 0x4b98a0
call fcn.00402610
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.00449013
mov esp, ebp
pop ebp
ret 8