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

Disassembly:
mov eax, 0x1050
call fcn.0040a780
mov eax, dword [0x437164]
xor eax, esp
mov dword [esp + 0x104c], eax
push ebx
push ebp
push esi
push edi
xor esi, esi
push 0x206
lea eax, [esp + 0x63a]
push esi
push eax
mov dword [esp + 0x1c], ecx
mov word [esp + 0x640], si
call fcn.00408700
push 0x206
lea ecx, [esp + 0xc5e]
push esi
push ecx
mov word [esp + 0xc64], si
call fcn.00408700
push 0x206
lea edx, [esp + 0x85a]
push esi
push edx
mov word [esp + 0x860], si
call fcn.00408700
push 0x206
lea eax, [esp + 0xa6e]
push esi
push eax
mov word [esp + 0xa74], si
call fcn.00408700
push 0x206
lea ecx, [esp + 0x25a]
push esi
push ecx
mov word [esp + 0x260], si
call fcn.00408700
push 0x206
lea edx, [esp + 0x5e]
push esi
push edx
mov word [esp + 0x64], si
call fcn.00408700
mov ebp, dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
add esp, 0x48
push esi
push 0x2b
lea eax, [esp + 0x63c]
push eax
push esi
call ebp
lea edi, [esp + 0x634]
add edi, 0xfffffffe
nop
mov ax, word [edi + 2]
add edi, 2
cmp ax, si
jne 0x406b20
mov edx, dword [0x42d65c]
lea eax, [esp + 0x634]
mov dword [edi], edx
add eax, 0xfffffffe
mov edi, edi
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x406b40
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 + 0x634]
mov dword [eax + 0xc], ecx
add edi, 0xfffffffe
lea esp, [esp]
mov ax, word [edi + 2]
add edi, 2
cmp ax, si
jne 0x406b80
lea eax, [esp + 0x634]
mov dword [edi], edx
add eax, 0xfffffffe
jmp 0x406ba0
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x406ba0
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 + 0x634]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x406bd2
mov ecx, dword [str..ini]
mov edx, dword [0x42d648]
mov dword [eax], ecx
mov cx, word [0x42d64c]
mov dword [eax + 4], edx
lea edx, [esp + 0x634]
push edx
push 0x104
mov word [eax + 8], cx
lea eax, [esp + 0xc54]
push eax
push 0x42d3b8
push str.InstallPath
push str.Globals
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
xor eax, eax
jmp 0x406c30
movzx ecx, word [esp + eax + 0xc4c]
mov word [esp + eax + 0x224], cx
add eax, 2
cmp cx, si
jne 0x406c30
xor eax, eax
lea ebx, [ebx]
movzx ecx, word [esp + eax + 0x224]
mov word [esp + eax + 0x1c], cx
add eax, 2
cmp cx, si
jne 0x406c50
lea eax, [esp + 0x1c]
add eax, 0xfffffffe
lea esp, [esp]
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x406c70
mov ecx, dword [str.3.0.1.0512]
mov edx, dword [0x42d6fc]
mov dword [eax], ecx
mov ecx, dword [0x42d700]
mov dword [eax + 4], edx
mov edx, dword [0x42d704]
mov dword [eax + 8], ecx
mov ecx, dword [0x42d708]
mov dword [eax + 0xc], edx
mov dx, word [0x42d70c]
lea edi, [esp + 0x1c]
mov dword [eax + 0x10], ecx
mov word [eax + 0x14], dx
add edi, 0xfffffffe
lea ebx, [ebx]
mov ax, word [edi + 2]
add edi, 2
cmp ax, si
jne 0x406cc0
mov eax, dword [0x42d65c]
mov ebx, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea ecx, [esp + 0x1c]
push ecx
mov dword [edi], eax
call ebx
test eax, eax
je 0x406dd0
push 0x206
lea edx, [esp + 0x432]
push esi
push edx
mov word [esp + 0x438], si
call fcn.00408700
add esp, 0xc
xor eax, eax
jmp 0x406d10
movzx ecx, word [esp + eax + 0x1c]
mov word [esp + eax + 0x42c], cx
add eax, 2
cmp cx, si
jne 0x406d10
lea eax, [esp + 0x42c]
add eax, 0xfffffffe
nop
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x406d30
mov ecx, dword [str.Config.exe]
mov edx, dword [0x42d6e4]
mov dword [eax], ecx
mov ecx, dword [0x42d6e8]
mov dword [eax + 4], edx
mov edx, dword [0x42d6ec]
mov dword [eax + 8], ecx
mov ecx, dword [0x42d6f0]
mov dword [eax + 0xc], edx
mov dx, word [0x42d6f4]
mov dword [eax + 0x10], ecx
mov word [eax + 0x14], dx
lea eax, [esp + 0x42c]
push eax
call ebx
test eax, eax
je 0x406dd0
lea eax, [esp + 0x224]
lea edx, [eax + 2]
jmp 0x406d90
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x406d90
mov edi, dword [esp + 0x10]
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x228]
push ecx
lea ecx, [edi + 0x8c]
call fcn.00401f70
lea eax, [esp + 0x1c]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x406dc0
jmp 0x40756b
push 0x206
lea eax, [esp + 0xe5a]
push esi
push eax
mov word [esp + 0xe60], si
call fcn.00408700
add esp, 0xc
xor eax, eax
movzx ecx, word [eax + str.SOFTWARE_]
mov word [esp + eax + 0xe54], cx
add eax, 2
cmp cx, si
jne 0x406df0
lea eax, [esp + 0xe54]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x406e11
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 + 0x14]
push eax
push 0x20019
push esi
lea ecx, [esp + 0xe60]
push ecx
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40702f
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x18]
push edx
lea eax, [esp + 0xa48]
push eax
push esi
push esi
push str.InstallPath
push ecx
mov dword [esp + 0x30], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40702f
jmp 0x406ea0
movzx ecx, word [esp + eax + 0xa44]
mov word [esp + eax + 0x224], cx
add eax, 2
cmp cx, si
jne 0x406ea0
xor eax, eax
lea ebx, [ebx]
movzx ecx, word [esp + eax + 0x224]
mov word [esp + eax + 0x1c], cx
add eax, 2
cmp cx, si
jne 0x406ec0
lea eax, [esp + 0x1c]
add eax, 0xfffffffe
lea esp, [esp]
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x406ee0
mov edx, dword [str.3.0.1.0512]
mov ecx, dword [0x42d6fc]
mov dword [eax], edx
mov edx, dword [0x42d700]
mov dword [eax + 4], ecx
mov ecx, dword [0x42d704]
mov dword [eax + 8], edx
mov edx, dword [0x42d708]
mov dword [eax + 0xc], ecx
mov cx, word [0x42d70c]
lea edi, [esp + 0x1c]
mov dword [eax + 0x10], edx
mov word [eax + 0x14], cx
add edi, 0xfffffffe
lea ebx, [ebx]
mov ax, word [edi + 2]
add edi, 2
cmp ax, si
jne 0x406f30
mov edx, dword [0x42d65c]
lea eax, [esp + 0x1c]
push eax
mov dword [edi], edx
call ebx
test eax, eax
je 0x40702f
push 0x206
lea ecx, [esp + 0x432]
push esi
push ecx
mov word [esp + 0x438], si
call fcn.00408700
add esp, 0xc
xor eax, eax
jmp 0x406f80
movzx ecx, word [esp + eax + 0x1c]
mov word [esp + eax + 0x42c], cx
add eax, 2
cmp cx, si
jne 0x406f80
lea eax, [esp + 0x42c]
add eax, 0xfffffffe
nop
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x406fa0
mov edx, dword [str.Config.exe]
mov ecx, dword [0x42d6e4]
mov dword [eax], edx
mov edx, dword [0x42d6e8]
mov dword [eax + 4], ecx
mov ecx, dword [0x42d6ec]
mov dword [eax + 8], edx
mov edx, dword [0x42d6f0]
mov dword [eax + 0xc], ecx
mov cx, word [0x42d6f4]
mov dword [eax + 0x10], edx
lea edx, [esp + 0x42c]
push edx
mov word [eax + 0x14], cx
call ebx
test eax, eax
je 0x40702f
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [esp + 0x10]
lea ecx, [esp + 0x224]
push ecx
lea ecx, [esi + 0x8c]
call fcn.004021b0
lea edx, [esp + 0x1c]
push edx
lea ecx, [esi + 0xa8]
call fcn.004021b0
mov ecx, esi
call fcn.00405c40
jmp 0x407580
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push esi
push 0x26
lea ecx, [esp + 0x844]
push ecx
push esi
call ebp
lea edi, [esp + 0x83c]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
cmp ax, si
jne 0x407052
mov edx, dword [0x42d65c]
lea eax, [esp + 0x83c]
mov dword [edi], edx
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x407070
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 + 0x83c]
mov dword [eax + 0xc], ecx
add edi, 0xfffffffe
lea esp, [esp]
mov ax, word [edi + 2]
add edi, 2
cmp ax, si
jne 0x4070b0
mov dword [edi], edx
xor eax, eax
movzx ecx, word [esp + eax + 0x83c]
mov word [esp + eax + 0x224], cx
add eax, 2
cmp cx, si
jne 0x4070c0
xor eax, eax
lea ebx, [ebx]
movzx ecx, word [esp + eax + 0x224]
mov word [esp + eax + 0x1c], cx
add eax, 2
cmp cx, si
jne 0x4070e0
lea eax, [esp + 0x1c]
add eax, 0xfffffffe
lea esp, [esp]
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x407100
mov ecx, dword [str.3.0.1.0512]
mov dword [eax], ecx
mov ecx, dword [0x42d6fc]
mov dword [eax + 4], ecx
mov ecx, dword [0x42d700]
mov dword [eax + 8], ecx
mov ecx, dword [0x42d704]
mov dword [eax + 0xc], ecx
mov ecx, dword [0x42d708]
mov dword [eax + 0x10], ecx
mov cx, word [0x42d70c]
lea edi, [esp + 0x1c]
mov word [eax + 0x14], cx
add edi, 0xfffffffe
lea ebx, [ebx]
mov ax, word [edi + 2]
add edi, 2
cmp ax, si
jne 0x407150
mov dword [edi], edx
lea edx, [esp + 0x1c]
push edx
call ebx
test eax, eax
je 0x407250
push 0x206
lea eax, [esp + 0x432]
push esi
push eax
mov word [esp + 0x438], si
call fcn.00408700
add esp, 0xc
xor eax, eax
lea ecx, [ecx]
movzx ecx, word [esp + eax + 0x1c]
mov word [esp + eax + 0x42c], cx
add eax, 2
cmp cx, si
jne 0x407190
lea eax, [esp + 0x42c]
add eax, 0xfffffffe
nop
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x4071b0
mov ecx, dword [str.Config.exe]
mov edx, dword [0x42d6e4]
mov dword [eax], ecx
mov ecx, dword [0x42d6e8]
mov dword [eax + 4], edx
mov edx, dword [0x42d6ec]
mov dword [eax + 8], ecx
mov ecx, dword [0x42d6f0]
mov dword [eax + 0xc], edx
mov dx, word [0x42d6f4]
mov dword [eax + 0x10], ecx
mov word [eax + 0x14], dx
lea eax, [esp + 0x42c]
push eax
call ebx
test eax, eax
je 0x407250
lea eax, [esp + 0x224]
lea edx, [eax + 2]
jmp 0x407210
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x407210
mov edi, dword [esp + 0x10]
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x228]
push ecx
lea ecx, [edi + 0x8c]
call fcn.00401f70
lea eax, [esp + 0x1c]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x407240
jmp 0x40756b
lea eax, [esp + 0xc4c]
push eax
call ebx
test eax, eax
je 0x407360
xor eax, eax
jmp 0x407270
movzx ecx, word [esp + eax + 0xc4c]
mov word [esp + eax + 0x224], cx
add eax, 2
cmp cx, si
jne 0x407270
xor eax, eax
lea ebx, [ebx]
movzx ecx, word [esp + eax + 0x224]
mov word [esp + eax + 0x1c], cx
add eax, 2
cmp cx, si
jne 0x407290
lea eax, [esp + 0x1c]
add eax, 0xfffffffe
lea esp, [esp]
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x4072b0
mov ecx, dword [str.3.0.1.0512]
mov edx, dword [0x42d6fc]
mov dword [eax], ecx
mov ecx, dword [0x42d700]
mov dword [eax + 4], edx
mov edx, dword [0x42d704]
mov dword [eax + 8], ecx
mov ecx, dword [0x42d708]
mov dword [eax + 0xc], edx
mov dx, word [0x42d70c]
lea edi, [esp + 0x1c]
mov dword [eax + 0x10], ecx
mov word [eax + 0x14], dx
add edi, 0xfffffffe
lea ebx, [ebx]
mov ax, word [edi + 2]
add edi, 2
cmp ax, si
jne 0x407300
mov eax, dword [0x42d65c]
mov dword [edi], eax
lea eax, [esp + 0x224]
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x407320
mov edi, dword [esp + 0x10]
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x228]
push ecx
lea ecx, [edi + 0x8c]
call fcn.00401f70
lea eax, [esp + 0x1c]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x407350
jmp 0x40756b
lea eax, [esp + 0xa44]
push eax
call ebx
test eax, eax
je 0x407470
xor eax, eax
jmp 0x407380
movzx ecx, word [esp + eax + 0xa44]
mov word [esp + eax + 0x224], cx
add eax, 2
cmp cx, si
jne 0x407380
xor eax, eax
lea ebx, [ebx]
movzx ecx, word [esp + eax + 0x224]
mov word [esp + eax + 0x1c], cx
add eax, 2
cmp cx, si
jne 0x4073a0
lea eax, [esp + 0x1c]
add eax, 0xfffffffe
lea esp, [esp]
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x4073c0
mov ecx, dword [str.3.0.1.0512]
mov edx, dword [0x42d6fc]
mov dword [eax], ecx
mov ecx, dword [0x42d700]
mov dword [eax + 4], edx
mov edx, dword [0x42d704]
mov dword [eax + 8], ecx
mov ecx, dword [0x42d708]
mov dword [eax + 0xc], edx
mov dx, word [0x42d70c]
lea edi, [esp + 0x1c]
mov dword [eax + 0x10], ecx
mov word [eax + 0x14], dx
add edi, 0xfffffffe
lea ebx, [ebx]
mov ax, word [edi + 2]
add edi, 2
cmp ax, si
jne 0x407410
mov eax, dword [0x42d65c]
mov dword [edi], eax
lea eax, [esp + 0x224]
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x407430
mov edi, dword [esp + 0x10]
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x228]
push ecx
lea ecx, [edi + 0x8c]
call fcn.00401f70
lea eax, [esp + 0x1c]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x407460
jmp 0x40756b
xor eax, eax
jmp 0x407480
movzx ecx, word [esp + eax + 0x83c]
mov word [esp + eax + 0x224], cx
add eax, 2
cmp cx, si
jne 0x407480
xor eax, eax
lea ebx, [ebx]
movzx ecx, word [esp + eax + 0x224]
mov word [esp + eax + 0x1c], cx
add eax, 2
cmp cx, si
jne 0x4074a0
lea eax, [esp + 0x1c]
add eax, 0xfffffffe
lea esp, [esp]
mov cx, word [eax + 2]
add eax, 2
cmp cx, si
jne 0x4074c0
mov ecx, dword [str.3.0.1.0512]
mov edx, dword [0x42d6fc]
mov dword [eax], ecx
mov ecx, dword [0x42d700]
mov dword [eax + 4], edx
mov edx, dword [0x42d704]
mov dword [eax + 8], ecx
mov ecx, dword [0x42d708]
mov dword [eax + 0xc], edx
mov dx, word [0x42d70c]
lea edi, [esp + 0x1c]
mov dword [eax + 0x10], ecx
mov word [eax + 0x14], dx
add edi, 0xfffffffe
lea ebx, [ebx]
mov ax, word [edi + 2]
add edi, 2
cmp ax, si
jne 0x407510
mov eax, dword [0x42d65c]
mov dword [edi], eax
lea eax, [esp + 0x224]
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x407530
mov edi, dword [esp + 0x10]
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x228]
push ecx
lea ecx, [edi + 0x8c]
call fcn.00401f70
lea eax, [esp + 0x1c]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x407560
sub eax, edx
sar eax, 1
push eax
lea edx, [esp + 0x20]
push edx
lea ecx, [edi + 0xa8]
call fcn.00401f70
mov ecx, dword [esp + 0x105c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004086c2
add esp, 0x1050
ret