Function at 0x1004e6f0
Capabilities:
Check if file exists
Query environment variable
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x420
mov eax, dword [0x1007b00c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
push 0x208
xor ebx, ebx
mov dword [ebp - 0x418], eax
lea eax, [ebp - 0x414]
mov dword [ebp - 0x41c], 1
push ebx
push eax
mov edi, edx
mov esi, ecx
call sub.VCRUNTIME140.dll_memset
push 0x208
lea eax, [ebp - 0x20c]
push ebx
push eax
call sub.VCRUNTIME140.dll_memset
mov ecx, esi
add esp, 0x18
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1004e750
sub ecx, edx
sar ecx, 1
cmp ecx, 0x82
ja 0x1004e921
push 0x2e
push esi
call dword [sym.imp.VCRUNTIME140.dll_wcsrchr]
add esp, 8
test eax, eax
lea eax, [ebp - 0x20c]
jne 0x1004e79c
push str..exe
push esi
push str._s_s
push 0x104
push eax
call fcn.1004f820
add esp, 0x14
jmp 0x1004e7b1
push 0x103
push esi
push 0x104
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy_s]
add esp, 0x10
lea eax, [ebp - 0x20c]
push eax
push str.SOFTWAREMicrosoftWindowsCurrentVersionApp_Paths_
push str._s_s
lea eax, [ebp - 0x414]
push 0x104
push eax
call fcn.1004f820
add esp, 0x14
lea eax, [ebp - 0x418]
push eax
push edi
lea eax, [ebp - 0x41c]
push eax
push 0
lea eax, [ebp - 0x414]
push eax
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.SHLWAPI.dll_SHGetValueW]
test eax, eax
jne 0x1004e808
push edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x1004e831
push dword [ebp - 0x418]
mov esi, dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x20c]
push edi
push eax
call esi
test eax, eax
je 0x1004e847
push edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x1004e921
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1005b6db
mov esp, ebp
pop ebp
ret
push 0x1007da74
push 0xc30
call fcn.1005be25
add esp, 8
mov dword [ebp - 0x420], eax
test eax, eax
je 0x1004e921
push 0x618
push eax
push str.path
call esi
test eax, eax
je 0x1004e913
cmp eax, 0x618
jae 0x1004e913
mov esi, dword [ebp - 0x420]
nop dword [eax]
push 0x3b
push esi
call dword [sym.imp.VCRUNTIME140.dll_wcschr]
mov ecx, dword [ebp + 8]
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x1004e8b9
lea eax, [ecx - 1]
push eax
push esi
push ecx
push edi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy_s]
add esp, 0x10
xor esi, esi
jmp 0x1004e8d8
mov eax, ebx
sub eax, esi
sar eax, 1
cmp eax, ecx
jb 0x1004e8c8
lea esi, [ebx + 2]
jmp 0x1004e901
push eax
push esi
push ecx
push edi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy_s]
add esp, 0x10
lea esi, [ebx + 2]
push edi
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
push 0xffffffffffffffff
lea eax, [ebp - 0x20c]
push eax
mov eax, dword [ebp + 8]
push eax
push edi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncat_s]
add esp, 0x10
push edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x1004e90e
test esi, esi
jne 0x1004e890
xor eax, eax
xor ebx, ebx
mov word [edi], ax
jmp 0x1004e913
mov ebx, 1
push dword [ebp - 0x420]
call fcn.1005be17
add esp, 4
mov eax, ebx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1005b6db
mov esp, ebp
pop ebp
ret