Function at 0x40a1b0
Capabilities:
Get common file path
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x22c
mov eax, dword [0x41c00c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, ecx
mov dword [ebp - 0x220], 0x28
mov dword [ebp - 0x228], ebx
mov dword [ebp - 0x21c], 0x2a
mov dword [ebp - 0x218], 0x26
mov dword [ebp - 0x214], 0x24
push esi
push edi
test ebx, ebx
je 0x40a429
mov esi, dword [0x41e4e8]
xor edi, edi
mov dword [ebp - 0x22c], edi
test esi, esi
jne 0x40a3e3
push 0x10
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [0x41e4e8], eax
test eax, eax
je 0x40a429
mov dword [0x41e4e4], 4
xor eax, eax
push 0x20c
push eax
lea eax, [ebp - 0x210]
push eax
call sub.VCRUNTIME140.dll_memset
mov esi, dword [ebp + edi - 0x220]
lea eax, [ebp - 0x210]
add esp, 0xc
xor ecx, ecx
push ecx
push esi
push eax
push ecx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x40a350
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
cmp esi, 0x28
jne 0x40a2a2
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveBackslashW]
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
jmp 0x40a2da
cmp esi, 0x26
jne 0x40a2e7
mov eax, dword [0x41e4e8]
push dword [edi + eax - 4]
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x40a2e7
push 0x105
lea eax, [ebp - 0x210]
push eax
push str._ProgramW6432_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea ecx, [ebp - 0x210]
xor esi, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, si
jne 0x40a2f2
sub ecx, edx
sar ecx, 1
lea eax, [ecx + ecx]
mov dword [ebp - 0x224], eax
add eax, 2
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, dword [0x41e4e8]
mov dword [edi + esi], eax
test eax, eax
je 0x40a356
push dword [ebp - 0x224]
lea ecx, [ebp - 0x210]
push ecx
push eax
call sub.VCRUNTIME140.dll_memcpy
add edi, 4
add esp, 0xc
cmp edi, 0x10
jb 0x40a23c
xor edi, edi
jmp 0x40a3b2
mov esi, dword [0x41e4e8]
test esi, esi
je 0x40a429
xor eax, eax
mov edi, eax
mov eax, dword [0x41e4e4]
test eax, eax
je 0x40a399
xor ebx, ebx
mov ecx, dword [esi + edi*4]
test ecx, ecx
je 0x40a38e
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov esi, dword [0x41e4e8]
mov eax, dword [0x41e4e4]
inc edi
cmp edi, eax
jb 0x40a36d
mov ebx, dword [ebp - 0x228]
push esi
xor edi, edi
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov esi, edi
mov dword [0x41e4e8], esi
test esi, esi
je 0x40a429
mov dword [ebp - 0x220], 0x28
mov dword [ebp - 0x21c], 0x2a
mov dword [ebp - 0x218], 0x26
mov dword [ebp - 0x214], 0x24
jmp 0x40a20c
cmp dword [0x41e4e4], 0
jbe 0x40a429
mov edx, ebx
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
cmp ax, word [ebp - 0x22c]
jne 0x40a3f1
push dword [esi + edi*4]
sub edx, ecx
mov ecx, ebx
sar edx, 1
call fcn.00401b03
pop ecx
test eax, eax
jne 0x40a424
inc edi
cmp edi, dword [0x41e4e4]
jae 0x40a429
mov esi, dword [0x41e4e8]
jmp 0x40a3ec
xor eax, eax
inc eax
jmp 0x40a42b
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040d390
leave
ret