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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x6762bf
mov eax, dword fs:[0]
push eax
sub esp, 0x720
mov eax, dword [0x74b738]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x694], esi
mov ebx, dword [0x758f8c]
test ebx, ebx
jne 0x4a1143
push 0x74c144
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x758f8c], ebx
jne 0x4a1132
push 0x70
call fcn.00669e77
add esp, 4
mov dword [ebp - 0x690], eax
mov ecx, eax
mov dword [ebp - 4], ebx
call fcn.004709e0
mov ecx, eax
mov dword [ebp - 4], 0xffffffff
xchg dword [ebp - 0x690], eax
mov dword [0x758f8c], ecx
push 0x74c144
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ebx, dword [0x758f8c]
mov ecx, dword [ebx + 0x64]
test ecx, ecx
jne 0x4a1156
mov dword [ebp - 0x68c], 6
jmp 0x4a1161
call fcn.004777a0
mov dword [ebp - 0x68c], eax
call fcn.00509500
push 1
mov ecx, eax
mov edx, dword [eax]
mov edx, dword [edx + 8]
call edx
movzx eax, al
sub eax, 1
jne 0x4a12d7
push 0x2b
push str.f:master_luinst_ui_market_startuppage.cpp
lea ecx, [ebp - 0x670]
mov dword [ebp - 0x660], eax
mov dword [ebp - 0x65c], 0xf
mov byte [ebp - 0x670], al
call fcn.0042a9a0
mov dword [ebp - 4], 1
lea ecx, [ebp - 0x640]
push 3
push 0x6d1880
mov dword [ebp - 0x630], 0
mov dword [ebp - 0x62c], 0xf
mov byte [ebp - 0x640], 0
call fcn.0042a9a0
mov byte [ebp - 4], 2
call fcn.00509500
mov edi, eax
lea ecx, [ebp - 0x72c]
push 0x3e
lea eax, [ebp - 0x670]
push eax
lea eax, [ebp - 0x640]
push eax
call fcn.0042c590
mov esi, eax
push str.check_file_error_code___
push esi
mov byte [ebp - 4], 3
call fcn.0042c400
add esp, 8
mov ecx, esi
push dword [ebp - 0x68c]
call fcn.00439f10
mov eax, dword [edi]
mov ecx, edi
push esi
call dword [eax + 0x1c]
lea ecx, [ebp - 0x72c]
call fcn.00428ee0
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0x62c]
cmp edx, 0x10
jb 0x4a1273
mov ecx, dword [ebp - 0x640]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4a1269
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4a1269
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.00669e69
add esp, 8
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x65c]
mov dword [ebp - 0x630], 0
mov dword [ebp - 0x62c], 0xf
mov byte [ebp - 0x640], 0
cmp edx, 0x10
jb 0x4a12d1
mov ecx, dword [ebp - 0x670]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4a12c7
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4a12c7
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.00669e69
add esp, 8
mov esi, dword [ebp - 0x694]
cmp dword [ebp - 0x68c], 0
jne 0x4a12f1
push dword [ebx + 0x64]
push dword [esi + 0x58]
call dword [sym.imp.USER32.dll_SetWindowTextW]
jmp 0x4a15fd
call fcn.00465320
push 0x208
mov esi, eax
lea eax, [ebp - 0x628]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
push 0x208
lea eax, [ebp - 0x420]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0x24
mov dword [ebp - 0x68c], 1
lea eax, [ebp - 0x690]
mov dword [ebp - 0x690], 0x104
push eax
lea eax, [ebp - 0x420]
push eax
lea eax, [ebp - 0x68c]
push eax
push str.Setup_Path
push str.SOFTWARELudashi
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.SHLWAPI.dll_SHGetValueW]
mov edi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscpy_s]
test eax, eax
jne 0x4a13aa
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4a13aa
lea eax, [ebp - 0x420]
push eax
lea eax, [ebp - 0x218]
push 0x104
push eax
call edi
add esp, 0xc
jmp 0x4a144f
mov eax, dword [esi + 0x2c]
mov ecx, str.LuDaShi
cmp dword [eax - 0xc], 0
cmovne ecx, eax
push ecx
lea ecx, [ebp - 0x68c]
call fcn.00441f70
push 1
push 0x26
lea eax, [ebp - 0x218]
mov dword [ebp - 4], 4
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea eax, [ebp - 0x68c]
mov edx, 0x6d17fc
push eax
lea ecx, [ebp - 0x690]
call fcn.004792d0
push dword [eax]
lea eax, [ebp - 0x218]
push 0x104
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscat_s]
mov edx, dword [ebp - 0x690]
or esi, 0xffffffff
add esp, 0x10
add edx, 0xfffffff0
mov eax, esi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4a142d
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x68c]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], esi
dec esi
test esi, esi
jg 0x4a144f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea ecx, [ebp - 0x218]
call fcn.004777a0
test eax, eax
je 0x4a146a
call fcn.00477ab0
mov word [ebp - 0x218], ax
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x628]
push 0x104
push eax
call edi
add esp, 0xc
lea eax, [ebp - 0x628]
push eax
mov eax, dword [ebp - 0x694]
push dword [eax + 0x58]
call dword [sym.imp.USER32.dll_SetWindowTextW]
call fcn.00509500
mov ecx, eax
push 1
mov edx, dword [eax]
mov eax, dword [edx + 8]
call eax
movzx eax, al
sub eax, 1
jne 0x4a15fd
push 0x2b
push str.f:master_luinst_ui_market_startuppage.cpp
lea ecx, [ebp - 0x688]
mov dword [ebp - 0x678], eax
mov dword [ebp - 0x674], 0xf
mov byte [ebp - 0x688], al
call fcn.0042a9a0
mov dword [ebp - 4], 5
lea ecx, [ebp - 0x658]
push 3
push 0x6d1880
mov dword [ebp - 0x648], 0
mov dword [ebp - 0x644], 0xf
mov byte [ebp - 0x658], 0
call fcn.0042a9a0
mov byte [ebp - 4], 6
call fcn.00509500
mov edi, eax
lea ecx, [ebp - 0x2b0]
push 0x47
lea eax, [ebp - 0x688]
push eax
lea eax, [ebp - 0x658]
push eax
call fcn.0042c590
mov esi, eax
push str.use_default_dir_:
push esi
mov byte [ebp - 4], 7
call fcn.0042c400
lea eax, [ebp - 0x628]
push eax
push esi
call fcn.0043f750
mov eax, dword [edi]
add esp, 0x10
mov ecx, edi
push esi
call dword [eax + 0x1c]
lea ecx, [ebp - 0x2b0]
call fcn.00428ee0
mov edx, dword [ebp - 0x644]
cmp edx, 0x10
jb 0x4a15a6
mov ecx, dword [ebp - 0x658]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4a159c
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4a159c
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.00669e69
add esp, 8
mov edx, dword [ebp - 0x674]
mov dword [ebp - 0x648], 0
mov dword [ebp - 0x644], 0xf
mov byte [ebp - 0x658], 0
cmp edx, 0x10
jb 0x4a15fd
mov ecx, dword [ebp - 0x688]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x4a15f3
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x4a15f3
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.00669e69
add esp, 8
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00669a1e
mov esp, ebp
pop ebp
ret