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

Disassembly:
mov eax, 0x426c
call fcn.0041bae0
push ebx
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push esi
mov esi, ecx
mov dword [esp + 0x18], 0x4000
push edi
push 2
pop edx
mov eax, dword [esi + 0xb9c]
lea ebx, [esi + 0xb74]
mov dword [esp + 0x30], eax
xor ecx, ecx
mov eax, dword [esi + 0xba0]
mov dword [esp + 0x28], eax
lea eax, [esp + 0x28]
mov dword [esp + 0x68], eax
lea eax, [esp + 0x278]
mov dword [esp + 0x24], eax
lea eax, [esp + 0x1c]
push ebx
mov dword [esp + 0x30], edx
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x40], ecx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x68], edx
mov dword [esp + 0x64], ecx
mov dword [esp + 0x24], edx
mov dword [esp + 0x5c], 1
mov dword [esp + 0x60], eax
mov dword [esp + 0x58], ecx
call ebp
xor edx, edx
lea ecx, [esp + 0x98]
push edx
push ecx
lea ecx, [esp + 0x5c]
push ecx
push edx
push edx
lea ecx, [esp + 0x74]
push ecx
push edx
push edx
push 0x809c
push edx
lea eax, [esi + 0xb8c]
push eax
lea eax, [esi + 0xb94]
push eax
call dword [sym.imp.Secur32.dll_InitializeSecurityContextW]
push ebx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test edi, edi
je 0x4066e1
cmp edi, 0x90312
je 0x4066e1
cmp edi, 0x80090318
je 0x406c11
lea ecx, [esi + 0x228]
mov edx, 0xff
cmp edi, 0x80090308
jne 0x4066da
push 0x46ee04
jmp 0x406750
push str.tls___handshake_failed
jmp 0x406750
cmp dword [esp + 0x38], 5
jne 0x406719
mov edx, dword [esp + 0x34]
test edx, edx
je 0x406719
mov ecx, dword [esi + 0xb9c]
mov eax, ecx
sub eax, edx
add eax, dword [esi + 0xba0]
push edx
push eax
push ecx
call fcn.0041c430
mov eax, dword [esp + 0x40]
add esp, 0xc
mov dword [esi + 0xba0], eax
xor eax, eax
jmp 0x406721
xor eax, eax
mov dword [esi + 0xba0], eax
cmp dword [esp + 0x1c], 0
jbe 0x40675c
push eax
push dword [esp + 0x20]
lea eax, [esp + 0x280]
mov ecx, esi
push eax
call fcn.0040635c
test al, al
jne 0x40675c
push str.tls___handshake_send_failed
lea ecx, [esi + 0x228]
mov edx, 0xff
call fcn.00403dea
xor al, al
jmp 0x406c13
test edi, edi
jne 0x406c11
xor eax, eax
lea edi, [esp + 0x40]
stosd dword es:[edi], eax
push ebx
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
call ebp
lea eax, [esp + 0x40]
push eax
push 4
lea edi, [esi + 0xb8c]
push edi
call dword [sym.imp.Secur32.dll_QueryContextAttributesW]
test eax, eax
jne 0x406c20
cmp dword [esp + 0x48], eax
je 0x406c20
cmp dword [esp + 0x4c], 4
ja 0x406c20
push 0x720
push eax
lea ebp, [esi + 0x450]
push ebp
call fcn.0041c9b0
add esp, 0xc
cmp byte [esi + 0xb70], 0
je 0x406a87
and dword [esp + 0x18], 0
lea eax, [esp + 0x18]
push eax
push 0x53
push edi
call dword [sym.imp.Secur32.dll_QueryContextAttributesW]
test eax, eax
jne 0x406a71
mov edi, dword [esp + 0x18]
test edi, edi
je 0x406a71
cmp dword [esp + 0x4280], eax
je 0x406a3c
push 0x720
push eax
push ebp
call fcn.0041c9b0
add esp, 0xc
cmp byte [esi + 0xb70], 0
jne 0x406818
mov bl, 1
jmp 0x406a3e
xor eax, eax
push 0x30
push eax
mov bl, al
lea eax, [esp + 0xb8]
push eax
call fcn.0041c9b0
xor edx, edx
mov dword [esp + 0xbc], 0x30
xor ecx, ecx
lea eax, [edi + 0x10]
inc edx
mov dword [esp + 0x20], ecx
add esp, 0xc
mov dword [esp + 0xc8], edx
cmp dword [eax], ecx
je 0x40685f
mov dword [esp + 0xc0], edx
mov dword [esp + 0xc4], eax
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0xb4]
push eax
call dword [sym.imp.CRYPT32.dll_CertCreateCertificateChainEngine]
test eax, eax
je 0x406a16
cmp dword [esp + 0x14], 0
je 0x406a16
xor eax, eax
mov dword [esp + 0x78], 0x10
inc eax
mov dword [esp + 0x84], 0x4921e0
xor ecx, ecx
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], eax
lea eax, [esp + 0x10]
push eax
push ecx
push ecx
lea eax, [esp + 0x84]
mov dword [esp + 0x1c], ecx
push eax
push ecx
push ecx
push edi
push dword [esp + 0x30]
call dword [sym.imp.CRYPT32.dll_CertGetCertificateChain]
test eax, eax
je 0x4069ea
xor eax, eax
mov dword [esp + 0x88], 0x10
mov dword [esp + 0x90], eax
xorps xmm0, xmm0
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x4280]
mov dword [esp + 0x94], eax
lea eax, [esp + 0x88]
mov dword [esp + 0x74], eax
lea eax, [esp + 0x9c]
push eax
lea eax, [esp + 0x70]
movlpd qword [esp + 0xa4], xmm0
push eax
push dword [esp + 0x18]
movlpd qword [esp + 0xb4], xmm0
push 4
mov dword [esp + 0x9c], 2
mov dword [esp + 0x7c], 0xc
mov dword [esp + 0xac], 0x14
call dword [sym.imp.CRYPT32.dll_CertVerifyCertificateChainPolicy]
test eax, eax
je 0x4069be
mov eax, dword [esp + 0xa0]
test eax, eax
je 0x406980
cmp eax, 0x800b0109
je 0x406980
cmp eax, 0x800b010f
je 0x406980
cmp eax, 0x800b0101
je 0x406980
cmp eax, 0x80096004
je 0x406980
push eax
push str.tls___certificate_error__0x_0X
jmp 0x4069ca
mov eax, dword [esp + 0x10]
mov bl, 1
cmp dword [eax + 0xc], 0
jbe 0x4069de
mov eax, dword [eax + 0x10]
test eax, eax
je 0x4069de
mov eax, dword [eax]
cmp dword [eax + 0xc], 0
jbe 0x4069de
push dword [eax + 0xc]
mov ecx, esi
push dword [eax + 0x10]
call fcn.00406523
test al, al
jne 0x4069de
push 0x720
push 0
push ebp
call fcn.0041c9b0
add esp, 0xc
jmp 0x4069de
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.tls___certificate_chain_policy_failed__0x_0X
lea eax, [esi + 0x228]
push 0xff
push eax
call fcn.00403c23
add esp, 0x10
push dword [esp + 0x10]
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateChain]
jmp 0x406a0a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.tls___get_certificate_chain_failed__0x_0X
lea eax, [esi + 0x228]
push 0xff
push eax
call fcn.00403c23
add esp, 0x10
push dword [esp + 0x14]
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateChainEngine]
jmp 0x406a36
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.tls___create_certificate_chain_engine_failed__0x_0X
lea eax, [esi + 0x228]
push 0xff
push eax
call fcn.00403c23
add esp, 0x10
mov edi, dword [esp + 0x18]
jmp 0x406a3e
xor bl, bl
push edi
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
test bl, bl
jne 0x406a7b
lea ecx, [esi + 0x228]
xor eax, eax
cmp word [ecx], ax
jne 0x406a65
push str.tls___handshake_validation_failed
mov edx, 0xff
call fcn.00403dea
lea eax, [esi + 0xb74]
push eax
jmp 0x406c36
push str.tls___handshake_certificate_context_failed
jmp 0x406c25
lea ebx, [esi + 0xb74]
lea edi, [esi + 0xb8c]
xor eax, eax
push 0x194
push eax
lea eax, [esp + 0xe8]
push eax
call fcn.0041c9b0
add esp, 0xc
lea eax, [esp + 0xe0]
push eax
push 0x6e
push edi
call dword [sym.imp.Secur32.dll_QueryContextAttributesW]
test eax, eax
jne 0x406be2
lea edi, [esi + 0x970]
mov ecx, 0x1000
mov word [edi], ax
mov eax, dword [esp + 0xe4]
mov dword [esi + 0x96c], eax
cmp eax, ecx
ja 0x406b38
je 0x406b66
mov ecx, 0x200
cmp eax, ecx
ja 0x406b15
je 0x406b01
push 0x40
mov ecx, eax
pop edx
sub ecx, edx
je 0x406b0b
sub ecx, edx
je 0x406b0b
sub ecx, edx
je 0x406b0b
sub ecx, edx
jne 0x406b82
push str.TLS_v1.1
jmp 0x406b9d
push str.TLS_v1.0
jmp 0x406b9d
cmp eax, 0x300
je 0x406b01
cmp eax, 0x400
je 0x406b31
cmp eax, 0x800
je 0x406b31
cmp eax, 0xc00
jne 0x406b82
push str.TLS_v1.2
jmp 0x406b9d
mov ecx, 0x30000
cmp eax, ecx
ja 0x406b6d
je 0x406b5f
cmp eax, 0x2000
je 0x406b66
cmp eax, 0x3000
je 0x406b66
cmp eax, 0x10000
je 0x406b5f
cmp eax, 0x20000
jne 0x406b82
push str.DTLS_v1.0
jmp 0x406b9d
push str.TLS_v1.3
jmp 0x406b9d
cmp eax, 0x40000
je 0x406b98
cmp eax, 0x80000
je 0x406b98
cmp eax, 0xc0000
je 0x406b98
push eax
push 0x46edf8
push 0xff
push edi
call fcn.00403c23
add esp, 0x10
jmp 0x406ba9
push str.DTLS_v1.2
mov edx, 0xff
mov ecx, edi
call fcn.00403ba5
lea eax, [esp + 0xe8]
mov edx, 0xff
push eax
mov ecx, edi
call fcn.00403ba5
push 0x46ee00
mov edx, 0xff
mov ecx, edi
call fcn.00403ba5
lea eax, [esp + 0x1f0]
mov edx, 0xff
push eax
mov ecx, edi
call fcn.00403ba5
mov eax, dword [esp + 0x40]
mov dword [esi + 0xbb0], eax
mov eax, dword [esp + 0x44]
mov dword [esi + 0xbb4], eax
mov eax, dword [esp + 0x48]
push ebx
mov dword [esi + 0xbb8], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x4284]
mov byte [eax], 1
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x426c
ret 8
push str.tls___handshake_stream_size_failed
lea ecx, [esi + 0x228]
mov edx, 0xff
call fcn.00403dea
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x406755