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

Disassembly:
sub esp, 0xa34
mov eax, dword [0x437164]
xor eax, esp
mov dword [esp + 0xa30], eax
push ebx
push ebp
push esi
push edi
xor ebx, ebx
push 0x206
lea eax, [esp + 0x226]
push ebx
push eax
mov ebp, ecx
mov word [esp + 0x22c], bx
call fcn.00408700
push 0x206
lea ecx, [esp + 0x2a]
push ebx
push ecx
mov word [esp + 0x30], bx
call fcn.00408700
add esp, 0x18
push ebx
push 0x2b
lea edx, [esp + 0x228]
push edx
push ebx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea edi, [esp + 0x220]
add edi, 0xfffffffe
jmp 0x4060a0
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x4060a0
mov edx, dword [0x42d65c]
lea eax, [esp + 0x220]
mov dword [edi], edx
add eax, 0xfffffffe
mov edi, edi
mov cx, word [eax + 2]
add eax, 2
cmp cx, bx
jne 0x4060c0
mov ecx, dword [str.GSInput]
mov dword [eax], ecx
mov ecx, dword [0x42d5f8]
mov dword [eax + 4], ecx
mov ecx, dword [0x42d5fc]
mov dword [eax + 8], ecx
mov ecx, dword [0x42d600]
lea edi, [esp + 0x220]
mov dword [eax + 0xc], ecx
add edi, 0xfffffffe
lea esp, [esp]
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x406100
lea eax, [esp + 0x220]
mov dword [edi], edx
add eax, 0xfffffffe
jmp 0x406120
mov cx, word [eax + 2]
add eax, 2
cmp cx, bx
jne 0x406120
mov edx, dword [str.gswb]
mov ecx, dword [0x42d654]
mov dword [eax], edx
mov dx, word [0x42d658]
mov dword [eax + 4], ecx
mov word [eax + 8], dx
lea eax, [esp + 0x220]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
cmp cx, bx
jne 0x406152
mov ecx, dword [str..ini]
mov edx, dword [0x42d648]
mov edi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov dword [eax], ecx
mov cx, word [0x42d64c]
mov dword [eax + 4], edx
lea edx, [esp + 0x220]
push edx
push 0x104
mov word [eax + 8], cx
lea eax, [esp + 0x20]
push eax
push 0x42d3b8
push str.CfgRootPath
push str.Globals
call edi
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea ecx, [esp + 0x18]
push ecx
call esi
test eax, eax
je 0x4061e6
lea eax, [esp + 0x18]
lea edx, [eax + 2]
jmp 0x4061c0
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4061c0
sub eax, edx
sar eax, 1
push eax
lea edx, [esp + 0x1c]
push edx
lea ecx, [ebp + 0x38]
call fcn.00401f70
mov byte [ebp + 0x18], 1
jmp 0x406388
push 0x206
lea eax, [esp + 0x42e]
push ebx
push eax
mov word [esp + 0x434], bx
call fcn.00408700
add esp, 0xc
xor eax, eax
jmp 0x406210
movzx ecx, word [eax + str.SOFTWARE_]
mov word [esp + eax + 0x428], cx
add eax, 2
cmp cx, bx
jne 0x406210
lea eax, [esp + 0x428]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
cmp cx, bx
jne 0x406231
mov ecx, dword [str.GSInput]
mov edx, dword [0x42d5f8]
mov dword [eax], ecx
mov ecx, dword [0x42d5fc]
mov dword [eax + 4], edx
mov edx, dword [0x42d600]
mov dword [eax + 8], ecx
mov dword [eax + 0xc], edx
lea eax, [esp + 0x10]
push eax
push 0xf003f
push ebx
lea ecx, [esp + 0x434]
push ecx
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4062d6
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x1c]
push eax
push ebx
push ebx
push str.CfgRootPath
push ecx
mov dword [esp + 0x2c], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x4062d6
lea edx, [esp + 0x18]
push edx
call esi
test eax, eax
je 0x4062d6
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea ecx, [esp + 0x18]
push ecx
lea ecx, [ebp + 0x38]
call fcn.004021b0
mov byte [ebp + 0x18], 1
jmp 0x406388
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x104
lea eax, [esp + 0x83c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [esp + 0x838]
push 0x5c
push ecx
call fcn.004085e0
push 0x206
lea edx, [esp + 0x63e]
push ebx
mov word [eax + 2], bx
push edx
mov word [esp + 0x644], bx
call fcn.00408700
lea eax, [esp + 0x84c]
push eax
lea ecx, [esp + 0x648]
push str._sSoftApp.ini
push ecx
call fcn.00408610
add esp, 0x20
lea edx, [esp + 0x630]
push edx
push 0x104
lea eax, [esp + 0x20]
push eax
push 0x42d3b8
push str.CfgRootPath
push str.AppInfo
call edi
lea ecx, [esp + 0x18]
push ecx
call esi
test eax, eax
je 0x406385
lea eax, [esp + 0x18]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x406375
jmp 0x4061cb
mov byte [ebp + 0x18], bl
mov ecx, dword [esp + 0xa40]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004086c2
add esp, 0xa34
ret