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

Disassembly:
sub esp, 0xa34
mov eax, dword [0x5685f0]
xor eax, esp
mov dword [esp + 0xa30], eax
push ebx
push ebp
mov ebp, dword [esp + 0xa40]
push esi
xor ebx, ebx
push 0x206
lea eax, [esp + 0x222]
push ebx
push eax
mov word [esp + 0x228], bx
call fcn.0042faa0
push 0x206
lea ecx, [esp + 0x26]
push ebx
push ecx
mov word [esp + 0x2c], bx
call fcn.0042faa0
push 0x206
lea edx, [esp + 0x442]
push ebx
push edx
mov word [esp + 0x448], bx
call fcn.0042faa0
add esp, 0x24
cmp dword [ebp + 0xc8], 8
jb 0x40538f
mov eax, dword [ebp + 0xb4]
jmp 0x405395
lea eax, [ebp + 0xb4]
push str.SmartCloudInfo.ini
push eax
lea eax, [esp + 0x42c]
push str._s_s
push eax
call fcn.0042a2e5
add esp, 0x10
lea ecx, [esp + 0x424]
push ecx
push 0x104
lea edx, [esp + 0x1c]
push edx
push 0x55c3b8
push str.CfgRootPath
push str.AppInfo
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [esp + 0x14]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x405416
lea eax, [esp + 0x14]
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4053f0
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x18]
push ecx
lea esi, [ebp + 0x40]
call fcn.00401250
mov byte [ebp + 0x20], 1
jmp 0x4056ee
push edi
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
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x405433
mov edx, dword [0x55c4b4]
mov dword [edi], edx
lea edi, [esp + 0x220]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x405451
mov ecx, 8
mov esi, 0x55c4b8
rep movsd dword es:[edi], dword [esi]
lea edi, [esp + 0x220]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x405473
lea eax, [esp + 0x220]
mov dword [edi], edx
add eax, 0xfffffffe
jmp 0x405490
mov cx, word [eax + 2]
add eax, 2
cmp cx, bx
jne 0x405490
mov ecx, dword [str.SmartCloud]
mov edx, dword [0x55c1bc]
mov dword [eax], ecx
mov ecx, dword [fcn.00430074]
mov dword [eax + 4], edx
mov edx, dword [0x55c1c4]
mov dword [eax + 8], ecx
mov ecx, dword [0x55c1c8]
mov dword [eax + 0xc], edx
mov dx, word [0x55c1cc]
mov dword [eax + 0x10], ecx
mov word [eax + 0x14], dx
lea eax, [esp + 0x220]
add eax, 0xfffffffe
lea ecx, [ecx]
mov cx, word [eax + 2]
add eax, 2
cmp cx, bx
jne 0x4054e0
mov ecx, dword [str..ini]
mov edx, dword [0x55c4dc]
mov dword [eax], ecx
mov cx, word [0x55c4e0]
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 0x55c3b8
push str.CfgRootPath
push str.Globals
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea ecx, [esp + 0x18]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x405555
lea eax, [esp + 0x18]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x405545
jmp 0x4056d2
push 0x206
lea eax, [esp + 0x636]
push ebx
push eax
mov word [esp + 0x63c], bx
call fcn.0042faa0
add esp, 0xc
xor eax, eax
jmp 0x405580
movzx ecx, word [eax + str.SOFTWARE_]
mov word [esp + eax + 0x630], cx
add eax, 2
cmp cx, bx
jne 0x405580
lea edi, [esp + 0x630]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x4055a1
mov ecx, 8
mov esi, 0x55c4b8
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x10]
push ecx
push 0xf003f
push ebx
lea edx, [esp + 0x63c]
push edx
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x405633
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x1c]
push ecx
push ebx
push ebx
push str.CfgRootPath
push edx
mov dword [esp + 0x2c], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x405633
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x405633
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea edx, [ebp + 0x40]
push edx
lea edx, [esp + 0x1c]
call fcn.00401220
mov byte [ebp + 0x20], 1
jmp 0x4056ed
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x104
lea ecx, [esp + 0x83c]
push ecx
push ebx
mov byte [ebp + 0x20], bl
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea edx, [esp + 0x838]
push 0x5c
push edx
call fcn.0042ab26
mov word [eax + 2], bx
push str.SmartCloudInfo.ini
lea eax, [esp + 0x844]
push eax
lea ecx, [esp + 0x438]
push str._s_s
push ecx
call fcn.0042a2e5
add esp, 0x18
lea edx, [esp + 0x428]
push edx
push 0x104
lea eax, [esp + 0x20]
push eax
push 0x55c3b8
push str.CfgRootPath
push str.AppInfo
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea ecx, [esp + 0x18]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4056ea
lea eax, [esp + 0x18]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4056c7
sub eax, edx
sar eax, 1
push eax
lea edx, [esp + 0x1c]
push edx
lea esi, [ebp + 0x40]
call fcn.00401250
mov byte [ebp + 0x20], 1
jmp 0x4056ed
mov byte [ebp + 0x20], bl
pop edi
mov ecx, dword [esp + 0xa3c]
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00429fbb
add esp, 0xa34
ret 4