Function at 0x40c330
Capabilities:
Get common file path
Get program files directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5879cc
mov eax, dword fs:[0]
push eax
sub esp, 0x228
mov eax, dword [0x5f50fc]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [ebp - 0x22c], ebx
mov edi, dword [ebp + 8]
mov dword [ebp - 0x234], edi
mov dword [ebp - 0x220], 0
mov dword [ebp - 0x228], 0
call fcn.00423a43
mov ecx, eax
test ecx, ecx
je 0x40c61a
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x224], esi
mov eax, dword [ebx + 0x638]
mov dword [ebp - 4], 0
cmp dword [eax - 0xc], 0
jne 0x40c4a9
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.00568420
add esp, 0xc
mov dword [ebp - 0x21c], 0
lea eax, [ebp - 0x21c]
push eax
push 0x26
push 0
call sub.SHELL32.dll_SHGetSpecialFolderLocation
test eax, eax
jns 0x40c455
call fcn.00423a43
mov ecx, eax
test ecx, ecx
je 0x40c624
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [edi], eax
mov eax, 0x5cfa60
mov byte [ebp - 4], 1
mov ecx, edi
test eax, 0xffff0000
jne 0x40c421
movzx eax, ax
push eax
call fcn.0040e020
jmp 0x40c42d
push 0
push 0x5cfa60
call fcn.00407520
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x40c5fa
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
jmp 0x40c5fa
lea eax, [ebp - 0x218]
push eax
push dword [ebp - 0x21c]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListW]
push dword [ebp - 0x21c]
call dword [sym.imp.ole32.dll_CoTaskMemFree]
lea ecx, [ebp - 0x218]
mov dword [ebp - 0x21c], 0
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40c487
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
lea ecx, [ebx + 0x638]
call fcn.00407520
mov eax, dword [ebx + 0x658]
lea ecx, [ebp - 0x228]
push ecx
lea ecx, [ebp - 0x220]
push ecx
push str.FolderName
push str._install_folder_
lea ecx, [ebx + 0x658]
call dword [eax + 0x10]
test eax, eax
jne 0x40c545
mov eax, dword [ebx + 0x658]
lea ecx, [ebx + 0x658]
push dword [ebp - 0x220]
call dword [eax + 0x14]
call fcn.00423a43
mov ecx, eax
test ecx, ecx
je 0x40c62e
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [edi], eax
mov eax, 0x5cfa60
mov byte [ebp - 4], 2
mov ecx, edi
test eax, 0xffff0000
jne 0x40c51f
movzx eax, ax
push eax
call fcn.0040e020
jmp 0x40c52b
push 0
push 0x5cfa60
call fcn.00407520
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jmp 0x40c5f0
or ebx, 0xffffffff
cmp dword [ebp + 0xc], 0
je 0x40c5aa
mov ecx, dword [ebp - 0x22c]
lea eax, [ebp - 0x230]
push eax
call fcn.0040d160
mov ecx, dword [eax]
mov eax, dword [ebp - 0x220]
mov byte [ebp - 4], 3
push dword [eax + 0x290]
lea eax, [ebp - 0x224]
push ecx
push str._sCanon_s
push eax
call fcn.00406e60
mov edx, dword [ebp - 0x230]
add esp, 0x10
mov byte [ebp - 4], 0
add edx, 0xfffffff0
mov eax, ebx
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40c5ca
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x40c5ca
mov eax, dword [ebp - 0x220]
push dword [eax + 0x290]
lea eax, [ebp - 0x224]
push str.Canon_s
push eax
call fcn.00406e60
add esp, 0xc
mov esi, dword [ebp - 0x224]
add esi, 0xfffffff0
push esi
call fcn.00406b20
add eax, 0x10
mov dword [ebp - 4], 0xffffffff
add esp, 4
mov dword [edi], eax
lock xadd dword [esi + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x40c5fa
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005663a7
mov esp, ebp
pop ebp
ret 8
push 0x80004005
call fcn.00406af0
push 0x80004005
call fcn.00406af0
push 0x80004005
call fcn.00406af0
int3