Function at 0x180057010
Capabilities:
Create new key via cryptacquirecontext

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x20], r9
mov qword [rax + 0x18], r8
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x2d8]
sub rsp, 0x3a0
xor r14d, r14d
mov rsi, r8
mov rbx, rdx
mov qword [rbp + 0x78], r14
mov rdi, rcx
mov qword [rbp + 0x88], r14
mov r8d, 0xe0
mov qword [rbp + 0x98], r14
lea eax, [r14 + 1]
mov qword [rbp + 0xa8], r14
mov dword [rbp + 0x70], eax
lea rcx, [rbp + 0x1c0]
mov dword [rbp + 0x80], eax
mov r13d, r14d
mov dword [rbp + 0x90], eax
mov r12d, r14d
mov dword [rbp + 0xa0], eax
lea rax, [rbp + 0x70]
mov qword [rsp + 0x48], rax
mov eax, dword [rdx + 0x48]
xor edx, edx
mov dword [rsp + 0x40], r14d
mov dword [rsp + 0x58], eax
mov qword [rsp + 0x5c], r14
call fcn.180071c60
xor edx, edx
lea rcx, [rbp - 0x78]
mov r8d, 0xc8
mov r15d, r14d
call fcn.180071c60
cmp qword [rbx + 0x40], r14
lea rax, [rbp + 0x1c0]
mov r8, qword [rbx + 0x10]
lea rdx, str.2.5.4.3
mov qword [rbp + 0x48], rax
lea rcx, [rbp + 0xc0]
lea rax, str.1.2.840.113549.1.1.5
mov dword [rbp - 0x80], 2
cmovne rax, qword [rbx + 0x40]
mov qword [rbp - 0x68], rax
mov dword [rbp + 0x40], 3
call fcn.180056b5c
test eax, eax
je 0x180057121
mov ecx, dword [rsp + 0x40]
lea rdx, [rbp + 0xc0]
mov eax, ecx
add rax, rax
inc ecx
mov dword [rsp + 0x40], ecx
mov qword [rbp + rax*8 + 0x78], rdx
mov r8, qword [rbx + 0x18]
lea rdx, str.2.5.4.11
lea rcx, [rbp + 0xe0]
call fcn.180056b5c
test eax, eax
je 0x180057157
mov ecx, dword [rsp + 0x40]
lea rdx, [rbp + 0xe0]
mov eax, ecx
add rax, rax
inc ecx
mov dword [rsp + 0x40], ecx
mov qword [rbp + rax*8 + 0x78], rdx
mov r8, qword [rbx + 0x20]
lea rdx, str.2.5.4.10
lea rcx, [rbp + 0x100]
call fcn.180056b5c
test eax, eax
je 0x18005718d
mov ecx, dword [rsp + 0x40]
lea rdx, [rbp + 0x100]
mov eax, ecx
add rax, rax
inc ecx
mov dword [rsp + 0x40], ecx
mov qword [rbp + rax*8 + 0x78], rdx
mov r8, qword [rbx + 0x28]
lea rdx, str.2.5.4.6
lea rcx, [rbp + 0x120]
call fcn.180056b5c
test eax, eax
je 0x1800571c3
mov ecx, dword [rsp + 0x40]
lea rdx, [rbp + 0x120]
mov eax, ecx
add rax, rax
inc ecx
mov dword [rsp + 0x40], ecx
mov qword [rbp + rax*8 + 0x78], rdx
mov r9, rsi
lea rdx, [rbp - 0x38]
mov r8, rbx
lea rcx, [rbp - 0x40]
call fcn.180056dd4
lea r8, [rbp - 0x30]
mov ecx, 7
lea rdx, [rsp + 0x40]
call fcn.1800567d4
test eax, eax
je 0x1800578a0
xor r9d, r9d
mov dword [rsp + 0x20], r14d
lea rdx, [rbp - 0x30]
lea r8d, [r9 + 3]
lea ecx, [r9 + 1]
call qword [sym.imp.CRYPT32.dll_CertNameToStrW]
test eax, eax
je 0x18005721f
mov edx, eax
lea rcx, [rbp - 0x30]
call fcn.180056d68
mov rsi, rax
jmp 0x180057222
mov rsi, r14
test rsi, rsi
je 0x18005723f
mov rdx, rsi
lea rcx, str._s.cert__subject___:__s_n
call fcn.1800090bc
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rsi, qword [rbx + 0x30]
mov eax, 0x14
test rsi, rsi
je 0x1800572a5
or rax, 0xffffffffffffffff
inc rax
cmp word [rsi + rax*2], r14w
jne 0x180057251
mov dword [rbp - 0x78], eax
test al, 1
jne 0x180057274
lea r8, [rbp - 0x78]
mov rcx, rsi
lea rdx, [rbp - 0x70]
call fcn.18000e24c
jmp 0x180057277
mov eax, r14d
test eax, eax
jne 0x1800572e6
mov rdx, rsi
lea rcx, str.ERROR_makeSN___Unable_to_use__s_as_a_HEX_string_n
call fcn.1800090bc
lea rcx, str.ERROR_generateCertificate___Unable_to_create_SN_n
call fcn.1800090bc
mov rcx, qword [rbp - 0x28]
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x1800578ac
mov rdx, rax
mov dword [rbp - 0x78], eax
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rbp - 0x70], rax
test rax, rax
je 0x18005728a
mov edx, dword [rbp - 0x78]
mov rcx, rax
call qword [sym.imp.cryptdll.dll_CDGenerateRandomBits]
test eax, eax
mov esi, r14d
setns sil
test esi, esi
jne 0x1800572e6
mov rcx, qword [rbp - 0x70]
call qword [sym.imp.KERNEL32.dll_LocalFree]
test esi, esi
je 0x18005728a
lea rcx, str._s.cert__serial____:
call fcn.1800090bc
mov edx, dword [rbp - 0x78]
xor r8d, r8d
mov rcx, qword [rbp - 0x70]
call fcn.18000e2ec
lea rcx, [0x1800a38e8]
call fcn.1800090bc
movzx eax, word [rbx + 0x38]
lea rcx, str.2.5.29.15
mov r8, qword [rbp + 0x48]
lea rdx, [rbp + 0x50]
mov word [rbp + 0x2f8], ax
mov esi, 1
lea rax, [rbp + 0x2f8]
mov dword [rbp + 0x50], 2
mov qword [rbp + 0x58], rax
mov qword [r8], rcx
mov dword [r8 + 8], esi
add r8, 0x10
mov dword [rbp + 0x60], 5
call fcn.1800567d4
test eax, eax
je 0x180057885
mov r8, qword [rbp + 0x48]
lea rcx, str.2.5.29.19
lea rdx, [rsp + 0x58]
mov qword [r8 + 0x20], rcx
mov eax, dword [rsp + 0x58]
mov dword [r8 + 0x28], eax
add r8, 0x30
call fcn.1800567d4
test eax, eax
je 0x180057869
mov rdx, qword [rbx + 0x50]
test rdx, rdx
je 0x1800573b8
mov ecx, dword [rbp + 0x40]
mov rax, qword [rbp + 0x48]
movups xmm0, xmmword [rdx]
shl rcx, 5
movups xmmword [rcx + rax], xmm0
movups xmm1, xmmword [rdx + 0x10]
movups xmmword [rcx + rax + 0x10], xmm1
mov eax, dword [rbp + 0x40]
add eax, esi
mov dword [rbp + 0x40], eax
jmp 0x1800573bb
mov eax, dword [rbp + 0x40]
mov rdx, qword [rbx + 0x58]
test rdx, rdx
je 0x1800573e6
movups xmm0, xmmword [rdx]
mov ecx, eax
mov rax, qword [rbp + 0x48]
shl rcx, 5
movups xmmword [rcx + rax], xmm0
movups xmm1, xmmword [rdx + 0x10]
movups xmmword [rcx + rax + 0x10], xmm1
mov eax, dword [rbp + 0x40]
add eax, esi
mov dword [rbp + 0x40], eax
mov rdx, qword [rbx + 0x60]
test rdx, rdx
je 0x18005740c
movups xmm0, xmmword [rdx]
mov ecx, eax
mov rax, qword [rbp + 0x48]
shl rcx, 5
movups xmmword [rcx + rax], xmm0
movups xmm1, xmmword [rdx + 0x10]
movups xmmword [rcx + rax + 0x10], xmm1
add dword [rbp + 0x40], esi
mov rdx, qword [rbp - 0x68]
lea rcx, str._s.cert__algorithm_:__S_n
call fcn.1800090bc
lea rcx, str._s.cert__validity__:
call fcn.1800090bc
lea rcx, [rbp - 0x40]
call fcn.18000e444
lea rcx, str.___
call fcn.1800090bc
lea rcx, [rbp - 0x38]
call fcn.18000e444
lea rcx, [0x1800a38e8]
call fcn.1800090bc
mov rdx, qword [rdi + 8]
lea rcx, str._s.key___provider__:__s_n
call fcn.1800090bc
call fcn.18000e4ec
mov qword [rdi], rax
test rax, rax
je 0x18005784d
mov rdx, rax
lea rcx, str._s.key___container_:__s_n
call fcn.1800090bc
mov r9d, dword [rdi + 0x10]
lea rsi, [rdi + 0x40]
mov r8, qword [rdi + 8]
mov rcx, rsi
xor edx, edx
mov dword [rsp + 0x20], 0xf0000040
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
mov ebx, Ordinal_36
test eax, eax
je 0x180057526
mov rcx, qword [rsi]
lea r9, [rbp + 0x2e8]
lea r8, [rbp + 0x310]
mov dword [rbp + 0x2e8], 4
lea edx, [rbx - 0x1d]
mov dword [rsp + 0x20], r14d
call qword [sym.imp.ADVAPI32.dll_CryptGetProvParam]
test eax, eax
je 0x18005751b
mov r12d, dword [rbp + 0x310]
and r12d, 1
je 0x18005751b
and dword [rdi + 0x14], 0xffffffbf
and dword [rdi + 0x38], 0xfffffffe
mov r8, qword [rdi + 0x30]
test r8, r8
je 0x18005751b
mov rcx, qword [rsi]
xor r9d, r9d
mov edx, ebx
call qword [sym.imp.ADVAPI32.dll_CryptSetProvParam]
test eax, eax
jne 0x18005751b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_makePin___CryptSetProvParam_PP_KEYEXCHANGE_PIN___0x_08x__n
call fcn.1800090bc
mov rcx, qword [rsi]
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, dword [rdi + 0x14]
mov rcx, rsi
mov r9d, dword [rdi + 0x10]
or eax, 8
mov r8, qword [rdi + 8]
mov rdx, qword [rdi]
mov dword [rsp + 0x20], eax
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x18005782e
mov r8, qword [rdi + 0x30]
test r12d, r12d
je 0x180057580
test r8, r8
je 0x180057580
mov rcx, qword [rsi]
xor r9d, r9d
mov edx, ebx
call qword [sym.imp.ADVAPI32.dll_CryptSetProvParam]
test eax, eax
jne 0x180057580
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_makePin___CryptSetProvParam_PP_KEYEXCHANGE_PIN___0x_08x__n
call fcn.1800090bc
movzx edx, word [rdi + 0x3c]
lea rcx, str._s.key___gen___4hu_:
call fcn.1800090bc
movzx r8d, word [rdi + 0x3c]
lea r9, [rsp + 0x70]
mov edx, dword [rdi + 0x28]
mov rcx, qword [rsi]
shl r8d, 0x10
or r8d, dword [rdi + 0x38]
call qword [sym.imp.ADVAPI32.dll_CryptGenKey]
test eax, eax
je 0x180057808
lea rcx, [0x1800b2950]
call fcn.1800090bc
mov edx, dword [rdi + 0x28]
mov rcx, qword [rsi]
call fcn.180056bac
mov r14, rax
test rax, rax
je 0x1800577fb
movups xmm0, xmmword [rax]
mov rbx, qword [rbp + 0x48]
lea rcx, [rbp + 0x140]
mov dword [rbp + 0xb0], Ordinal_27
movaps xmmword [rbp - 0x20], xmm0
movups xmm1, xmmword [rax + 0x10]
movaps xmmword [rbp - 0x10], xmm1
movups xmm0, xmmword [rax + 0x20]
lea rax, [rbp + 0x50]
mov qword [rbp + 0xb8], rax
movaps xmmword [rbp], xmm0
call qword [sym.imp.advapi32.dll_A_SHAInit]
mov r8d, dword [r14 + 0x18]
lea rcx, [rbp + 0x140]
mov rdx, qword [r14 + 0x20]
call qword [sym.imp.advapi32.dll_A_SHAUpdate]
lea rdx, [rbp + 0x50]
lea rcx, [rbp + 0x140]
call qword [sym.imp.advapi32.dll_A_SHAFinal]
lea rcx, str.2.5.29.14
xor r14d, r14d
lea r8, [rbx + 0x50]
mov qword [rbx + 0x40], rcx
lea rdx, [rbp + 0xb0]
mov dword [rbx + 0x48], r14d
call fcn.1800567d4
test eax, eax
je 0x1800577ef
mov eax, dword [rbp + 0x40]
lea rcx, [rbp - 0x50]
mov qword [rsp + 0x30], rcx
lea r9, [rbp + 0x2e8]
mov rcx, qword [rbp + 0x2f0]
lea r8, [rsp + 0x68]
shl rax, 5
add rax, qword [rbp + 0x48]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x50]
mov qword [rsp + 0x20], rax
call fcn.180056ed0
test eax, eax
je 0x180057708
mov eax, dword [rbp + 0x40]
lea r8d, [r14 + 3]
mov r15d, eax
mov dword [rsp + 0x20], r14d
inc eax
shl r15, 5
add r15, qword [rbp + 0x48]
lea rdx, [rbp - 0x50]
xor r9d, r9d
mov dword [rbp + 0x40], eax
lea ecx, [r14 + 1]
call qword [sym.imp.CRYPT32.dll_CertNameToStrW]
test eax, eax
je 0x1800576e6
mov edx, eax
lea rcx, [rbp - 0x50]
call fcn.180056d68
mov rbx, rax
jmp 0x1800576e9
mov rbx, r14
test rbx, rbx
je 0x180057711
mov rdx, rbx
lea rcx, str.__i.cert__subject__:__s_n
call fcn.1800090bc
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x180057711
movaps xmm0, xmmword [rbp - 0x30]
movdqu xmmword [rbp - 0x50], xmm0
lea rcx, str._s.cert__signature_:
call fcn.1800090bc
mov rcx, qword [rsp + 0x68]
mov edx, dword [rbp + 0x2e8]
test rcx, rcx
jne 0x180057733
mov edx, dword [rdi + 0x28]
mov rcx, qword [rsi]
mov rax, qword [rbp + 0x308]
lea r9, [rbp - 0x80]
mov rbx, qword [rbp + 0x300]
mov qword [rsp + 0x30], rax
lea rax, [rbp - 0x68]
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rax
call fcn.180056c60
mov r13d, eax
test eax, eax
je 0x1800577bc
lea rcx, [0x1800b2950]
call fcn.1800090bc
test r12d, r12d
je 0x1800577bc
lea rcx, str._s.key___cert.assoc:
call fcn.1800090bc
mov r8, qword [rbx]
xor r9d, r9d
mov rcx, qword [rsp + 0x70]
lea edx, [r9 + 0x1a]
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x1800577a8
lea rcx, [0x1800b2950]
call fcn.1800090bc
jmp 0x1800577bc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_generateCertificate___CryptSetKeyParam_KP_CERTIFICATE___0x_08x__n
call fcn.1800090bc
test r15, r15
je 0x1800577cb
mov rcx, qword [r15 + 0x18]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov r8, qword [rsp + 0x68]
mov edx, dword [rbp + 0x2e8]
mov ecx, dword [rsp + 0x50]
call fcn.180056e6c
mov rcx, qword [rbp + 0x48]
add rcx, 0x58
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x1800577fb
lea rcx, str.ERROR_generateCertificate___Unable_to_create_SKI_n
call fcn.1800090bc
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
jmp 0x18005781c
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_generateCertificate___CryptGenKey__0x_08x__n
call fcn.1800090bc
test r13d, r13d
jne 0x180057859
mov rcx, qword [rsi]
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
jmp 0x180057842
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_generateCertificate___CryptAcquireContext_CRYPT_NEWKEYSET___0x_08x__n
call fcn.1800090bc
mov rcx, qword [rdi]
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x180057859
lea rcx, str.ERROR_generateCertificate___Unable_to_generate_a_container_name_n
call fcn.1800090bc
mov rcx, qword [rbp + 0x48]
add rcx, 0x38
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x180057875
lea rcx, str.ERROR_generateCertificate___Unable_to_create_BC2_n
call fcn.1800090bc
mov rcx, qword [rbp + 0x48]
add rcx, 0x18
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x180057891
lea rcx, str.ERROR_generateCertificate___Unable_to_create_KU_n
call fcn.1800090bc
mov rcx, qword [rbp - 0x70]
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x180057296
lea rcx, str.ERROR_generateCertificate___Unable_to_create_Subject_n
call fcn.1800090bc
mov eax, r13d
mov rbx, qword [rsp + 0x3e0]
add rsp, 0x3a0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret