Function at 0x40bdd0
Capabilities:
Create new key via cryptacquirecontext
Get client handle via schannel
Get inbound credentials handle via credssp
Get outbound credentials handle via credssp

Disassembly:
push ebp
xor eax, eax
mov ebp, esp
push edi
push esi
lea ecx, [ebp - 0x214]
push ebx
sub esp, 0x434
lea esi, [esi]
movzx edx, word [eax + str.Microsoft_Base_Cryptographic_Provider_v1.0]
mov word [ecx + eax], dx
add eax, 2
test dx, dx
jne 0x40bde8
mov dword [ebp - 0x3c8], ecx
mov dword [ebp - 0x3cc], str.WineCryptTemp
mov dword [ebp - 0x3c4], 1
mov dword [ebp - 0x3c0], 0
mov dword [ebp - 0x3bc], 0
mov dword [ebp - 0x3b8], 0
mov dword [ebp - 0x3b4], 2
mov dword [esp + 8], 0x123
mov dword [esp + 4], 0x41e6c0
mov dword [esp], 1
call dword [sym.imp.crypt32.dll_CertCreateCertificateContext]
lea edx, [ebp - 0x3cc]
sub esp, 0xc
mov dword [ebp - 0x408], eax
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0
mov dword [esp + 4], 2
mov dword [esp], eax
call dword [sym.imp.crypt32.dll_CertSetCertificateContextProperty]
sub esp, 0x10
mov ebx, eax
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x662
mov esi, dword fs:[0x18]
mov eax, dword [esi + 0x34]
mov dword [esp], ebx
mov dword [esp + 4], str.CertSetCertificateContextProperty_failed:__08lx
mov dword [esp + 8], eax
call fcn.0040aa60
lea eax, [ebp - 0x404]
mov dword [esp + 0x10], 8
mov ebx, dword [sym.imp.advapi32.dll_CryptAcquireContextW]
mov dword [esp + 0xc], 1
mov dword [esp + 8], str.Microsoft_Base_Cryptographic_Provider_v1.0
mov dword [esp + 4], str.WineCryptTemp
mov dword [esp], eax
call ebx
sub esp, 0x14
mov edi, eax
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x664
mov eax, dword [esi + 0x34]
mov dword [esp], edi
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptAcquireContextW_failed:__08lx_n
call fcn.0040aa60
lea eax, [ebp - 0x400]
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x134
mov dword [esp + 4], 0x4182c0
mov eax, dword [ebp - 0x404]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptImportKey]
sub esp, 0x18
mov edi, eax
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x666
mov eax, dword [esi + 0x34]
mov dword [esp + 4], str.CryptImportKey_failed:__08lx_n
mov dword [esp + 8], eax
mov dword [esp], edi
call fcn.0040aa60
test edi, edi
jne 0x40bf90
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x38c], 4
lea eax, [ebp - 0x408]
mov dword [ebp - 0x34c], eax
lea eax, [ebp - 0x3fc]
mov dword [ebp - 0x388], 0
mov dword [ebp - 0x384], 0
mov dword [ebp - 0x380], 0
mov dword [ebp - 0x37c], 0
mov dword [ebp - 0x378], 0
mov dword [ebp - 0x374], 0
mov dword [ebp - 0x370], 0
mov dword [ebp - 0x368], 0
mov dword [ebp - 0x364], 0
mov dword [ebp - 0x360], 0
mov dword [ebp - 0x354], 4
mov dword [ebp - 0x348], 0
mov dword [ebp - 0x344], 0
mov dword [ebp - 0x340], 0
mov dword [ebp - 0x33c], 0
mov dword [ebp - 0x338], 0
mov dword [ebp - 0x330], 0
mov dword [ebp - 0x32c], 0
mov dword [ebp - 0x328], 0
mov dword [ebp - 0x36c], pe_nt_image_headers32
mov dword [ebp - 0x35c], 0x18
mov dword [ebp - 0x334], 0x40
mov dword [ebp - 0x324], 0x18
mov dword [ebp - 0x350], 1
mov dword [esp + 0x1c], eax
lea eax, [ebp - 0x38c]
mov dword [esp + 0x20], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [esp + 4], str.Microsoft_Unified_Security_Protocol_Provider
mov dword [esp], 0
call sub.secur32.dll_AcquireCredentialsHandleA
sub esp, 0x24
mov edi, eax
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x674
xor eax, eax
test edi, edi
sete al
mov dword [esp + 8], edi
mov dword [esp + 4], 0x41cabf
mov dword [esp], eax
call fcn.0040aa60
test edi, edi
jne 0x40bf85
lea eax, [ebp - 0x3f4]
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], eax
lea eax, [ebp - 0x354]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], str.Microsoft_Unified_Security_Protocol_Provider
mov dword [esp], 0
call sub.secur32.dll_AcquireCredentialsHandleA
sub esp, 0x24
mov esi, eax
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x678
xor eax, eax
test esi, esi
sete al
mov dword [esp + 8], esi
mov dword [esp + 4], 0x41cabf
mov dword [esp], eax
call fcn.0040aa60
test esi, esi
jne 0x40bf85
mov ecx, 0x2000
mov edx, 4
lea eax, [ebp - 0x3b0]
call fcn.00409eb0
mov ecx, 0x2000
mov edx, 4
lea eax, [ebp - 0x3a4]
call fcn.00409eb0
mov ecx, pe_nt_image_headers32
mov edx, 1
lea eax, [ebp - 0x398]
call fcn.00409eb0
mov eax, dword [ebp - 0x390]
mov ecx, 0xc
mov edx, 0x3268
lea edi, [ebp - 0x40c]
mov eax, dword [eax + 8]
mov word [eax + 8], cx
mov dword [eax + 4], 2
mov word [eax + 0x14], dx
mov dword [eax], 0x12
mov byte [eax + 0xa], 8
mov dword [eax + 0xb], 0x70747468
mov dword [eax + 0xf], 0x312e312f
mov byte [eax + 0x13], 2
mov eax, dword [ebp - 0x390]
mov dword [eax + 4], 0x12
mov eax, dword [ebp - 0x390]
mov dword [eax], 0x16
mov eax, dword [ebp - 0x3a8]
mov dword [eax + 4], 2
lea eax, [ebp - 0x3b0]
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x3ec]
mov dword [esp + 0x20], eax
lea eax, [ebp - 0x398]
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x3fc]
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0x8010
mov dword [esp + 8], str.localhost
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.secur32.dll_InitializeSecurityContextA
sub esp, 0x30
mov dword [ebp - 0x410], eax
call fcn.004162e0
mov edx, dword [ebp - 0x410]
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x698
xor eax, eax
cmp edx, 0x90312
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], 0x41cabf
call fcn.0040aa60
mov eax, dword [ebp - 0x39c]
mov dword [eax], 0x2000
mov eax, dword [ebp - 0x39c]
mov dword [eax + 4], 2
mov edx, dword [ebp - 0x390]
mov eax, dword [ebp - 0x3a8]
mov ecx, dword [edx]
mov dword [eax + 0xc], ecx
mov ecx, dword [edx + 4]
mov dword [eax + 0x10], ecx
mov edx, dword [edx + 8]
mov dword [eax + 0x14], edx
lea eax, [ebp - 0x3a4]
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x3e4]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x3b0]
mov dword [esp + 8], eax
lea eax, [ebp - 0x3f4]
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0x10010
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.secur32.dll_AcceptSecurityContext
sub esp, 0x24
mov dword [ebp - 0x410], eax
call fcn.004162e0
mov edx, dword [ebp - 0x410]
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x69f
xor eax, eax
cmp edx, 0x90312
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], 0x41cabf
call fcn.0040aa60
mov eax, dword [ebp - 0x3a8]
mov dword [eax + 0xc], 0
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0
mov dword [ebp - 0x3d8], 0xdeadbeef
mov dword [ebp - 0x3dc], 0xdeadbeef
mov dword [eax], 0x2000
lea eax, [ebp - 0x3b0]
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x3dc]
mov dword [esp + 0x20], eax
lea eax, [ebp - 0x3a4]
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x3ec]
mov dword [esp + 4], eax
lea eax, [ebp - 0x3fc]
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0x8090
mov dword [esp + 8], str.localhost
mov dword [esp], eax
call sub.secur32.dll_InitializeSecurityContextA
sub esp, 0x30
mov dword [ebp - 0x410], eax
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov ecx, dword [ebp - 0x3dc]
mov dword [eax + 4], 0x6a7
mov eax, dword [ebp - 0x3ec]
mov dword [esp + 0xc], ecx
cmp ecx, eax
mov dword [esp + 8], eax
sete al
mov dword [esp + 4], str.dwLower_mismatch__expected__Ix__got__Ix_n
movzx eax, al
mov dword [esp], eax
call fcn.0040aa60
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x6a9
mov ecx, dword [ebp - 0x3d8]
mov eax, dword [ebp - 0x3e8]
mov dword [esp + 4], str.dwUpper_mismatch__expected__Ix__got__Ix_n
mov dword [esp + 0xc], ecx
cmp ecx, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0040aa60
call fcn.004162e0
mov edx, dword [ebp - 0x410]
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x6ab
xor eax, eax
cmp edx, 0x90312
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], 0x41cabf
call fcn.0040aa60
mov eax, dword [ebp - 0x39c]
mov dword [ebp - 0x3d0], 0xdeadbeef
mov dword [ebp - 0x3d4], 0xdeadbeef
mov dword [eax], 0x2000
lea eax, [ebp - 0x3a4]
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x3d4]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x3b0]
mov dword [esp + 8], eax
lea eax, [ebp - 0x3e4]
mov dword [esp + 4], eax
lea eax, [ebp - 0x3f4]
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0x10010
mov dword [esp], eax
call sub.secur32.dll_AcceptSecurityContext
sub esp, 0x24
mov dword [ebp - 0x410], eax
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov ecx, dword [ebp - 0x3d4]
mov dword [eax + 4], 0x6b2
mov eax, dword [ebp - 0x3e4]
mov dword [esp + 0xc], ecx
cmp ecx, eax
mov dword [esp + 8], eax
sete al
mov dword [esp + 4], str.dwLower_mismatch__expected__Ix__got__Ix_n
movzx eax, al
mov dword [esp], eax
call fcn.0040aa60
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x6b4
mov ecx, dword [ebp - 0x3d0]
mov eax, dword [ebp - 0x3e0]
mov dword [esp + 4], str.dwUpper_mismatch__expected__Ix__got__Ix_n
mov dword [esp + 0xc], ecx
cmp ecx, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0040aa60
call fcn.004162e0
mov edx, dword [ebp - 0x410]
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x6b6
xor eax, eax
test edx, edx
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], 0x41cabf
call fcn.0040aa60
mov eax, dword [ebp - 0x3a8]
mov dword [eax], 0x2000
lea eax, [ebp - 0x3b0]
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x3a4]
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x3ec]
mov dword [esp + 4], eax
lea eax, [ebp - 0x3fc]
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], 0
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], pe_nt_image_headers32
mov dword [esp + 8], str.localhost
mov dword [esp], eax
call sub.secur32.dll_InitializeSecurityContextA
sub esp, 0x30
mov edi, eax
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x6bc
xor eax, eax
test edi, edi
sete al
mov dword [esp + 8], edi
mov dword [esp], eax
mov dword [esp + 4], 0x41cabf
call fcn.0040aa60
lea edx, [ebp - 0x31c]
mov eax, esi
mov ecx, 0x42
mov edi, edx
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x3ec]
mov dword [esp + 8], edx
mov dword [esp + 4], 0x23
mov dword [esp], eax
call sub.secur32.dll_QueryContextAttributesA
sub esp, 0xc
mov edi, eax
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x6c0
test edi, edi
je 0x40c76c
mov eax, dword [0x472130]
test eax, eax
jne 0x40c93b
cmp edi, 0x80090302
jne 0x40c93b
mov dword [esp + 8], 0x80090302
mov dword [esp + 4], 0x41cabf
mov dword [esp], 1
call fcn.0040aa60
jmp 0x40c862
mov dword [esp + 8], 0
mov dword [esp + 4], 0x41cabf
mov dword [esp], 1
call fcn.0040aa60
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x6c3
mov eax, dword [ebp - 0x31c]
mov dword [esp + 4], 0x41ce23
cmp eax, 1
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0040aa60
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x6c5
mov eax, dword [ebp - 0x318]
mov dword [esp + 4], 0x41ce23
cmp eax, 2
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0040aa60
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x6c6
movzx edx, byte [ebp - 0x314]
mov dword [esp + 4], 0x41ce23
cmp dl, 8
mov dword [esp + 8], edx
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0040aa60
call fcn.004162e0
mov dword [eax], 0x41c5d6
mov dword [eax + 4], 0x6c7
cmp dword [ebp - 0x313], 0x70747468
je 0x40c958
mov eax, 1
xor eax, 1
mov dword [esp + 4], str.wrong_protocol_id_n
mov dword [esp], eax
call fcn.0040aa60
lea eax, [ebp - 0x3ec]
mov dword [esp], eax
call sub.secur32.dll_DeleteSecurityContext
lea eax, [ebp - 0x3e4]
sub esp, 4
mov dword [esp], eax
call sub.secur32.dll_DeleteSecurityContext
lea eax, [ebp - 0x3fc]
sub esp, 4
mov dword [esp], eax
call sub.secur32.dll_FreeCredentialsHandle
lea eax, [ebp - 0x3f4]
sub esp, 4
mov dword [esp], eax
call sub.secur32.dll_FreeCredentialsHandle
lea eax, [ebp - 0x3b0]
sub esp, 4
call fcn.00409fa0
lea eax, [ebp - 0x3a4]
call fcn.00409fa0
lea eax, [ebp - 0x398]
call fcn.00409fa0
mov eax, dword [ebp - 0x400]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptDestroyKey]
sub esp, 4
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x404]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptReleaseContext]
lea eax, [ebp - 0x404]
sub esp, 8
mov dword [esp + 0x10], 0x10
mov dword [esp + 0xc], 1
mov dword [esp + 8], str.Microsoft_Base_Cryptographic_Provider_v1.0
mov dword [esp + 4], str.WineCryptTemp
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x408]
sub esp, 0x14
mov dword [esp], eax
call dword [sym.imp.crypt32.dll_CertFreeCertificateContext]
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], edi
mov dword [esp + 4], 0x41cabf
mov dword [esp], 0
call fcn.0040aa60
jmp 0x40c862
xor eax, eax
cmp dword [ebp - 0x30f], 0x312e312f
jne 0x40c84a
jmp 0x40c84f