Function at 0x402787
Capabilities:
Get common file path
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x418
mov eax, dword [0x413054]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
cmp dword [esi + 8], 0
push edi
mov dword [ebp - 0x418], 0x80004005
jne 0x4029e6
xor eax, eax
mov edi, 0x206
push edi
push eax
mov word [ebp - 0x20c], ax
lea eax, [ebp - 0x20a]
push eax
call fcn.00406dd0
add esp, 0xc
mov ebx, 0x104
push ebx
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea eax, [ebp - 0x20c]
lea ecx, [eax + 2]
mov dx, word [eax]
add eax, 2
test dx, dx
jne 0x4027ef
sub eax, ecx
sar eax, 1
test eax, eax
jle 0x402823
push 0x5c
add eax, eax
pop ecx
cmp cx, word [ebp + eax - 0x20e]
je 0x402823
mov word [ebp + eax - 0x20c], cx
xor ecx, ecx
mov word [ebp + eax - 0x20a], cx
xor eax, eax
push edi
push eax
mov word [ebp - 0x414], ax
lea eax, [ebp - 0x412]
push eax
call fcn.00406dd0
push 0xffffffffffffffff
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x414]
push ebx
push eax
call fcn.004042cf
push 0xffffffffffffffff
push str.Wintrust.dll
lea eax, [ebp - 0x414]
push ebx
push eax
call fcn.0040495e
add esp, 0x2c
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [esi + 0xc], eax
test eax, eax
je 0x4029ef
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.WinVerifyTrust
push eax
call edi
mov dword [esi + 0x14], eax
test eax, eax
je 0x4029ef
push 0xffffffffffffffff
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x414]
push ebx
push eax
call fcn.004042cf
push 0xffffffffffffffff
push str.Crypt32.dll
lea eax, [ebp - 0x414]
push ebx
push eax
call fcn.0040495e
add esp, 0x20
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [esi + 0x10], eax
test eax, eax
je 0x4029ef
push str.CryptQueryObject
push eax
call edi
push str.CryptMsgGetParam
push dword [esi + 0x10]
mov dword [esi + 0x18], eax
call edi
push str.CryptMsgClose
push dword [esi + 0x10]
mov dword [esi + 0x1c], eax
call edi
push str.CertFindCertificateInStore
push dword [esi + 0x10]
mov dword [esi + 0x20], eax
call edi
push str.CertFreeCertificateContext
push dword [esi + 0x10]
mov dword [esi + 0x24], eax
call edi
push str.CertCloseStore
push dword [esi + 0x10]
mov dword [esi + 0x28], eax
call edi
push str.CertGetNameStringW
push dword [esi + 0x10]
mov dword [esi + 0x2c], eax
call edi
push str.CryptCATAdminAcquireContext
push dword [esi + 0xc]
mov dword [esi + 0x30], eax
call edi
push str.CryptCATAdminReleaseContext
push dword [esi + 0xc]
mov dword [esi + 0x34], eax
call edi
push str.CryptCATAdminCalcHashFromFileHandle
push dword [esi + 0xc]
mov dword [esi + 0x38], eax
call edi
push str.CryptCATAdminEnumCatalogFromHash
push dword [esi + 0xc]
mov dword [esi + 0x3c], eax
call edi
push str.CryptCATAdminReleaseCatalogContext
push dword [esi + 0xc]
mov dword [esi + 0x40], eax
call edi
push str.CryptCATCatalogInfoFromContext
push dword [esi + 0xc]
mov dword [esi + 0x44], eax
call edi
cmp dword [esi + 0x18], 0
mov dword [esi + 0x48], eax
je 0x4029ef
cmp dword [esi + 0x1c], 0
je 0x4029ef
cmp dword [esi + 0x20], 0
je 0x4029ef
cmp dword [esi + 0x24], 0
je 0x4029ef
cmp dword [esi + 0x28], 0
je 0x4029ef
cmp dword [esi + 0x2c], 0
je 0x4029ef
cmp dword [esi + 0x30], 0
je 0x4029ef
mov ecx, dword [esi + 0x34]
test ecx, ecx
je 0x4029ef
cmp dword [esi + 0x38], 0
je 0x4029ef
cmp dword [esi + 0x3c], 0
je 0x4029ef
cmp dword [esi + 0x40], 0
je 0x4029ef
cmp dword [esi + 0x44], 0
je 0x4029ef
test eax, eax
je 0x4029ef
push 0
push 0
lea eax, [esi + 0x4c]
push eax
call ecx
test eax, eax
je 0x4029ef
mov dword [esi + 8], 1
and dword [ebp - 0x418], 0
jmp 0x402a21
mov eax, dword [esi + 0x10]
mov edi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
test eax, eax
je 0x402a03
push eax
call edi
and dword [esi + 0x10], 0
mov eax, dword [esi + 0xc]
test eax, eax
je 0x402a11
push eax
call edi
and dword [esi + 0xc], 0
push 0x38
push 0
add esi, 0x14
push esi
call fcn.00406dd0
add esp, 0xc
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x418]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004042c0
leave
ret 8