Function at 0x40c020
Capabilities:
Check if file exists
Check os version
Get common file path
Get file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x234
and dword [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_GetVersion]
cmp eax, 0x80000000
jbe 0x40c04d
cmp dword [ebp + 0xc], 5
je 0x40c046
cmp dword [ebp + 0xc], 0x1a
jne 0x40c04d
mov dword [ebp + 0xc], 2
and byte [ebp - 0x234], 0
push ebx
push esi
push edi
push 0x40
xor eax, eax
pop ecx
lea edi, [ebp - 0x233]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x28]
mov byte [ebp - 6], 1
push eax
push dword [ebp + 0xc]
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jl 0x40c0b9
and byte [ebp - 6], 0
lea eax, [ebp - 0x234]
push eax
push dword [ebp - 0x28]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
test eax, eax
je 0x40c0b9
lea eax, [ebp - 0x30]
push eax
call dword [sym.imp.SHELL32.dll_SHGetMalloc]
test eax, eax
jl 0x40c0b9
mov eax, dword [ebp - 0x30]
push dword [ebp - 0x28]
mov ecx, dword [eax]
push eax
call dword [ecx + 0x14]
mov eax, dword [ebp - 0x30]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
and byte [ebp - 5], 0
cmp dword [ebp + 0xc], 0x26
mov ebx, 0x412314
mov edi, 0x41231c
mov esi, 0x412310
je 0x40c0dc
cmp dword [ebp + 0xc], 0x2b
jne 0x40c17b
lea eax, [ebp - 0x234]
push 0
push eax
lea ecx, [ebp - 0x4c]
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x38], edi
call fcn.00403a2f
push 0x4141a4
lea ecx, [ebp - 0x4c]
mov dword [ebp - 0x4c], esi
call fcn.004049b4
push 0
push eax
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x10], edi
call fcn.00403a9e
lea ecx, [ebp - 0x4c]
mov dword [ebp - 0x24], esi
call fcn.00401b39
lea ecx, [ebp - 0x24]
call fcn.00402077
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40c16f
lea eax, [ebp - 0x74]
push 0
push eax
lea ecx, [ebp - 0x24]
call fcn.00404416
add eax, 0x10
mov eax, dword [eax]
test eax, eax
jne 0x40c151
and dword [ebp - 0x2c], eax
jmp 0x40c15b
push eax
call dword [sym.imp.OLEAUT32.dll_VariantInit]
mov dword [ebp - 0x2c], eax
lea ecx, [ebp - 0x74]
call fcn.00401b39
cmp dword [ebp - 0x2c], 0
je 0x40c16f
and byte [ebp - 5], 0
jmp 0x40c173
mov byte [ebp - 5], 1
lea ecx, [ebp - 0x24]
call fcn.00401b39
cmp byte [ebp - 6], 0
jne 0x40c187
cmp byte [ebp - 5], 0
je 0x40c1a5
cmp dword [ebp + 0xc], 0x1a
je 0x40c3b3
cmp dword [ebp + 0xc], 0x26
je 0x40c2ec
cmp dword [ebp + 0xc], 0x2b
je 0x40c23c
cmp byte [ebp - 0x234], 0
je 0x40c1de
lea eax, [ebp - 0x234]
push 0
push eax
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x10], edi
call fcn.00403a2f
push 0x4141a4
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x24], esi
mov dword [ebp - 4], 1
call fcn.004049b4
jmp 0x40c202
lea eax, [ebp - 0x234]
push 0
push eax
lea ecx, [ebp - 0x4c]
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x38], edi
call fcn.00403a2f
mov dword [ebp - 0x4c], esi
mov dword [ebp - 4], 2
lea eax, [ebp - 0x4c]
mov ecx, dword [ebp + 8]
push 0
push eax
mov dword [ecx + 0xc], ebx
mov dword [ecx + 0x14], edi
call fcn.00403a9e
mov edi, dword [ebp + 8]
test byte [ebp - 4], 2
mov dword [edi], esi
je 0x40c22a
and dword [ebp - 4], 0xfffffffd
lea ecx, [ebp - 0x4c]
call fcn.00401b39
test byte [ebp - 4], 1
je 0x40c42a
lea ecx, [ebp - 0x24]
jmp 0x40c425
lea eax, [ebp - 0x24]
push 1
push eax
call fcn.0040c88d
pop ecx
pop ecx
lea ecx, [ebp - 0x24]
call fcn.00402077
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40c299
lea eax, [ebp - 0x130]
push 0
push eax
lea ecx, [ebp - 0x24]
call fcn.00404416
add eax, 0x10
mov eax, dword [eax]
test eax, eax
jne 0x40c27e
and dword [ebp + 0xc], eax
jmp 0x40c288
push eax
call dword [sym.imp.OLEAUT32.dll_VariantInit]
mov dword [ebp + 0xc], eax
lea ecx, [ebp - 0x130]
call fcn.00401b39
cmp dword [ebp + 0xc], 0
jne 0x40c2cb
lea eax, [ebp - 0x4c]
push 0x26
push eax
call fcn.0040c020
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c672
push eax
lea ecx, [ebp - 0x24]
call fcn.00401bcb
lea ecx, [ebp - 0x4c]
call fcn.00401b39
push str.Common_Files_
lea ecx, [ebp - 0x24]
call fcn.004049b4
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x24]
push 0
push eax
mov dword [ecx + 0xc], ebx
mov dword [ecx + 0x14], edi
call fcn.00403a9e
mov edi, dword [ebp + 8]
lea ecx, [ebp - 0x24]
mov dword [edi], esi
jmp 0x40c425
lea eax, [ebp - 0x24]
push 0
push eax
call fcn.0040c88d
pop ecx
pop ecx
lea ecx, [ebp - 0x24]
call fcn.00402077
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40c349
lea eax, [ebp - 0xb8]
push 0
push eax
lea ecx, [ebp - 0x24]
call fcn.00404416
add eax, 0x10
mov eax, dword [eax]
test eax, eax
jne 0x40c32e
and dword [ebp + 0xc], eax
jmp 0x40c338
push eax
call dword [sym.imp.OLEAUT32.dll_VariantInit]
mov dword [ebp + 0xc], eax
lea ecx, [ebp - 0xb8]
call fcn.00401b39
cmp dword [ebp + 0xc], 0
jne 0x40c395
lea eax, [ebp - 0xe0]
push 0
push eax
lea eax, [ebp - 0x90]
push 0
push eax
call fcn.004041db
pop ecx
pop ecx
mov ecx, eax
call fcn.00404416
push eax
lea ecx, [ebp - 0x24]
call fcn.00401bcb
lea ecx, [ebp - 0xe0]
call fcn.00401b39
lea ecx, [ebp - 0x90]
call fcn.00401b39
push str.Program_Files_
lea ecx, [ebp - 0x24]
call fcn.0040c7f5
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x24]
push 0
push eax
mov dword [ecx + 0xc], ebx
mov dword [ecx + 0x14], edi
call fcn.00403a9e
mov edi, dword [ebp + 8]
lea ecx, [ebp - 0x24]
mov dword [edi], esi
jmp 0x40c425
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x68]
push 5
push eax
call fcn.0040c020
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c672
mov ecx, eax
call fcn.004042cb
push 0
push eax
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x10], edi
call fcn.00403a9e
lea ecx, [ebp - 0x108]
mov dword [ebp - 0x24], esi
call fcn.00401b39
lea ecx, [ebp - 0x68]
call fcn.00401b39
push str.Application_Data_
lea ecx, [ebp - 0x24]
call fcn.004049b4
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x24]
push 0
push eax
mov dword [ecx + 0xc], ebx
mov dword [ecx + 0x14], edi
call fcn.00403a9e
mov edi, dword [ebp + 8]
lea ecx, [ebp - 0x24]
mov dword [edi], esi
call fcn.00401b39
mov eax, edi
pop edi
pop esi
pop ebx
leave
ret