Function at 0x5871f0
Capabilities:
Get remote cert context via schannel

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2a8
mov eax, dword [0x83e264]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
call fcn.004db1d0
mov esi, eax
test esi, esi
je 0x587240
mov ecx, dword [esi]
push 0x404
push esi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 5
jl 0x587240
mov eax, dword [esi]
push edi
push str.id_p:_manually_verifying_certifcate_chain_because_a_custom_CA_is_configured.
push 0x404
mov eax, dword [eax]
push 5
push esi
call eax
add esp, 0x14
mov esi, dword [edi + 0xc]
lea eax, [ebp - 0x218]
push eax
push 0x53
mov dword [ebp - 0x218], 0
lea eax, [esi + 0x78]
mov dword [ebp - 0x21c], 0
push eax
mov dword [ebp - 0x214], 0
call sub.Secur32.dll_QueryContextAttributesA
mov ebx, eax
test ebx, ebx
jne 0x58769a
cmp dword [ebp - 0x218], eax
je 0x58769a
xorps xmm0, xmm0
mov dword [ebp - 0x274], eax
movlpd qword [ebp - 0x294], xmm0
movlpd qword [ebp - 0x28c], xmm0
movlpd qword [ebp - 0x284], xmm0
movlpd qword [ebp - 0x27c], xmm0
movlpd qword [ebp - 0x26c], xmm0
mov dword [ebp - 0x298], 0x34
mov eax, dword [esi + 0x90]
mov dword [ebp - 0x270], eax
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x298]
push eax
call dword [sym.imp.CRYPT32.dll_CertCreateCertificateChainEngine]
test eax, eax
jne 0x58736d
call fcn.004db1d0
mov esi, eax
test esi, esi
je 0x587324
mov ecx, dword [esi]
push 0x404
push esi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 2
jl 0x587324
mov eax, dword [esi]
push ebx
push edi
push str.id_p:_failed_to_load_a_certificate_chain_engine_with_SECURITY_STATUS__d._Most_likely__the_configured_CA_is_corrupted.
mov eax, dword [eax]
push 0x404
push 2
push esi
call eax
add esp, 0x18
or ebx, 0xffffffff
mov eax, dword [ebp - 0x214]
test eax, eax
je 0x587338
push eax
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateChain]
mov eax, dword [ebp - 0x21c]
test eax, eax
je 0x587349
push eax
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateChainEngine]
mov ecx, dword [ebp - 0x218]
test ecx, ecx
je 0x58735a
push ecx
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
pop edi
pop esi
mov eax, ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051deb6
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x210]
mov dword [ebp - 0x210], str.1.3.6.1.5.5.7.3.1
mov dword [ebp - 0x234], eax
lea eax, [ebp - 0x214]
push eax
push 0
push 0
lea eax, [ebp - 0x240]
mov dword [ebp - 0x20c], str.1.3.6.1.4.1.311.10.3.3
push eax
mov eax, dword [ebp - 0x218]
mov dword [ebp - 0x208], str.2.16.840.1.113730.4.1
mov dword [ebp - 0x240], 0x10
mov dword [ebp - 0x23c], 1
mov dword [ebp - 0x238], 3
push dword [eax + 0x10]
push 0
push eax
push dword [ebp - 0x21c]
call dword [sym.imp.CRYPT32.dll_CertGetCertificateChain]
test eax, eax
jne 0x58741a
call fcn.004db1d0
mov esi, eax
test esi, esi
je 0x587324
mov ecx, dword [esi]
push 0x404
push esi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 2
jl 0x587324
mov eax, dword [esi]
push 0
push edi
push str.id_p:_unable_to_find_certificate_in_chain_with_SECURITY_STATUS__d.
jmp 0x587315
mov eax, dword [edi + 0xc]
movups xmm0, xmmword [eax + 0xc4]
movd ebx, xmm0
movups xmmword [ebp - 0x2a8], xmm0
mov dword [ebp - 0x224], ebx
cmp ebx, 0xff
jbe 0x587473
call fcn.004db1d0
mov esi, eax
test esi, esi
je 0x587324
mov ecx, dword [esi]
push 0x404
push esi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 2
jl 0x587324
mov eax, dword [esi]
push ebx
push edi
push str.id_p:_host_name_too_long___d_.
jmp 0x587315
push 0x200
lea eax, [ebp - 0x204]
push 0
push eax
call fcn.00520480
add esp, 0xc
lea eax, [ebp - 0x204]
push 0x100
push eax
push ebx
push dword [ebp - 0x2a4]
push 8
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 0x220], eax
cmp eax, ebx
je 0x58750a
call fcn.004db1d0
mov ebx, eax
test ebx, ebx
je 0x587324
mov ecx, dword [ebx]
push 0x404
push ebx
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 2
jl 0x587324
mov esi, dword [ebx]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x220]
mov eax, dword [esi]
push dword [ebp - 0x224]
push edi
push str.id_p:_unable_to_convert_host_to_wstr___d_____d__with_last_error_0x_x.
push 0x404
push 2
push ebx
call eax
add esp, 0x20
jmp 0x587324
lea eax, [ebp - 0x204]
mov dword [ebp - 0x250], 0x10
mov dword [ebp - 0x244], eax
xorps xmm0, xmm0
lea eax, [ebp - 0x250]
mov dword [ebp - 0x24c], 2
mov dword [ebp - 0x228], eax
lea eax, [ebp - 0x264]
push eax
lea eax, [ebp - 0x230]
mov dword [ebp - 0x248], 0
push eax
push dword [ebp - 0x214]
mov dword [ebp - 0x230], 0xc
push 4
mov dword [ebp - 0x22c], 0
movlpd qword [ebp - 0x260], xmm0
movlpd qword [ebp - 0x258], xmm0
mov dword [ebp - 0x264], 0x14
call dword [sym.imp.CRYPT32.dll_CertVerifyCertificateChainPolicy]
test eax, eax
jne 0x5875cf
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call fcn.004db1d0
mov esi, eax
test esi, esi
je 0x587324
mov ecx, dword [esi]
push 0x404
push esi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 2
jl 0x587324
mov eax, dword [esi]
push ebx
push edi
push str.id_p:_CertVerifyCertificateChainPolicy___failed__error_0x_x
jmp 0x587315
cmp dword [ebp - 0x260], 0
je 0x587613
call fcn.004db1d0
mov esi, eax
test esi, esi
je 0x587324
mov ecx, dword [esi]
push 0x404
push esi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 2
jl 0x587324
push dword [ebp - 0x260]
mov eax, dword [esi]
push edi
push str.id_p:_certificate_verification_failed__error_0x_x
jmp 0x587315
mov eax, dword [ebp - 0x214]
mov eax, dword [eax + 0x10]
mov eax, dword [eax]
mov ebx, dword [eax + 4]
and ebx, 0xfffffffd
je 0x58765c
call fcn.004db1d0
mov esi, eax
test esi, esi
je 0x587324
mov ecx, dword [esi]
push 0x404
push esi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 2
jl 0x587324
mov eax, dword [esi]
push ebx
push edi
push str.id_p:_peer_certificate_is_un_trusted_with_SECURITY_STATUS__d.
jmp 0x587315
call fcn.004db1d0
mov esi, eax
test esi, esi
je 0x587693
mov ecx, dword [esi]
push 0x404
push esi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 5
jl 0x587693
mov eax, dword [esi]
push edi
push str.id_p:_peer_certificate_is_trusted.
push 0x404
mov eax, dword [eax]
push 5
push esi
call eax
add esp, 0x14
xor ebx, ebx
jmp 0x587327
call fcn.004db1d0
mov esi, eax
test esi, esi
je 0x5876d2
mov ecx, dword [esi]
push 0x404
push esi
mov ecx, dword [ecx + 4]
call ecx
add esp, 8
cmp eax, 2
jl 0x5876d2
mov eax, dword [esi]
push ebx
push edi
push str.id_p:_failed_to_load_peers_certificate_with_SECURITY_STATUS__d
mov eax, dword [eax]
push 0x404
push 2
push esi
call eax
add esp, 0x18
mov ecx, dword [ebp - 4]
or eax, 0xffffffff
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0051deb6
mov esp, ebp
pop ebp
ret