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

Disassembly:
push 0xffffffffffffffff
push 0x43fd6e
mov eax, dword fs:[0]
push eax
sub esp, 0x300
mov eax, dword [0x44f3d8]
xor eax, esp
mov dword [esp + 0x2f8], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x44f3d8]
xor eax, esp
push eax
lea eax, [esp + 0x314]
mov dword fs:[0], eax
mov eax, dword [esp + 0x324]
mov ebx, edx
xor ebp, ebp
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x24], ebp
mov ecx, 7
mov dword [ebx + 0x18], ecx
mov dword [ebx + 0x14], ebp
mov dword [esp + 0x18], ebx
mov word [ebx + 4], bp
mov edx, 1
mov dword [esp + 0x24], edx
mov dword [esp + 0xe4], ecx
mov dword [esp + 0xe0], ebp
mov word [esp + 0xd0], bp
mov dword [esp + 0x31c], edx
mov dword [esp + 0x100], ecx
mov dword [esp + 0xfc], ebp
mov word [esp + 0xec], bp
add eax, 0xc
mov byte [esp + 0x31c], 2
mov dword [esp + 0x20], eax
mov eax, dword [eax + 4]
mov eax, dword [eax]
mov edi, eax
mov eax, dword [esp + 0x20]
cmp eax, ebp
mov esi, dword [eax + 4]
je 0x40f7e2
cmp eax, eax
je 0x40f7eb
call fcn.004281b2
mov eax, dword [esp + 0x20]
cmp edi, esi
je 0x40f939
cmp eax, ebp
jne 0x40f800
call fcn.004281b2
mov eax, dword [esp + 0x20]
cmp edi, dword [eax + 4]
jne 0x40f80a
call fcn.004281b2
cmp dword [edi + 0x24], 8
jb 0x40f815
mov eax, dword [edi + 0x10]
jmp 0x40f818
lea eax, [edi + 0x10]
push 0x444d3c
push eax
call fcn.00428644
add esp, 8
test eax, eax
jne 0x40f873
mov edx, 0x444d38
call fcn.00401e60
test eax, eax
je 0x40f873
mov edx, dword [esp + 0x1c]
push 0x444d3c
push edx
call fcn.00428644
add esp, 8
test eax, eax
jne 0x40f873
mov ecx, 0x444d38
call fcn.00401f00
mov ecx, eax
lea esi, [ecx + 2]
lea ecx, [ecx]
mov dx, word [ecx]
add ecx, 2
cmp dx, bp
jne 0x40f860
sub ecx, esi
sar ecx, 1
push ecx
push eax
jmp 0x40f8d1
mov esi, dword [esp + 0x20]
cmp edi, dword [esi + 4]
jne 0x40f881
call fcn.004281b2
cmp dword [edi + 0x24], 8
jb 0x40f88c
mov eax, dword [edi + 0x10]
jmp 0x40f88f
lea eax, [edi + 0x10]
push eax
mov eax, dword [esp + 0x20]
push eax
call fcn.00428644
add esp, 8
test eax, eax
jne 0x40f8d8
cmp edi, dword [esi + 4]
jne 0x40f8ab
call fcn.004281b2
cmp dword [edi + 0x40], 8
jb 0x40f8b6
mov edx, dword [edi + 0x2c]
jmp 0x40f8b9
lea edx, [edi + 0x2c]
mov eax, edx
lea esi, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, bp
jne 0x40f8c0
sub eax, esi
sar eax, 1
push eax
push edx
mov esi, ebx
call fcn.00404120
cmp byte [edi + 0x45], 0
je 0x40f8e8
call fcn.004281b2
jmp 0x40f7d3
mov eax, dword [edi + 8]
cmp byte [eax + 0x45], 0
jne 0x40f90f
mov edi, eax
mov eax, dword [edi]
cmp byte [eax + 0x45], 0
jne 0x40f7d3
nop
mov edi, eax
mov eax, dword [edi]
cmp byte [eax + 0x45], 0
je 0x40f900
jmp 0x40f7d3
mov eax, dword [edi + 4]
cmp byte [eax + 0x45], 0
jne 0x40f7d1
lea esp, [esp]
cmp edi, dword [eax + 8]
jne 0x40f7d1
mov edi, eax
mov eax, dword [eax + 4]
cmp byte [eax + 0x45], 0
je 0x40f920
jmp 0x40f7d1
cmp dword [ebx + 0x14], ebp
jne 0x410021
mov ebp, dword [esp + 0x1c]
xor bl, bl
cmp word [ebp], 0
je 0x40fa75
movzx eax, word [ebp]
cmp ax, 0x29
je 0x40fa75
cmp ax, 0x28
jne 0x40f96e
mov bl, 1
jmp 0x40fa67
test bl, bl
movzx esi, ax
je 0x40f9ee
or ecx, 0xffffffff
sub ecx, dword [esp + 0xfc]
cmp ecx, 1
ja 0x40f989
call fcn.00426295
mov edi, dword [esp + 0xfc]
add edi, 1
lea eax, [esp + 0xe8]
call fcn.004045b0
test al, al
je 0x40fa67
mov eax, dword [esp + 0xec]
mov ecx, 8
cmp dword [esp + 0x100], ecx
jae 0x40f9c3
lea eax, [esp + 0xec]
mov edx, dword [esp + 0xfc]
mov word [eax + edx*2], si
cmp dword [esp + 0x100], ecx
mov eax, dword [esp + 0xec]
mov dword [esp + 0xfc], edi
jae 0x40fa61
lea eax, [esp + 0xec]
jmp 0x40fa61
or eax, 0xffffffff
sub eax, dword [esp + 0xe0]
cmp eax, 1
ja 0x40fa02
call fcn.00426295
mov edi, dword [esp + 0xe0]
add edi, 1
lea eax, [esp + 0xcc]
call fcn.004045b0
test al, al
je 0x40fa67
mov eax, dword [esp + 0xd0]
mov ecx, 8
cmp dword [esp + 0xe4], ecx
jae 0x40fa38
lea eax, [esp + 0xd0]
mov edx, dword [esp + 0xe0]
mov word [eax + edx*2], si
cmp dword [esp + 0xe4], ecx
mov eax, dword [esp + 0xd0]
mov dword [esp + 0xe0], edi
jae 0x40fa61
lea eax, [esp + 0xd0]
mov word [eax + edi*2], 0
add ebp, 2
cmp word [ebp], 0
jne 0x40f953
lea eax, [esp + 0xcc]
call fcn.00425990
mov eax, dword [esp + 0xe0]
push str.source
mov edi, 6
lea ecx, [esp + 0xd0]
call fcn.00405280
test eax, eax
jne 0x40fae2
mov eax, dword [0x451a94]
cmp dword [eax + 0xaec], 8
jb 0x40fab8
mov edx, dword [eax + 0xad8]
jmp 0x40fabe
lea edx, [eax + 0xad8]
mov eax, edx
lea esi, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40fac3
sub eax, esi
mov esi, dword [esp + 0x18]
sar eax, 1
push eax
push edx
call fcn.00404120
jmp 0x410021
mov eax, dword [esp + 0xe0]
push str.setup
mov edi, 5
lea ecx, [esp + 0xd0]
call fcn.00405280
test eax, eax
jne 0x40fb43
push 0x104
push 0x451e50
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov eax, 0x451e50
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40fb20
mov esi, dword [esp + 0x18]
sub eax, edx
sar eax, 1
push eax
push 0x451e50
call fcn.00404120
jmp 0x410021
mov eax, dword [esp + 0xe0]
push str.system
mov edi, 6
lea ecx, [esp + 0xd0]
call fcn.00405280
test eax, eax
jne 0x40fb98
push 0x104
lea eax, [esp + 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemWow64DirectoryW]
test eax, eax
jne 0x40fb8e
push 0x104
lea ecx, [esp + 0x108]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov edx, dword [esp + 0x18]
push edx
jmp 0x410015
mov esi, str.system64
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
jne 0x40fffd
mov esi, str.systemcuros
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
jne 0x40fffd
mov esi, str.windir
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40fbf7
push 0x104
lea eax, [esp + 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
jmp 0x410010
mov esi, str.progfilescuros
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40fc4d
call fcn.00423030
test al, al
je 0x40fc32
push 0x104
lea edx, [esp + 0x108]
push edx
push str.ProgramW6432
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
jmp 0x410010
lea eax, [esp + 0x104]
push eax
push 0
push 0
push 0x26
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
jmp 0x410010
mov esi, str.progfilesdir
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40fc82
lea edx, [esp + 0x104]
push edx
push 0
push 0
push 0x26
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov eax, dword [esp + 0x18]
push eax
jmp 0x410015
mov esi, str.progfilesdir64
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40fcb9
push 0x104
lea ecx, [esp + 0x108]
push ecx
push str.ProgramW6432
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov edx, dword [esp + 0x18]
push edx
jmp 0x410015
mov esi, str.progdata
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40fce9
lea eax, [esp + 0x104]
push eax
push 0
push 0
push 0x23
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
jmp 0x410010
mov esi, str.langid
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40fd63
lea edx, [esp + 0x44]
push edx
call fcn.00402440
mov byte [esp + 0x31c], 3
movzx eax, word [0x451b70]
push eax
lea ecx, [esp + 0x50]
push ecx
call fcn.004144a0
lea ecx, [esp + 0x28]
lea eax, [esp + 0x44]
call fcn.00402580
push 0xffffffffffffffff
mov byte [esp + 0x320], 4
mov ecx, dword [esp + 0x1c]
push 0
call fcn.00404070
lea esi, [esp + 0x28]
call fcn.00415850
lea eax, [esp + 0x44]
mov byte [esp + 0x31c], 2
call fcn.00401a10
jmp 0x410021
mov esi, str.startmenu
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
jne 0x40ffe0
mov esi, str.programstartmenu
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
jne 0x40ffe0
mov esi, str.CommonStartMenu
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40fdca
lea edx, [esp + 0x104]
push edx
push 0
push 0
push 0x16
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov eax, dword [esp + 0x18]
push eax
jmp 0x410015
mov esi, str.commonappsdir
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40fdff
lea ecx, [esp + 0x104]
push ecx
push 0
push 0
push 0x2b
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov edx, dword [esp + 0x18]
push edx
jmp 0x410015
mov esi, str.commonappsdir64
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40fe31
push 0x104
lea eax, [esp + 0x108]
push eax
push str.CommonProgramW6432
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
jmp 0x410010
mov esi, str.commonappsdircuros
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40fe87
call fcn.00423030
test al, al
je 0x40fe6c
push 0x104
lea edx, [esp + 0x108]
push edx
push str.CommonProgramW6432
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
jmp 0x410010
lea eax, [esp + 0x104]
push eax
push 0
push 0
push 0x2b
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
jmp 0x410010
mov esi, str.commondesktop
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40febc
lea edx, [esp + 0x104]
push edx
push 0
push 0
push 0x19
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov eax, dword [esp + 0x18]
push eax
jmp 0x410015
mov esi, 0x44664c
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40fee0
mov ecx, dword [esp + 0x18]
push ecx
mov edx, 0x451b72
jmp 0x41001c
mov esi, str.getstring
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40ff39
cmp dword [esp + 0x100], 8
mov eax, dword [esp + 0xec]
jae 0x40ff0d
lea eax, [esp + 0xec]
push 0x104
lea edx, [esp + 0x108]
push edx
push eax
call fcn.00428cca
add esp, 4
mov ecx, eax
mov edx, 0x451b60
call fcn.0041f950
mov eax, dword [esp + 0x18]
push eax
jmp 0x410015
mov esi, str.resource
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40ff5f
call fcn.00406d90
mov ecx, dword [esp + 0x18]
push ecx
mov edx, eax
jmp 0x41001c
mov esi, str.getswitch
lea ecx, [esp + 0xcc]
call fcn.00419320
test al, al
je 0x40ffc2
mov edx, dword [esp + 0xec]
mov esi, 8
cmp dword [esp + 0x100], esi
jae 0x40ff90
lea edx, [esp + 0xec]
call fcn.00401e60
test eax, eax
je 0x410021
cmp dword [esp + 0x100], esi
mov ecx, dword [esp + 0xec]
jae 0x40ffb4
lea ecx, [esp + 0xec]
call fcn.00401f00
mov edx, dword [esp + 0x18]
push edx
mov edx, eax
jmp 0x41001c
mov eax, dword [esp + 0x1c]
push eax
push str.Unknown_variable___s___ignoring
push 0x450638
mov eax, 1
call fcn.0041ee40
add esp, 0xc
jmp 0x410021
lea ecx, [esp + 0x104]
push ecx
push 0
push 0
push 0x17
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov edx, dword [esp + 0x18]
push edx
jmp 0x410015
push 0x104
lea eax, [esp + 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov ecx, dword [esp + 0x18]
push ecx
lea edx, [esp + 0x108]
call fcn.00402b40
mov esi, 8
cmp dword [esp + 0x100], esi
jb 0x41003f
mov edx, dword [esp + 0xec]
push edx
call fcn.004286d5
add esp, 4
xor eax, eax
cmp dword [esp + 0xe4], esi
mov dword [esp + 0x100], 7
mov dword [esp + 0xfc], eax
mov word [esp + 0xec], ax
jb 0x410074
mov eax, dword [esp + 0xd0]
push eax
call fcn.004286d5
add esp, 4
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x314]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x2f8]
xor ecx, esp
call fcn.00426d9a
add esp, 0x30c
ret 4