Function at 0x40a960
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 0x40abd9
mov esi, dword [0x41e504]
xor edi, edi
mov dword [ebp - 0x22c], edi
test esi, esi
jne 0x40ab93
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 0x40abd9
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 0x40ab00
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
cmp esi, 0x28
jne 0x40aa52
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 0x40aa8a
cmp esi, 0x26
jne 0x40aa97
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 0x40aa97
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 0x40aaa2
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 0x40ab06
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 0x40a9ec
xor edi, edi
jmp 0x40ab62
mov esi, dword [0x41e504]
test esi, esi
je 0x40abd9
xor eax, eax
mov edi, eax
mov eax, dword [0x41e500]
test eax, eax
je 0x40ab49
xor ebx, ebx
mov ecx, dword [esi + edi*4]
test ecx, ecx
je 0x40ab3e
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 0x40ab1d
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 0x40abd9
mov dword [ebp - 0x220], 0x28
mov dword [ebp - 0x21c], 0x2a
mov dword [ebp - 0x218], 0x26
mov dword [ebp - 0x214], 0x24
jmp 0x40a9bc
cmp dword [0x41e500], 0
jbe 0x40abd9
mov edx, ebx
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
cmp ax, word [ebp - 0x22c]
jne 0x40aba1
push dword [esi + edi*4]
sub edx, ecx
mov ecx, ebx
sar edx, 1
call fcn.00401b63
pop ecx
test eax, eax
jne 0x40abd4
inc edi
cmp edi, dword [0x41e500]
jae 0x40abd9
mov esi, dword [0x41e504]
jmp 0x40ab9c
xor eax, eax
inc eax
jmp 0x40abdb
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040db50
leave
ret