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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x573a01
mov eax, dword fs:[0]
push eax
sub esp, 0x3c
push ebx
push esi
push edi
mov eax, dword [0x5d2614]
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.00448a4d
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x407fd0
push 0x80004005
call fcn.00401fd0
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.00453a0c
lea esi, [ebp + 0xc]
mov byte [ebp - 4], 3
call fcn.00407ee0
call fcn.00448a4d
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x408011
push 0x80004005
call fcn.00401fd0
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 0x408312
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edi
or eax, ecx
jge 0x408059
push edi
lea ecx, [ebp - 0x18]
call fcn.00401de0
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.0054213d
add esp, 8
test eax, eax
jl 0x408308
cmp eax, dword [esi - 8]
jg 0x408308
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.00402000
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.00407c50
add esp, 0xc
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 6
call fcn.00401f40
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 0x4080f3
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 0x408161
push ecx
mov dword [ebp - 0x24], esp
mov ebx, esp
push edi
call fcn.00402000
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.00407c50
add esp, 0xc
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 8
call fcn.00401f40
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 0x408161
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 0x4082d4
call fcn.00407c10
test eax, eax
je 0x4082d4
mov eax, dword [ebp + 0xc]
cmp dword [eax - 0xc], 0
jl 0x4082d4
push str._ProgramFiles_
push eax
call fcn.00543082
add esp, 8
test eax, eax
je 0x4082d4
sub eax, dword [ebp + 0xc]
sar eax, 1
cmp eax, 0xffffffff
je 0x4082d4
lea ecx, [ebp - 0x18]
call fcn.00401ca0
lea edx, [ebp - 0x24]
push edx
call fcn.00408570
add esp, 4
test eax, eax
je 0x4082d1
lea ecx, [ebp - 0x14]
call fcn.00401c70
push 0
push 0x26
mov bl, 9
push 0x104
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], bl
call fcn.00401e30
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
push 0xffffffffffffffff
lea ecx, [ebp - 0x14]
call fcn.0040b6e0
push 0x5a14b0
push str.__x86_
lea ecx, [ebp - 0x14]
call fcn.0040ad20
mov eax, dword [ebp - 0x14]
push eax
push str._ProgramFiles_
lea ecx, [ebp + 0xc]
call fcn.0040ad20
push ecx
lea edx, [ebp + 0xc]
mov ecx, esp
mov dword [ebp - 0x28], esp
push edx
call fcn.00402070
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.00407c50
add esp, 0xc
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 0xb
call fcn.00401f40
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], bl
call fcn.00412f60
mov ecx, dword [ebp - 0x10]
cmp dword [ecx - 0xc], 0
jne 0x4082b9
push ecx
lea edx, [ebp + 0xc]
mov ecx, esp
mov dword [ebp - 0x2c], esp
push edx
call fcn.00402070
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.00407c50
add esp, 0xc
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 0xd
call fcn.00401fb0
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], bl
call fcn.00412f60
lea ecx, [ebp - 0x24]
push ecx
call fcn.004085e0
add esp, 4
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 4
call fcn.00412f60
mov esi, dword [ebp - 0x18]
mov edi, dword [ebp - 0x10]
add edi, 0xfffffff0
push edi
call fcn.00402000
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 0x408341
push 0x80070057
call fcn.00401fd0
lea edi, [ebx - 0x10]
push edi
call fcn.00402000
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 0x40834d
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.00453a35
or edx, 0xffffffff
lea ecx, [edi + 0xc]
mov byte [ebp - 4], 1
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408376
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 0x408399
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