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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x572b11
mov eax, dword fs:[0]
push eax
sub esp, 0x3c
push ebx
push esi
push edi
mov eax, dword [0x5d1614]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x1c], 0
mov dword [ebp - 4], 1
call fcn.00447edb
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x407fc0
push 0x80004005
call fcn.00401fc0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea ebx, [eax + 0x10]
mov dword [ebp - 0x10], ebx
lea ecx, [ebp - 0x44]
mov byte [ebp - 4], 2
call fcn.00452ee6
lea esi, [ebp + 0xc]
mov byte [ebp - 4], 3
call fcn.00407ed0
call fcn.00447edb
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x408001
push 0x80004005
call fcn.00401fc0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea esi, [eax + 0x10]
mov dword [ebp - 0x18], esi
push 0
mov byte [ebp - 4], 4
mov ecx, dword [ebp + 0xc]
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov edi, eax
test edi, edi
jle 0x408302
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edi
or eax, ecx
jge 0x408049
push edi
lea ecx, [ebp - 0x18]
call fcn.00401db0
mov esi, dword [ebp - 0x18]
mov edx, dword [ebp + 0xc]
push edi
push esi
push edx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov eax, dword [esi - 8]
push eax
push esi
call fcn.005412d0
add esp, 8
test eax, eax
jl 0x4082f8
cmp eax, dword [esi - 8]
jg 0x4082f8
xor ecx, ecx
push ecx
lea edi, [esi - 0x10]
mov dword [esi - 0xc], eax
mov dword [ebp - 0x24], esp
mov ebx, esp
push edi
mov word [esi + eax*2], cx
call fcn.00401fe0
add eax, 0x10
mov dword [ebx], eax
mov byte [ebp - 4], 5
mov ecx, esp
mov dword [ebp - 0x20], esp
push str.VerInfo.esi
call fcn.00401a30
lea edx, [ebp - 0x14]
push edx
mov byte [ebp - 4], 4
call fcn.00407c40
add esp, 0xc
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 6
call fcn.00401f10
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4080e3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0x10]
mov eax, dword [ecx - 0xc]
test eax, eax
jne 0x408151
push ecx
mov dword [ebp - 0x24], esp
mov ebx, esp
push edi
call fcn.00401fe0
add eax, 0x10
mov dword [ebx], eax
mov byte [ebp - 4], 7
mov ecx, esp
mov dword [ebp - 0x20], esp
push str..esi
call fcn.00401a30
lea edx, [ebp - 0x14]
push edx
mov byte [ebp - 4], 4
call fcn.00407c40
add esp, 0xc
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 8
call fcn.00401f10
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408151
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0x10]
cmp dword [ecx - 0xc], 0
jne 0x4082c4
call fcn.00407c00
test eax, eax
je 0x4082c4
mov eax, dword [ebp + 0xc]
cmp dword [eax - 0xc], 0
jl 0x4082c4
push str._ProgramFiles_
push eax
call fcn.00542215
add esp, 8
test eax, eax
je 0x4082c4
sub eax, dword [ebp + 0xc]
sar eax, 1
cmp eax, 0xffffffff
je 0x4082c4
lea ecx, [ebp - 0x18]
call fcn.00401c70
lea edx, [ebp - 0x24]
push edx
call fcn.00408560
add esp, 4
test eax, eax
je 0x4082c1
lea ecx, [ebp - 0x14]
call fcn.00401c40
push 0
push 0x26
mov bl, 9
push 0x104
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], bl
call fcn.00401e00
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
push 0xffffffffffffffff
lea ecx, [ebp - 0x14]
call fcn.0040b750
push 0x5a04b0
push str.__x86_
lea ecx, [ebp - 0x14]
call fcn.0040ad60
mov eax, dword [ebp - 0x14]
push eax
push str._ProgramFiles_
lea ecx, [ebp + 0xc]
call fcn.0040ad60
push ecx
lea edx, [ebp + 0xc]
mov ecx, esp
mov dword [ebp - 0x28], esp
push edx
call fcn.00402050
push ecx
mov byte [ebp - 4], 0xa
mov ecx, esp
mov dword [ebp - 0x2c], esp
push str.VerInfo.esi
call fcn.00401a30
lea eax, [ebp - 0x20]
push eax
mov byte [ebp - 4], bl
call fcn.00407c40
add esp, 0xc
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 0xb
call fcn.00401f10
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], bl
call fcn.00401fa0
mov ecx, dword [ebp - 0x10]
cmp dword [ecx - 0xc], 0
jne 0x4082a9
push ecx
lea edx, [ebp + 0xc]
mov ecx, esp
mov dword [ebp - 0x2c], esp
push edx
call fcn.00402050
push ecx
mov byte [ebp - 4], 0xc
mov ecx, esp
mov dword [ebp - 0x28], esp
push str..esi
call fcn.00401a30
lea eax, [ebp - 0x20]
push eax
mov byte [ebp - 4], bl
call fcn.00407c40
add esp, 0xc
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 0xd
call fcn.00401f80
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], bl
call fcn.00401fa0
lea ecx, [ebp - 0x24]
push ecx
call fcn.004085d0
add esp, 4
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 4
call fcn.00401fa0
mov esi, dword [ebp - 0x18]
mov edi, dword [ebp - 0x10]
add edi, 0xfffffff0
push edi
call fcn.00401fe0
mov ebx, dword [ebp + 8]
add eax, 0x10
mov dword [ebx], eax
lea eax, [esi - 0x10]
add esp, 4
mov dword [ebp - 0x1c], 1
mov byte [ebp - 4], 3
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jmp 0x408331
push 0x80070057
call fcn.00401fc0
lea edi, [ebx - 0x10]
push edi
call fcn.00401fe0
mov ebx, dword [ebp + 8]
add eax, 0x10
add esp, 4
mov dword [ebx], eax
lea eax, [esi - 0x10]
mov dword [ebp - 0x1c], 1
mov byte [ebp - 4], 3
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40833d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [ebp - 0x44]
mov byte [ebp - 4], 2
call fcn.00452f0f
or edx, 0xffffffff
lea ecx, [edi + 0xc]
mov byte [ebp - 4], 1
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408366
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
mov byte [ebp - 4], 0
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408389
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret