Function at 0x40caf0
Capabilities:
Check if file exists
Get file attributes
Link many functions at runtime

Disassembly:
sub esp, 0x94
push ebx
push ebp
push esi
push edi
xor eax, eax
mov dword [esp + 0x10], 0
xor esi, esi
mov dword [esp + 0x14], 0
push esi
xor ebp, ebp
mov dword [esp + 0x1c], eax
xor ebx, ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov edi, dword [esp + 0xa8]
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40cee2
test al, 0x50
jne 0x40cee2
cmp dword [0x449980], ebx
jne 0x40cc5e
xor eax, eax
push str.crypt32.dll
mov dword [esp + 0x28], eax
call fcn.00408e80
xor ecx, ecx
mov dword [esp + 0x20], eax
add esp, 4
cmp ecx, str.crypt32.dll
je 0x40cb6d
test eax, eax
je 0x40cb80
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esp + 0x24]
mov dword [0x449980], eax
test eax, eax
je 0x40cc5e
push str.CryptMsgClose
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.CertCloseStore
push dword [0x449980]
mov dword [0x449984], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.CertFreeCertificateContext
push dword [0x449980]
mov dword [0x449988], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.CertFindCertificateInStore
push dword [0x449980]
mov dword [0x44998c], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.CryptMsgGetParam
push dword [0x449980]
mov dword [0x449990], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.CryptQueryObject
push dword [0x449980]
mov dword [0x449994], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.CertGetNameStringA
push dword [0x449980]
mov dword [0x449998], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.CryptDecodeObjectEx
push dword [0x449980]
mov dword [0x44999c], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.CertGetIssuerCertificateFromStore
push dword [0x449980]
mov dword [0x4499a0], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, eax
mov dword [0x4499a4], ecx
jmp 0x40cc64
mov ecx, dword [0x4499a4]
cmp dword [0x449984], ebx
je 0x40ce61
cmp dword [0x449988], ebx
je 0x40ce61
cmp dword [0x44998c], ebx
je 0x40ce61
cmp dword [0x449990], ebx
je 0x40ce61
cmp dword [0x449994], ebx
je 0x40ce61
mov eax, dword [0x449998]
test eax, eax
je 0x40ce61
cmp dword [0x44999c], ebx
je 0x40ce61
cmp dword [0x4499a0], ebx
je 0x40ce61
test ecx, ecx
je 0x40ce61
push 0
lea ecx, [esp + 0x18]
push ecx
lea ecx, [esp + 0x18]
push ecx
lea ecx, [esp + 0x3c]
push ecx
lea ecx, [esp + 0x38]
push ecx
lea ecx, [esp + 0x40]
push ecx
push 0
push 2
push 0x400
push edi
push 1
call eax
mov ebx, eax
test ebx, ebx
jne 0x40cd09
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x40cee7
lea eax, [esp + 0x20]
push eax
push 0
push 0
push 6
push dword [esp + 0x24]
call dword [0x449994]
mov ebx, eax
test ebx, ebx
jne 0x40cd31
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x40cee7
push dword [esp + 0x20]
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ebp, eax
test ebp, ebp
jne 0x40cd52
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
xor ebx, ebx
jmp 0x40cee7
lea eax, [esp + 0x20]
push eax
push ebp
push 0
push 6
push dword [esp + 0x24]
call dword [0x449994]
mov ebx, eax
test ebx, ebx
jne 0x40cd79
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x40cee7
mov eax, dword [ebp + 4]
mov dword [esp + 0x4c], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x50], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x38], eax
mov eax, dword [ebp + 0x10]
push 0
mov dword [esp + 0x40], eax
lea eax, [esp + 0x38]
push eax
push 0xb0000
push 0
push 0x10001
push dword [esp + 0x24]
call dword [0x449990]
mov dword [esp + 0x18], eax
test eax, eax
jne 0x40cdc9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
xor ebx, ebx
jmp 0x40cee7
mov edi, dword [esp + 0xac]
test edi, edi
je 0x40cdf3
push eax
call fcn.00409f40
add esp, 4
mov dword [edi], eax
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
mov esi, eax
test esi, esi
jne 0x40cee7
jmp 0x40cdf9
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [esp + 0x10]
push ebp
call fcn.0040b320
add esp, 8
test eax, eax
jne 0x40ce22
push ebp
call fcn.0040b290
add esp, 4
test eax, eax
jne 0x40ce22
xor ebx, ebx
call edi
mov esi, eax
jmp 0x40cee7
cmp dword [0x4499f0], 0
jne 0x40ce56
push 0
push str.wintrust.dll
call fcn.0040a3c0
add esp, 8
mov dword [0x4499f0], eax
test eax, eax
je 0x40ce56
push str.WinVerifyTrust
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x4499f4], eax
jmp 0x40ce5b
mov eax, dword [0x4499f4]
xor ebx, ebx
test eax, eax
jne 0x40ce68
mov esi, 0x7e
jmp 0x40cee7
xor edi, edi
lea ebx, [ebx]
push edi
push dword [esp + 0xac]
call fcn.0040b1e0
add esp, 8
test eax, eax
je 0x40ce8e
inc edi
mov esi, eax
cmp edi, 1
jb 0x40ce70
jmp 0x40ce93
mov ebx, 1
cmp esi, 0x800b010a
jne 0x40cee7
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push eax
mov eax, dword [esp + 0x1c]
push 0
push eax
push dword [esp + 0x1c]
call dword [0x4499a4]
mov edi, eax
test edi, edi
je 0x40cee7
mov ecx, dword [edi + 0xc]
add ecx, 0x44
push ecx
call fcn.00409af0
add esp, 4
test eax, eax
je 0x40ced9
mov ebx, 1
xor esi, esi
push edi
call dword [0x44998c]
jmp 0x40cee7
mov esi, 2
push ebp
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40cefd
push eax
call dword [0x44998c]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40cf0e
push 0
push eax
call dword [0x449988]
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40cf1d
push eax
call dword [0x449984]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x94
ret