Function at 0x40a7a0
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 0x40aa19
mov esi, dword [0x41e504]
xor edi, edi
mov dword [ebp - 0x22c], edi
test esi, esi
jne 0x40a9d3
push 0x10
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [0x41e504], eax
test eax, eax
je 0x40aa19
mov dword [0x41e500], 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 0x40a940
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
cmp esi, 0x28
jne 0x40a892
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 0x40a8ca
cmp esi, 0x26
jne 0x40a8d7
mov eax, dword [0x41e504]
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 0x40a8d7
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 0x40a8e2
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 [0x41e504]
mov dword [edi + esi], eax
test eax, eax
je 0x40a946
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 0x40a82c
xor edi, edi
jmp 0x40a9a2
mov esi, dword [0x41e504]
test esi, esi
je 0x40aa19
xor eax, eax
mov edi, eax
mov eax, dword [0x41e500]
test eax, eax
je 0x40a989
xor ebx, ebx
mov ecx, dword [esi + edi*4]
test ecx, ecx
je 0x40a97e
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov esi, dword [0x41e504]
mov eax, dword [0x41e500]
inc edi
cmp edi, eax
jb 0x40a95d
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 [0x41e504], esi
test esi, esi
je 0x40aa19
mov dword [ebp - 0x220], 0x28
mov dword [ebp - 0x21c], 0x2a
mov dword [ebp - 0x218], 0x26
mov dword [ebp - 0x214], 0x24
jmp 0x40a7fc
cmp dword [0x41e500], 0
jbe 0x40aa19
mov edx, ebx
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
cmp ax, word [ebp - 0x22c]
jne 0x40a9e1
push dword [esi + edi*4]
sub edx, ecx
mov ecx, ebx
sar edx, 1
call fcn.00401b23
pop ecx
test eax, eax
jne 0x40aa14
inc edi
cmp edi, dword [0x41e500]
jae 0x40aa19
mov esi, dword [0x41e504]
jmp 0x40a9dc
xor eax, eax
inc eax
jmp 0x40aa1b
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040d990
leave
ret