Function at 0x40d320
Capabilities:
Get common file path

Disassembly:
push ebp
lea ebp, [esp - 0x3a4]
sub esp, 0x424
mov eax, dword [0x43c07c]
xor eax, ebp
mov dword [ebp + 0x3a0], eax
push esi
push edi
mov edi, ecx
push str.ProgramFiles64Folder
push edi
call fcn.004065f1
test eax, eax
jne 0x40d39b
mov eax, dword [edi]
sub eax, 0x10
call fcn.00407082
add eax, 0x10
mov dword [ebp - 0x80], eax
push 0x437f48
lea eax, [ebp - 0x80]
call fcn.0040d7b1
test eax, eax
je 0x40d390
lea eax, [ebp - 0x80]
call fcn.004060b8
mov esi, edi
call fcn.004070da
mov eax, dword [ebp - 0x80]
add eax, 0xfffffff0
call fcn.004039c4
mov al, 1
jmp 0x40d5b4
mov eax, dword [ebp - 0x80]
add eax, 0xfffffff0
call fcn.004039c4
push ebx
push str.SystemFolder
lea eax, [ebp - 0x7c]
mov byte [ebp - 0x75], 1
call fcn.004038d0
push dword [eax]
push edi
call fcn.004065f1
mov ebx, eax
mov eax, dword [ebp - 0x7c]
neg ebx
sbb bl, bl
add eax, 0xfffffff0
inc bl
call fcn.004039c4
test bl, bl
je 0x40d3e0
push 0x104
lea eax, [ebp + 0x198]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x40d41e
push str.WindowsFolder
lea eax, [ebp - 0x7c]
call fcn.004038d0
push dword [eax]
push edi
call fcn.004065f1
mov ebx, eax
mov eax, dword [ebp - 0x7c]
neg ebx
sbb bl, bl
add eax, 0xfffffff0
inc bl
call fcn.004039c4
test bl, bl
je 0x40d437
push 0x104
lea eax, [ebp + 0x198]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
add eax, eax
push 0x5c
pop ecx
mov word [ebp + eax + 0x198], cx
xor ecx, ecx
mov word [ebp + eax + 0x19a], cx
jmp 0x40d4ab
push str.WindowsVolume
lea eax, [ebp - 0x7c]
call fcn.004038d0
push dword [eax]
push edi
call fcn.004065f1
mov ebx, eax
mov eax, dword [ebp - 0x7c]
neg ebx
sbb bl, bl
add eax, 0xfffffff0
inc bl
call fcn.004039c4
test bl, bl
je 0x40d480
push 0x104
lea eax, [ebp + 0x198]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
xor eax, eax
mov word [ebp + 0x19e], ax
jmp 0x40d4ab
push str.TempFolder
push edi
call fcn.004065f1
test eax, eax
jne 0x40d4bd
lea eax, [ebp + 0x198]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
xor ecx, ecx
mov word [ebp + eax*2 + 0x198], cx
lea eax, [ebp + 0x198]
push eax
push edi
call fcn.004038ad
jmp 0x40d5b0
push str.SETUPEXEDIR
push edi
call fcn.004065f1
test eax, eax
jne 0x40d517
mov eax, dword [0x43e578]
cmp dword [eax - 0xc], 0
mov esi, 0x43e578
jne 0x40d50b
push 0x105
lea eax, [ebp - 0x74]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
jmp 0x40d4f7
cmp word [ebp + eax*2 - 0x74], 0x5c
je 0x40d4fa
dec eax
jne 0x40d4ef
xor ecx, ecx
mov word [ebp + eax*2 - 0x72], cx
lea eax, [ebp - 0x74]
push eax
push esi
call fcn.004038ad
mov eax, esi
call fcn.004060b8
jmp 0x40d5b0
xor esi, esi
push dword [esi*4 + 0x43d6bc]
push edi
call fcn.004065f1
test eax, eax
je 0x40d530
inc esi
cmp esi, 0xd
jb 0x40d519
cmp esi, 0xd
jae 0x40d5ac
lea eax, [ebp - 0x7c]
push eax
lea esi, [esi*4 + 0x437f14]
push dword [esi]
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
je 0x40d566
push dword [esi]
mov ecx, edi
call fcn.0040d5cb
pop ecx
test al, al
jne 0x40d5b0
call fcn.0040d698
mov byte [ebp - 0x75], al
jmp 0x40d5b0
lea eax, [ebp + 0x198]
push eax
push dword [ebp - 0x7c]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
and dword [ebp - 0x80], 0
mov esi, eax
lea eax, [ebp - 0x80]
push eax
call dword [sym.imp.SHELL32.dll_SHGetMalloc]
mov eax, dword [ebp - 0x80]
push dword [ebp - 0x7c]
mov ecx, dword [eax]
push eax
call dword [ecx + 0x14]
test esi, esi
je 0x40d5ac
lea eax, [ebp + 0x198]
push eax
push edi
call fcn.004038ad
mov esi, edi
call fcn.004070da
jmp 0x40d5b0
mov byte [ebp - 0x75], 0
mov al, byte [ebp - 0x75]
pop ebx
mov ecx, dword [ebp + 0x3a0]
pop edi
xor ecx, ebp
pop esi
call fcn.0042370b
add ebp, 0x3a4
leave
ret