Function at 0x40a180
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 0x40a3f9
mov esi, dword [0x41e4e4]
xor edi, edi
mov dword [ebp - 0x22c], edi
test esi, esi
jne 0x40a3b3
push 0x10
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [0x41e4e4], eax
test eax, eax
je 0x40a3f9
mov dword [0x41e4e0], 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 0x40a320
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
cmp esi, 0x28
jne 0x40a272
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 0x40a2aa
cmp esi, 0x26
jne 0x40a2b7
mov eax, dword [0x41e4e4]
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 0x40a2b7
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 0x40a2c2
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 [0x41e4e4]
mov dword [edi + esi], eax
test eax, eax
je 0x40a326
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 0x40a20c
xor edi, edi
jmp 0x40a382
mov esi, dword [0x41e4e4]
test esi, esi
je 0x40a3f9
xor eax, eax
mov edi, eax
mov eax, dword [0x41e4e0]
test eax, eax
je 0x40a369
xor ebx, ebx
mov ecx, dword [esi + edi*4]
test ecx, ecx
je 0x40a35e
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov esi, dword [0x41e4e4]
mov eax, dword [0x41e4e0]
inc edi
cmp edi, eax
jb 0x40a33d
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 [0x41e4e4], esi
test esi, esi
je 0x40a3f9
mov dword [ebp - 0x220], 0x28
mov dword [ebp - 0x21c], 0x2a
mov dword [ebp - 0x218], 0x26
mov dword [ebp - 0x214], 0x24
jmp 0x40a1dc
cmp dword [0x41e4e0], 0
jbe 0x40a3f9
mov edx, ebx
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
cmp ax, word [ebp - 0x22c]
jne 0x40a3c1
push dword [esi + edi*4]
sub edx, ecx
mov ecx, ebx
sar edx, 1
call fcn.00401b03
pop ecx
test eax, eax
jne 0x40a3f4
inc edi
cmp edi, dword [0x41e4e0]
jae 0x40a3f9
mov esi, dword [0x41e4e4]
jmp 0x40a3bc
xor eax, eax
inc eax
jmp 0x40a3fb
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040d350
leave
ret