Function at 0x40e21a
Capabilities:
Get common file path
Get startup folder
Query or enumerate registry value
Read .ini file

Disassembly:
push 0xc58
mov eax, 0x59c25d
call fcn.005693c7
mov edi, ecx
mov eax, dword [ebp + 8]
lea ecx, [ebp - 0xc58]
mov esi, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x10]
and dword [ebp - 0xc48], 0
mov dword [ebp - 0xc60], eax
xor eax, eax
push eax
push 0x5a06d8
mov dword [ebp - 0xc44], 7
mov word [ebp - 0xc58], ax
call fcn.00403772
and dword [ebp - 4], 0
lea eax, [ebp - 0x420]
push 0x208
push 0
push eax
call fcn.0056f390
push 0x208
lea eax, [ebp - 0x830]
push 0
push eax
call fcn.0056f390
push 0x208
lea eax, [ebp - 0x628]
push 0
push eax
call fcn.0056f390
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.0056f390
push 0x208
lea eax, [ebp - 0xc40]
push 0
push eax
call fcn.0056f390
add esp, 0x3c
lea eax, [ebp - 0x420]
push 0
push 0x2b
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea eax, [ebp - 0x420]
push 0x5a0a50
push eax
call fcn.00578f16
push dword [ebp - 0xc60]
lea eax, [ebp - 0x420]
push eax
call fcn.00578f16
lea eax, [ebp - 0x420]
push 0x5a0a50
push eax
call fcn.00578f16
lea eax, [ebp - 0x420]
push esi
push eax
call fcn.00578f16
lea eax, [ebp - 0x420]
push str..ini
push eax
call fcn.00578f16
add esp, 0x28
lea eax, [ebp - 0x420]
push eax
push 0x104
lea eax, [ebp - 0x830]
push eax
push 0x5a06d8
push str.InstallPath
push str.Globals
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [ebp - 0x830]
push eax
call fcn.00578706
pop ecx
test eax, eax
jle 0x40e398
lea eax, [ebp - 0x830]
push eax
lea eax, [ebp - 0x218]
push eax
call fcn.00578f87
pop ecx
pop ecx
push ebx
lea eax, [ebp - 0x218]
mov ecx, edi
push eax
call fcn.004108f5
test eax, eax
jne 0x40e4d5
push 0x208
lea eax, [ebp - 0xa38]
push 0
push eax
call fcn.0056f390
lea eax, [ebp - 0xa38]
push 0x5a0b60
push eax
call fcn.00578f87
mov esi, dword [ebp - 0xc60]
lea eax, [ebp - 0xa38]
push esi
push eax
call fcn.00578f16
add esp, 0x1c
lea eax, [ebp - 0xc5c]
push eax
push 0x20019
push 0
lea eax, [ebp - 0xa38]
push eax
push reloc.WS2_32.dll_bind
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40e45d
lea eax, [ebp - 0xc64]
mov dword [ebp - 0xc64], 0x104
push eax
lea eax, [ebp - 0xc40]
push eax
push 0
push 0
push str.InstallPath
push dword [ebp - 0xc5c]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40e45d
lea eax, [ebp - 0xc40]
push eax
lea eax, [ebp - 0x218]
push eax
call fcn.00578f87
pop ecx
pop ecx
push ebx
lea eax, [ebp - 0x218]
mov ecx, edi
push eax
call fcn.004108f5
test eax, eax
je 0x40e45d
push dword [ebp - 0xc5c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x40e4d5
push dword [ebp - 0xc5c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0
push 0x26
lea eax, [ebp - 0x628]
mov ecx, edi
push eax
push 0
call fcn.00410c25
lea eax, [ebp - 0x628]
push 0x5a0a50
push eax
call fcn.00578f16
lea eax, [ebp - 0x628]
push esi
push eax
call fcn.00578f16
lea eax, [ebp - 0x628]
push 0x5a0a50
push eax
call fcn.00578f16
lea eax, [ebp - 0x628]
push eax
lea eax, [ebp - 0x218]
push eax
call fcn.00578f87
add esp, 0x20
lea eax, [ebp - 0x218]
mov ecx, edi
push ebx
push eax
call fcn.004108f5
test eax, eax
je 0x40e508
cmp word [ebp - 0x218], 0
jne 0x40e4e3
xor eax, eax
jmp 0x40e4f0
lea eax, [ebp - 0x218]
push eax
call fcn.00578706
pop ecx
push eax
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0xc58]
call fcn.00403772
xor esi, esi
inc esi
jmp 0x40e50a
xor esi, esi
push 0
push 1
lea ecx, [ebp - 0xc58]
call fcn.00403628
mov eax, esi
call fcn.00569382
ret 0xc