Function at 0x100549d0
Capabilities:
Check if file exists
Get common file path
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x638
mov eax, dword [0x1007b00c]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
mov esi, dword [ebp + 8]
mov ecx, esi
push edi
mov dword [ebp - 0x630], 0
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10054a00
sub ecx, edx
sar ecx, 1
lea eax, [ecx + 2]
push eax
push esi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcslwr_s]
push str._systemroot_
push esi
call dword [sym.imp.VCRUNTIME140.dll_wcsstr]
mov edi, eax
add esp, 0x10
test edi, edi
je 0x10054aba
push 0x105
lea ecx, [ebp - 0x62c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x10054a9f
lea eax, [edi + 0x18]
push eax
lea eax, [ebp - 0x62c]
push eax
push 0x100676d8
push 0xffffffffffffffff
lea eax, [ebp - 0x214]
push 0x104
push eax
call fcn.1000f290
add esp, 0x18
test eax, eax
js 0x10054a9f
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x10054a9f
push 0x103
lea eax, [ebp - 0x214]
push eax
push 0x104
push esi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy_s]
add esp, 0x10
push esi
call fcn.100547f0
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.1005b6db
mov esp, ebp
pop ebp
ret 4
push esi
call dword [sym.imp.SHLWAPI.dll_PathIsRelativeW]
test eax, eax
jne 0x10054ae7
push esi
call fcn.100547f0
test eax, eax
je 0x10054aa5
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.1005b6db
mov esp, ebp
pop ebp
ret 4
mov ebx, dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
push 0
push 0
push str.path
call ebx
mov edi, eax
test edi, edi
je 0x10054aa5
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 4
mov dword [ebp - 0x634], eax
test eax, eax
je 0x10054a9f
push edi
push eax
push str.path
call ebx
mov ecx, dword [ebp - 0x634]
xor edx, edx
push 0x3b
mov edi, ecx
push ecx
mov word [ecx + eax*2 - 2], dx
call dword [sym.imp.VCRUNTIME140.dll_wcschr]
mov edx, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy_s]
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x10054bd2
mov ecx, ebx
sub ecx, edi
sar ecx, 1
cmp ecx, 0x104
jae 0x10054bd2
push ecx
push edi
lea eax, [ebp - 0x41c]
push 0x104
push eax
call edx
push esi
lea eax, [ebp - 0x41c]
push eax
push 0x100676d8
push 0xffffffffffffffff
lea eax, [ebp - 0x214]
push 0x104
push eax
call fcn.1000f290
add esp, 0x28
test eax, eax
js 0x10054bac
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x10054bb4
lea edi, [ebx + 2]
push 0x3b
push edi
jmp 0x10054b41
lea ecx, [ebp - 0x214]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10054bc0
sub ecx, edx
sar ecx, 1
push ecx
jmp 0x10054c33
mov ecx, edi
lea ebx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10054bd7
sub ecx, ebx
lea eax, [ebp - 0x41c]
sar ecx, 1
push ecx
push edi
push 0x104
push eax
call edx
push esi
lea eax, [ebp - 0x41c]
push eax
push 0x100676d8
push 0xffffffffffffffff
lea eax, [ebp - 0x214]
push 0x104
push eax
call fcn.1000f290
add esp, 0x28
test eax, eax
js 0x10054c54
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x10054c54
push 0x103
lea eax, [ebp - 0x214]
push eax
mov eax, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy_s]
push 0x104
push esi
call eax
mov dword [ebp - 0x630], 1
add esp, 0x10
push esi
call fcn.100547f0
xor ebx, ebx
cmp dword [ebp - 0x630], ebx
setne bl
push dword [ebp - 0x634]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, dword [ebp - 8]
add esp, 4
mov eax, ebx
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.1005b6db
mov esp, ebp
pop ebp
ret 4