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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x134
push ebx
xor ebx, ebx
cmp dword [0x40facc], ebx
push esi
push edi
mov edi, 0x104
je 0x405102
mov eax, dword [0x40fad0]
cmp eax, 0x10
jb 0x405091
mov eax, dword [0x40f060]
jmp 0x405098
mov eax, dword [eax*4 + 0x40f05c]
mov ecx, dword [0x40fa3c]
mov byte [ecx], bl
lea ecx, [ebp - 8]
push ecx
push 0x20019
push ebx
push dword [0x40facc]
push eax
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4050e5
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], edi
push eax
lea eax, [ebp - 0x10]
push dword [0x40fa3c]
push eax
push ebx
push dword [0x40fac8]
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [0x40fa3c]
cmp byte [eax], bl
je 0x4051ab
push eax
push dword [0x40fa44]
call fcn.00407ec0
pop ecx
pop ecx
jmp 0x405162
cmp dword [0x40fac4], ebx
je 0x4051ab
cmp dword [0x40fac0], ebx
je 0x4051ab
cmp dword [0x40fabc], ebx
je 0x4051ab
push dword [0x40fa44]
push dword [0x40fa3c]
call fcn.00407ec0
pop ecx
pop ecx
push dword [0x40fac4]
push edi
push dword [0x40fa44]
push dword [0x40fa3c]
push dword [0x40fabc]
push dword [0x40fac0]
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
test eax, eax
je 0x4051ab
mov eax, dword [0x40fa44]
cmp byte [eax], bl
je 0x4052b8
push eax
call fcn.00407fd7
test eax, eax
pop ecx
je 0x405192
push dword [0x40fa44]
call fcn.00407e40
pop ecx
mov ecx, dword [0x40fa44]
mov byte [eax + ecx - 1], bl
jmp 0x405162
mov eax, dword [0x40fa44]
cmp byte [eax], bl
je 0x4052b8
push eax
call fcn.004052bd
pop ecx
jmp 0x4052b8
mov eax, dword [0x40fa44]
cmp byte [eax], 0x23
jne 0x4052b8
inc eax
push 0x23
push eax
call fcn.004084b0
mov esi, eax
pop ecx
cmp esi, ebx
pop ecx
je 0x4052b8
mov al, byte [esi + 1]
inc esi
push str.Windows
mov byte [ebp - 1], al
mov byte [esi], bl
push dword [0x40fa44]
mov byte [ebp - 0x134], bl
call fcn.00408110
pop ecx
test eax, eax
pop ecx
jne 0x405203
lea eax, [ebp - 0x134]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
jmp 0x405280
push str.System
push dword [0x40fa44]
call fcn.00408110
pop ecx
test eax, eax
pop ecx
jne 0x405229
lea eax, [ebp - 0x134]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
jmp 0x405280
push str.Program_Files
push dword [0x40fa44]
call fcn.00408110
pop ecx
test eax, eax
pop ecx
jne 0x405280
lea eax, [ebp - 8]
push eax
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
lea eax, [ebp - 0xc]
mov dword [ebp - 0x10], ebx
push eax
lea eax, [ebp - 0x134]
push eax
lea eax, [ebp - 0x10]
push eax
push ebx
push str.ProgramFilesDir
mov dword [ebp - 0xc], edi
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov al, byte [ebp - 1]
cmp al, 0x5c
mov byte [esi], al
jne 0x40528a
inc esi
lea eax, [ebp - 0x134]
push eax
call fcn.0040605d
lea eax, [ebp - 0x134]
push esi
push eax
call fcn.00407ed0
lea eax, [ebp - 0x134]
push eax
push dword [0x40fa44]
call fcn.00407ec0
add esp, 0x14
pop edi
pop esi
pop ebx
leave
ret