Function at 0x408277
Capabilities:
Check if file exists
Get common file path
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x224
mov eax, dword [0x41d0e8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
xor ebx, ebx
push edi
xor edi, edi
mov dword [ebp - 0x218], 0x104
inc edi
mov dword [ebp - 0x214], ebx
mov dword [ebp - 0x21c], 4
cmp dword [0x41d4ec], edi
jne 0x4084e4
test esi, esi
je 0x4084e4
lea eax, [ebp - 0x214]
mov edx, 0x4029b8
push eax
push 0x20019
push ecx
mov ecx, 0x80000001
call fcn.00405108
test eax, eax
jne 0x408320
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x220]
push eax
push ebx
push ebx
push 0x4029f0
push dword [ebp - 0x214]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x4084d0
push dword [ebp - 0x214]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 0x214], ebx
lea eax, [ebp - 0x210]
push eax
push ebx
push ebx
push 0x1a
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
js 0x4084d0
lea ecx, [ebp - 0x210]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x408343
sub ecx, edx
sar ecx, 1
cmp word [ebp + ecx*2 - 0x212], 0x5c
je 0x408382
push 0xffffffffffffffff
push 0x402a0c
lea eax, [ebp - 0x210]
push 0x104
push eax
call dword [sym.imp.msvcrt.dll_wcsncat_s]
add esp, 0x10
cmp eax, 0x50
je 0x4084d0
push 0xffffffffffffffff
lea eax, [ebp - 0x210]
push eax
push dword [ebp - 0x218]
push esi
call dword [sym.imp.msvcrt.dll_wcsncpy_s]
add esp, 0x10
cmp eax, 0x50
je 0x4084d0
push 0xffffffffffffffff
push 0x402a10
push dword [ebp - 0x218]
push esi
call dword [sym.imp.msvcrt.dll_wcsncat_s]
add esp, 0x10
cmp eax, 0x50
je 0x4084d0
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4083d6
mov edi, ebx
jmp 0x4084d0
push 0xffffffffffffffff
lea eax, [ebp - 0x210]
push eax
push dword [ebp - 0x218]
push esi
call dword [sym.imp.msvcrt.dll_wcsncpy_s]
add esp, 0x10
cmp eax, 0x50
je 0x4084d0
push 0xffffffffffffffff
push 0x402a58
push dword [ebp - 0x218]
push esi
call dword [sym.imp.msvcrt.dll_wcsncat_s]
add esp, 0x10
cmp eax, 0x50
je 0x4084d0
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4083cf
push 0xffffffffffffffff
lea eax, [ebp - 0x210]
push eax
push dword [ebp - 0x218]
push esi
call dword [sym.imp.msvcrt.dll_wcsncpy_s]
add esp, 0x10
cmp eax, 0x50
je 0x4084d0
push 0xffffffffffffffff
push 0x402a98
push dword [ebp - 0x218]
push esi
call dword [sym.imp.msvcrt.dll_wcsncat_s]
add esp, 0x10
cmp eax, 0x50
je 0x4084d0
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4083cf
lea eax, [ebp - 0x214]
mov edx, 0x402ad8
push eax
push 0x20019
push ecx
mov ecx, 0x80000001
call fcn.00405108
test eax, eax
jne 0x4084d0
lea eax, [ebp - 0x218]
push eax
push esi
push ebx
push ebx
push 0x402b3c
push dword [ebp - 0x214]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x4084be
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4083cf
push dword [ebp - 0x214]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 0x214], ebx
cmp dword [ebp - 0x214], ebx
je 0x4084e4
push dword [ebp - 0x214]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0041b570
leave
ret 8