Function at 0x565d53
Capabilities:
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
push esi
push edi
mov edi, ecx
mov eax, dword [edi]
xor ebx, ebx
cmp eax, ebx
je 0x565f3c
cmp dword [edi + 0xc], ebx
je 0x565f3c
cmp dword [edi + 4], ebx
je 0x565f3c
cmp dword [edi + 8], ebx
je 0x565f3c
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.CryptMsgOpenToDecode
push eax
call esi
push ebx
push ebx
push ebx
push ebx
push ebx
push 0x10000
call eax
mov dword [ebp - 4], eax
cmp eax, ebx
je 0x565f3c
push str.CryptMsgUpdate
push dword [edi]
call esi
push 1
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebp - 4]
call eax
test eax, eax
je 0x565f2e
push str.CryptMsgGetParam
push dword [edi]
mov dword [ebp - 0x14], ebx
mov dword [ebp + 0xc], 4
call esi
lea ecx, [ebp + 0xc]
push ecx
lea ecx, [ebp - 0x14]
push ecx
push ebx
push 0x11
push dword [ebp - 4]
mov dword [ebp - 0x10], eax
call eax
test eax, eax
je 0x565f2e
mov dword [ebp + 8], ebx
cmp dword [ebp - 0x14], ebx
jbe 0x565f2e
lea eax, [ebp + 0xc]
push eax
push ebx
push dword [ebp + 8]
push 0x13
push dword [ebp - 4]
call dword [ebp - 0x10]
test eax, eax
je 0x565f1f
push ebx
push 1
push dword [ebp + 0xc]
call fcn.0056f645
add esp, 0xc
lea ecx, [ebp + 0xc]
push ecx
push eax
push dword [ebp + 8]
mov dword [ebp - 0xc], eax
push 0x13
push dword [ebp - 4]
call dword [ebp - 0x10]
test eax, eax
jne 0x565e4f
push ebx
push dword [ebp - 0xc]
call fcn.0056f6c9
pop ecx
pop ecx
jmp 0x565f1f
push str.CertGetSubjectCertificateFromStore
push dword [edi]
call esi
push dword [ebp - 0xc]
push 0x10001
push dword [edi + 0xc]
call eax
push ebx
push dword [ebp - 0xc]
mov dword [ebp - 8], eax
call fcn.0056f6c9
pop ecx
pop ecx
cmp dword [ebp - 8], ebx
je 0x565f1f
mov eax, dword [ebp + 8]
push str.CryptAcquireCertificatePrivateKey
push dword [edi]
mov dword [ebp - 0x28], 0x10
mov dword [ebp - 0x1c], eax
call esi
lea ecx, [ebp - 0x18]
push ecx
lea ecx, [ebp - 0x20]
push ecx
lea ecx, [ebp - 0x24]
push ecx
push ebx
push 0x10000
push dword [ebp - 8]
call eax
test eax, eax
je 0x565f11
push str.CryptMsgControl
push dword [edi]
call esi
lea ecx, [ebp - 0x28]
push ecx
push 2
push ebx
push dword [ebp - 4]
call eax
test eax, eax
je 0x565ee0
mov eax, dword [ebp + 0x14]
push eax
push dword [ebp + 0x10]
mov dword [eax], 0x18
push ebx
push 2
push dword [ebp - 4]
call dword [ebp - 0x10]
test eax, eax
jne 0x565f45
cmp dword [ebp - 0x24], ebx
je 0x565f11
cmp dword [ebp - 0x18], ebx
je 0x565f11
cmp dword [ebp - 0x20], 0xffffffff
je 0x565f02
push str.CryptReleaseContext
push dword [edi + 4]
call esi
push ebx
push dword [ebp - 0x24]
call eax
jmp 0x565f11
push str.NCryptFreeObject
push dword [edi + 8]
call esi
push dword [ebp - 0x24]
call eax
push str.CertFreeCertificateContext
push dword [edi]
call esi
push dword [ebp - 8]
call eax
inc dword [ebp + 8]
mov eax, dword [ebp + 8]
cmp eax, dword [ebp - 0x14]
jb 0x565e02
push str.CryptMsgClose
push dword [edi]
call esi
push dword [ebp - 4]
call eax
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0x10
cmp dword [ebp - 0x24], ebx
je 0x565f76
cmp dword [ebp - 0x18], ebx
je 0x565f76
cmp dword [ebp - 0x20], 0xffffffff
je 0x565f67
push str.CryptReleaseContext
push dword [edi + 4]
call esi
push ebx
push dword [ebp - 0x24]
call eax
jmp 0x565f76
push str.NCryptFreeObject
push dword [edi + 8]
call esi
push dword [ebp - 0x24]
call eax
push str.CertFreeCertificateContext
push dword [edi]
call esi
push dword [ebp - 8]
call eax
push str.CryptMsgClose
push dword [edi]
call esi
push dword [ebp - 4]
call eax
xor eax, eax
inc eax
jmp 0x565f3e