Function at 0x402af0
Capabilities:
Get common file path
Get program files directory
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x314
mov eax, dword [0x41b004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push edi
push eax
lea eax, [ebp - 0x20c]
push 0x417f64
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0
push 0x26
lea ecx, [ebp - 0x108]
push ecx
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
mov ebx, dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
js 0x402b83
lea edx, [ebp - 0x108]
push edx
call ebx
lea eax, [ebp - 0x108]
push eax
call edi
push eax
lea ecx, [ebp - 0x108]
push ecx
lea edx, [ebp - 0x20c]
push edx
call fcn.0040ad98
add esp, 0xc
test eax, eax
jne 0x402b83
pop edi
mov eax, 0x80004005
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
push esi
push 0x419010
push str.Kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x402cc4
lea eax, [ebp - 0x314]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_IsWow64Process]
test eax, eax
je 0x402cc4
cmp dword [ebp - 0x314], 0
je 0x402cc4
push 0x104
lea ecx, [ebp - 0x310]
push ecx
push str._ProgramW6432_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
push str._ProgramW6432_
call edi
mov ecx, str._ProgramW6432_
lea esi, [ebp - 0x310]
cmp eax, 4
jb 0x402c14
lea ebx, [ebx]
mov edx, dword [esi]
cmp edx, dword [ecx]
jne 0x402c38
sub eax, 4
add ecx, 4
add esi, 4
cmp eax, 4
jae 0x402c00
test eax, eax
je 0x402c7b
mov dl, byte [ecx]
cmp dl, byte [esi]
jne 0x402c38
cmp eax, 1
jbe 0x402c7b
mov dl, byte [ecx + 1]
cmp dl, byte [esi + 1]
jne 0x402c38
cmp eax, 2
jbe 0x402c7b
mov al, byte [ecx + 2]
cmp al, byte [esi + 2]
je 0x402c7b
lea ecx, [ebp - 0x310]
push ecx
call ebx
lea edx, [ebp - 0x310]
push edx
call edi
push eax
lea eax, [ebp - 0x310]
push eax
lea ecx, [ebp - 0x20c]
push ecx
call fcn.0040ad98
add esp, 0xc
test eax, eax
jne 0x402cc4
pop esi
pop edi
mov eax, 0x80004005
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
push str.__x86_
call edi
lea edx, [ebp - 0x108]
lea esi, [ebp - 0x108]
push edx
sub esi, eax
call edi
mov byte [eax + esi], 0
lea eax, [ebp - 0x108]
push eax
call ebx
lea ecx, [ebp - 0x108]
push ecx
call edi
push eax
lea edx, [ebp - 0x108]
push edx
lea eax, [ebp - 0x20c]
push eax
call fcn.0040ad98
add esp, 0xc
test eax, eax
je 0x402c65
push 0
push 0x23
lea ecx, [ebp - 0x108]
push ecx
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
test eax, eax
js 0x402d0c
lea edx, [ebp - 0x108]
push edx
call ebx
lea eax, [ebp - 0x108]
push eax
call edi
push eax
lea ecx, [ebp - 0x108]
push ecx
lea edx, [ebp - 0x20c]
push edx
call fcn.0040ad98
add esp, 0xc
test eax, eax
je 0x402c65
push 0x104
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
lea ecx, [ebp - 0x108]
push ecx
call ebx
lea edx, [ebp - 0x108]
push edx
call edi
push eax
lea eax, [ebp - 0x108]
push eax
lea ecx, [ebp - 0x20c]
push ecx
call fcn.0040ad98
mov ecx, dword [ebp - 4]
add esp, 0xc
neg eax
sbb eax, eax
pop esi
and eax, 0x7fffbffb
pop edi
xor ecx, ebp
add eax, 0x80004005
pop ebx
call fcn.0040aabb
mov esp, ebp
pop ebp
ret