Function at 0x40bd17
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 0x40bd44
cmp dword [ebp + 0xc], 5
je 0x40bd3d
cmp dword [ebp + 0xc], 0x1a
jne 0x40bd44
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 0x40bdb0
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 0x40bdb0
lea eax, [ebp - 0x30]
push eax
call dword [sym.imp.SHELL32.dll_SHGetMalloc]
test eax, eax
jl 0x40bdb0
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, 0x41230c
mov edi, 0x412314
mov esi, 0x412308
je 0x40bdd3
cmp dword [ebp + 0xc], 0x2b
jne 0x40be72
lea eax, [ebp - 0x234]
push 0
push eax
lea ecx, [ebp - 0x4c]
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x38], edi
call fcn.0040399e
push 0x414188
lea ecx, [ebp - 0x4c]
mov dword [ebp - 0x4c], esi
call fcn.0040481e
push 0
push eax
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x10], edi
call fcn.00403a0d
lea ecx, [ebp - 0x4c]
mov dword [ebp - 0x24], esi
call fcn.00401b16
lea ecx, [ebp - 0x24]
call fcn.00401ffc
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40be66
lea eax, [ebp - 0x74]
push 0
push eax
lea ecx, [ebp - 0x24]
call fcn.00404280
add eax, 0x10
mov eax, dword [eax]
test eax, eax
jne 0x40be48
and dword [ebp - 0x2c], eax
jmp 0x40be52
push eax
call dword [sym.imp.OLEAUT32.dll_VariantInit]
mov dword [ebp - 0x2c], eax
lea ecx, [ebp - 0x74]
call fcn.00401b16
cmp dword [ebp - 0x2c], 0
je 0x40be66
and byte [ebp - 5], 0
jmp 0x40be6a
mov byte [ebp - 5], 1
lea ecx, [ebp - 0x24]
call fcn.00401b16
cmp byte [ebp - 6], 0
jne 0x40be7e
cmp byte [ebp - 5], 0
je 0x40be9c
cmp dword [ebp + 0xc], 0x1a
je 0x40c0aa
cmp dword [ebp + 0xc], 0x26
je 0x40bfe3
cmp dword [ebp + 0xc], 0x2b
je 0x40bf33
cmp byte [ebp - 0x234], 0
je 0x40bed5
lea eax, [ebp - 0x234]
push 0
push eax
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x10], edi
call fcn.0040399e
push 0x414188
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x24], esi
mov dword [ebp - 4], 1
call fcn.0040481e
jmp 0x40bef9
lea eax, [ebp - 0x234]
push 0
push eax
lea ecx, [ebp - 0x4c]
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x38], edi
call fcn.0040399e
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.00403a0d
mov edi, dword [ebp + 8]
test byte [ebp - 4], 2
mov dword [edi], esi
je 0x40bf21
and dword [ebp - 4], 0xfffffffd
lea ecx, [ebp - 0x4c]
call fcn.00401b16
test byte [ebp - 4], 1
je 0x40c121
lea ecx, [ebp - 0x24]
jmp 0x40c11c
lea eax, [ebp - 0x24]
push 1
push eax
call fcn.0040c5d9
pop ecx
pop ecx
lea ecx, [ebp - 0x24]
call fcn.00401ffc
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40bf90
lea eax, [ebp - 0x130]
push 0
push eax
lea ecx, [ebp - 0x24]
call fcn.00404280
add eax, 0x10
mov eax, dword [eax]
test eax, eax
jne 0x40bf75
and dword [ebp + 0xc], eax
jmp 0x40bf7f
push eax
call dword [sym.imp.OLEAUT32.dll_VariantInit]
mov dword [ebp + 0xc], eax
lea ecx, [ebp - 0x130]
call fcn.00401b16
cmp dword [ebp + 0xc], 0
jne 0x40bfc2
lea eax, [ebp - 0x4c]
push 0x26
push eax
call fcn.0040bd17
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c369
push eax
lea ecx, [ebp - 0x24]
call fcn.00401ba8
lea ecx, [ebp - 0x4c]
call fcn.00401b16
push str.Common_Files_
lea ecx, [ebp - 0x24]
call fcn.0040481e
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.00403a0d
mov edi, dword [ebp + 8]
lea ecx, [ebp - 0x24]
mov dword [edi], esi
jmp 0x40c11c
lea eax, [ebp - 0x24]
push 0
push eax
call fcn.0040c5d9
pop ecx
pop ecx
lea ecx, [ebp - 0x24]
call fcn.00401ffc
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40c040
lea eax, [ebp - 0xb8]
push 0
push eax
lea ecx, [ebp - 0x24]
call fcn.00404280
add eax, 0x10
mov eax, dword [eax]
test eax, eax
jne 0x40c025
and dword [ebp + 0xc], eax
jmp 0x40c02f
push eax
call dword [sym.imp.OLEAUT32.dll_VariantInit]
mov dword [ebp + 0xc], eax
lea ecx, [ebp - 0xb8]
call fcn.00401b16
cmp dword [ebp + 0xc], 0
jne 0x40c08c
lea eax, [ebp - 0xe0]
push 0
push eax
lea eax, [ebp - 0x90]
push 0
push eax
call fcn.00404045
pop ecx
pop ecx
mov ecx, eax
call fcn.00404280
push eax
lea ecx, [ebp - 0x24]
call fcn.00401ba8
lea ecx, [ebp - 0xe0]
call fcn.00401b16
lea ecx, [ebp - 0x90]
call fcn.00401b16
push str.Program_Files_
lea ecx, [ebp - 0x24]
call fcn.0040c4ec
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.00403a0d
mov edi, dword [ebp + 8]
lea ecx, [ebp - 0x24]
mov dword [edi], esi
jmp 0x40c11c
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x68]
push 5
push eax
call fcn.0040bd17
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c369
mov ecx, eax
call fcn.00404135
push 0
push eax
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x10], edi
call fcn.00403a0d
lea ecx, [ebp - 0x108]
mov dword [ebp - 0x24], esi
call fcn.00401b16
lea ecx, [ebp - 0x68]
call fcn.00401b16
push str.Application_Data_
lea ecx, [ebp - 0x24]
call fcn.0040481e
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.00403a0d
mov edi, dword [ebp + 8]
lea ecx, [ebp - 0x24]
mov dword [edi], esi
call fcn.00401b16
mov eax, edi
pop edi
pop esi
pop ebx
leave
ret