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

Disassembly:
mov eax, 0x426c
call fcn.0041be30
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 + 0xfac]
lea ebx, [esi + 0xf84]
mov dword [esp + 0x30], eax
xor ecx, ecx
mov eax, dword [esi + 0xfb0]
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 + 0xf9c]
push eax
lea eax, [esi + 0xfa4]
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 0x406972
cmp edi, 0x90312
je 0x406972
cmp edi, 0x80090318
je 0x406ea3
add esi, 0x228
cmp edi, 0x80090308
jne 0x40694d
push 0x46ee94
mov ecx, esi
jmp 0x4069dc
cmp edi, 0x80090326
jne 0x40695c
push str.tls___invalid_message
jmp 0x406946
push edi
push str.tls___handshake_failed__0x_X
push 0xff
push esi
call fcn.00403c67
add esp, 0x10
jmp 0x4069e6
cmp dword [esp + 0x38], 5
jne 0x4069aa
mov edx, dword [esp + 0x34]
test edx, edx
je 0x4069aa
mov eax, dword [esi + 0xfb0]
mov ecx, dword [esi + 0xfac]
sub eax, edx
push edx
add eax, ecx
push eax
push ecx
call fcn.0041c780
mov eax, dword [esp + 0x40]
add esp, 0xc
mov dword [esi + 0xfb0], eax
xor eax, eax
jmp 0x4069b2
xor eax, eax
mov dword [esi + 0xfb0], eax
cmp dword [esp + 0x1c], 0
jbe 0x4069ed
push eax
push dword [esp + 0x20]
lea eax, [esp + 0x280]
mov ecx, esi
push eax
call fcn.00406585
test al, al
jne 0x4069ed
push str.tls___handshake_send_failed
lea ecx, [esi + 0x228]
mov edx, 0xff
call fcn.00403e49
xor al, al
jmp 0x406ea5
test edi, edi
jne 0x406ea3
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 + 0xf9c]
push edi
call dword [sym.imp.Secur32.dll_QueryContextAttributesW]
test eax, eax
jne 0x406eb2
cmp dword [esp + 0x48], eax
je 0x406eb2
cmp dword [esp + 0x4c], 4
ja 0x406eb2
push 0xb20
push eax
lea ebp, [esi + 0x460]
push ebp
call fcn.0041cd00
add esp, 0xc
cmp byte [esi + 0xf80], 0
je 0x406d19
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 0x406d03
mov edi, dword [esp + 0x18]
test edi, edi
je 0x406d03
cmp dword [esp + 0x4280], eax
je 0x406cce
push 0xb20
push eax
push ebp
call fcn.0041cd00
add esp, 0xc
cmp byte [esi + 0xf80], 0
jne 0x406aa9
mov bl, 1
jmp 0x406cd0
xor eax, eax
push 0x30
push eax
mov bl, al
lea eax, [esp + 0xb8]
push eax
call fcn.0041cd00
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 0x406af0
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 0x406ca8
cmp dword [esp + 0x14], 0
je 0x406ca8
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 0x406c7c
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 0x406c50
mov eax, dword [esp + 0xa0]
test eax, eax
je 0x406c11
cmp eax, 0x800b0109
je 0x406c11
cmp eax, 0x800b010f
je 0x406c11
cmp eax, 0x800b0101
je 0x406c11
cmp eax, 0x80096004
je 0x406c11
push eax
push str.tls___certificate_error__0x_0X
jmp 0x406c5c
mov eax, dword [esp + 0x10]
mov bl, 1
cmp dword [eax + 0xc], 0
jbe 0x406c70
mov eax, dword [eax + 0x10]
test eax, eax
je 0x406c70
mov eax, dword [eax]
cmp dword [eax + 0xc], 0
jbe 0x406c70
push dword [eax + 0xc]
mov ecx, esi
push dword [eax + 0x10]
push edi
call fcn.0040674c
test al, al
jne 0x406c70
push 0xb20
push 0
push ebp
call fcn.0041cd00
add esp, 0xc
jmp 0x406c70
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.00403c67
add esp, 0x10
push dword [esp + 0x10]
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateChain]
jmp 0x406c9c
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.00403c67
add esp, 0x10
push dword [esp + 0x14]
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateChainEngine]
jmp 0x406cc8
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.00403c67
add esp, 0x10
mov edi, dword [esp + 0x18]
jmp 0x406cd0
xor bl, bl
push edi
call dword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
test bl, bl
jne 0x406d0d
lea ecx, [esi + 0x228]
xor eax, eax
cmp word [ecx], ax
jne 0x406cf7
push str.tls___handshake_validation_failed
mov edx, 0xff
call fcn.00403e49
lea eax, [esi + 0xf84]
push eax
jmp 0x406ec8
push str.tls___handshake_certificate_context_failed
jmp 0x406eb7
lea ebx, [esi + 0xf84]
lea edi, [esi + 0xf9c]
xor eax, eax
push 0x194
push eax
lea eax, [esp + 0xe8]
push eax
call fcn.0041cd00
add esp, 0xc
lea eax, [esp + 0xe0]
push eax
push 0x6e
push edi
call dword [sym.imp.Secur32.dll_QueryContextAttributesW]
test eax, eax
jne 0x406e74
lea edi, [esi + 0x980]
mov ecx, 0x1000
mov word [edi], ax
mov eax, dword [esp + 0xe4]
mov dword [esi + 0x97c], eax
cmp eax, ecx
ja 0x406dca
je 0x406df8
mov ecx, 0x200
cmp eax, ecx
ja 0x406da7
je 0x406d93
push 0x40
mov ecx, eax
pop edx
sub ecx, edx
je 0x406d9d
sub ecx, edx
je 0x406d9d
sub ecx, edx
je 0x406d9d
sub ecx, edx
jne 0x406e14
push str.TLS_v1.1
jmp 0x406e2f
push str.TLS_v1.0
jmp 0x406e2f
cmp eax, 0x300
je 0x406d93
cmp eax, 0x400
je 0x406dc3
cmp eax, 0x800
je 0x406dc3
cmp eax, 0xc00
jne 0x406e14
push str.TLS_v1.2
jmp 0x406e2f
mov ecx, 0x30000
cmp eax, ecx
ja 0x406dff
je 0x406df1
cmp eax, 0x2000
je 0x406df8
cmp eax, 0x3000
je 0x406df8
cmp eax, 0x10000
je 0x406df1
cmp eax, 0x20000
jne 0x406e14
push str.DTLS_v1.0
jmp 0x406e2f
push str.TLS_v1.3
jmp 0x406e2f
cmp eax, 0x40000
je 0x406e2a
cmp eax, 0x80000
je 0x406e2a
cmp eax, 0xc0000
je 0x406e2a
push eax
push 0x46ee88
push 0xff
push edi
call fcn.00403c67
add esp, 0x10
jmp 0x406e3b
push str.DTLS_v1.2
mov edx, 0xff
mov ecx, edi
call fcn.00403be9
lea eax, [esp + 0xe8]
mov edx, 0xff
push eax
mov ecx, edi
call fcn.00403be9
push 0x46ee90
mov edx, 0xff
mov ecx, edi
call fcn.00403be9
lea eax, [esp + 0x1f0]
mov edx, 0xff
push eax
mov ecx, edi
call fcn.00403be9
mov eax, dword [esp + 0x40]
mov dword [esi + 0xfc0], eax
mov eax, dword [esp + 0x44]
mov dword [esi + 0xfc4], eax
mov eax, dword [esp + 0x48]
push ebx
mov dword [esi + 0xfc8], 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.00403e49
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x4069e6