Function at 0x408c90
Capabilities:
Check if file exists
Get common file path
Get program files directory
Query or enumerate registry value
Read .ini file

Disassembly:
sub esp, 0x628
mov eax, dword [0x464380]
xor eax, esp
mov dword [esp + 0x624], eax
push ebx
push ebp
push esi
push edi
xor ebp, ebp
push 0x206
lea eax, [esp + 0x22a]
push ebp
push eax
mov ebx, ecx
mov word [esp + 0x230], bp
call fcn.00413010
push 0x206
lea ecx, [esp + 0x2e]
push ebp
push ecx
mov word [esp + 0x34], bp
call fcn.00413010
add esp, 0x18
push ebp
push 0x2b
lea edx, [esp + 0x22c]
push edx
push ebp
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea edi, [esp + 0x224]
add edi, 0xfffffffe
jmp 0x408d00
mov ax, word [edi + 2]
add edi, 2
cmp ax, bp
jne 0x408d00
mov edx, dword [0x457494]
lea eax, [esp + 0x224]
mov dword [edi], edx
add eax, 0xfffffffe
mov edi, edi
mov cx, word [eax + 2]
add eax, 2
cmp cx, bp
jne 0x408d20
mov ecx, dword [0x457410]
mov dword [eax], ecx
mov ecx, dword [0x457414]
mov dword [eax + 4], ecx
mov ecx, dword [0x457418]
mov dword [eax + 8], ecx
mov ecx, dword [0x45741c]
mov dword [eax + 0xc], ecx
mov ecx, dword [0x457420]
mov dword [eax + 0x10], ecx
mov ecx, dword [0x457424]
lea edi, [esp + 0x224]
mov dword [eax + 0x14], ecx
add edi, 0xfffffffe
jmp 0x408d70
mov ax, word [edi + 2]
add edi, 2
cmp ax, bp
jne 0x408d70
lea eax, [esp + 0x224]
mov dword [edi], edx
add eax, 0xfffffffe
jmp 0x408d90
mov cx, word [eax + 2]
add eax, 2
cmp cx, bp
jne 0x408d90
mov edx, dword [str.ShanHu]
mov ecx, dword [0x457488]
mov dword [eax], edx
mov edx, dword [0x45748c]
mov dword [eax + 4], ecx
mov cx, word [0x457490]
mov dword [eax + 8], edx
mov word [eax + 0xc], cx
lea eax, [esp + 0x224]
add eax, 0xfffffffe
jmp 0x408dd0
mov cx, word [eax + 2]
add eax, 2
cmp cx, bp
jne 0x408dd0
mov edx, dword [str..ini]
mov ecx, dword [0x45747c]
mov dword [eax], edx
mov dx, word [0x457480]
mov dword [eax + 4], ecx
mov word [eax + 8], dx
lea eax, [esp + 0x224]
push eax
push 0x104
lea ecx, [esp + 0x24]
push ecx
push 0x4574ec
push str.InstallPath
push str.Globals
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea edx, [esp + 0x1c]
push edx
call esi
test eax, eax
je 0x408eb2
lea eax, [esp + 0x1c]
mov dword [ebx + 8], 1
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bp
jne 0x408e42
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0x20]
push eax
lea ecx, [ebx + 0x28]
call fcn.00408350
lea eax, [esp + 0x1c]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bp
jne 0x408e66
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x20]
push ecx
lea ecx, [ebx + 0x44]
call fcn.00408350
lea eax, [esp + 0x1c]
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
cmp cx, bp
jne 0x408e90
sub eax, edx
sar eax, 1
push eax
lea edx, [esp + 0x20]
push edx
lea ecx, [ebx + 0x60]
call fcn.00408350
jmp 0x409098
push 0x206
lea eax, [esp + 0x432]
push ebp
push eax
mov word [esp + 0x438], bp
call fcn.00413010
add esp, 0xc
xor eax, eax
jmp 0x408ee0
movzx ecx, word [eax + str.SOFTWARE_]
mov word [esp + eax + 0x42c], cx
add eax, 2
cmp cx, bp
jne 0x408ee0
lea eax, [esp + 0x42c]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
cmp cx, bp
jne 0x408f01
mov ecx, dword [0x457410]
mov edx, dword [0x457414]
mov dword [eax], ecx
mov ecx, dword [0x457418]
mov dword [eax + 4], edx
mov edx, dword [0x45741c]
mov dword [eax + 8], ecx
mov ecx, dword [0x457420]
mov dword [eax + 0xc], edx
mov edx, dword [0x457424]
mov dword [eax + 0x10], ecx
mov dword [eax + 0x14], edx
lea eax, [esp + 0x10]
push eax
push 0x20019
push ebp
lea ecx, [esp + 0x438]
push ecx
push reloc.WS2_32.dll_bind
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x408fcc
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x18]
push edx
lea eax, [esp + 0x20]
push eax
push ebp
push ebp
push str.InstallPath
push ecx
mov dword [esp + 0x30], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x408fcc
lea edx, [esp + 0x1c]
push edx
call esi
test eax, eax
je 0x408fcc
lea eax, [esp + 0x1c]
push eax
lea ecx, [ebx + 0x28]
mov dword [ebx + 8], 1
mov esi, 1
call fcn.00408520
lea ecx, [esp + 0x1c]
push ecx
lea ecx, [ebx + 0x44]
call fcn.00408520
lea edx, [esp + 0x1c]
push edx
lea ecx, [ebx + 0x60]
call fcn.00408520
jmp 0x408fce
mov esi, ebp
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp esi, ebp
jne 0x409098
push ebp
push 0x26
lea ecx, [esp + 0x24]
push ecx
push ebp
mov dword [ebx + 8], ebp
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea eax, [esp + 0x1c]
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
cmp cx, bp
jne 0x409000
sub eax, edx
sar eax, 1
push eax
lea edx, [esp + 0x20]
lea esi, [ebx + 0x44]
push edx
mov ecx, esi
call fcn.00408350
push 1
push 0x457494
mov ecx, esi
call fcn.00408250
push 0xffffffffffffffff
push ebp
lea eax, [ebx + 0xc]
push eax
mov ecx, esi
call fcn.00408140
push 1
push 0x457494
mov ecx, esi
call fcn.00408250
push 0xffffffffffffffff
push ebp
push esi
lea ecx, [ebx + 0x28]
call fcn.00408050
push 0xffffffffffffffff
push ebp
push esi
lea ecx, [ebx + 0x60]
call fcn.00408050
lea ecx, [esp + 0x224]
push ecx
call fcn.0040acb0
add esp, 4
cmp dword [esi + 0x18], 8
jb 0x40907c
mov esi, dword [esi + 4]
jmp 0x40907f
add esi, 4
lea edx, [esp + 0x224]
push edx
push esi
push str.InstallPath
push str.Globals
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
mov ecx, dword [esp + 0x634]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00412ff5
add esp, 0x628
ret