Function at 0x180005628
Capabilities:
Create new key via cryptacquirecontext

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x18], r8
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x1f0]
sub rsp, 0x2f0
xor r14d, r14d
mov rbx, rcx
mov rsi, r8
lea eax, [r14 + 1]
mov rdi, rdx
lea rcx, [rbp + 0x118]
mov dword [rbp + 0x50], eax
mov dword [rbp + 0x60], eax
mov dword [rbp + 0x70], eax
mov dword [rbp + 0x80], eax
lea rax, [rbp + 0x50]
mov r8d, 0xd8
mov qword [rsp + 0x48], rax
mov eax, dword [rdx + 0x48]
xor edx, edx
mov r13, r9
mov r12d, r14d
mov r15d, r14d
mov dword [rsp + 0x68], eax
mov qword [rbp + 0x58], r14
mov qword [rbp + 0x68], r14
mov qword [rbp + 0x78], r14
mov qword [rbp + 0x88], r14
mov dword [rsp + 0x40], r14d
mov qword [rsp + 0x6c], r14
mov qword [rbp + 0x110], r14
call fcn.1800cadf0
lea rcx, [rbp - 0x78]
xor edx, edx
mov r8d, Ordinal_203
call fcn.1800cadf0
cmp qword [rdi + 0x40], r12
mov r8, qword [rdi + 0x10]
lea rax, [rbp + 0x110]
lea rdx, str.2.5.4.3
lea rcx, [rbp + 0x90]
mov qword [rbp + 0x48], rax
lea rax, str.1.2.840.113549.1.1.5
mov dword [rbp - 0x80], 2
cmovne rax, qword [rdi + 0x40]
mov dword [rbp + 0x40], 3
mov qword [rbp - 0x68], rax
call fcn.180004e04
test eax, eax
je 0x180005730
mov ecx, dword [rsp + 0x40]
lea rdx, [rbp + 0x90]
mov eax, ecx
add rax, rax
inc ecx
mov qword [rbp + rax*8 + 0x58], rdx
mov dword [rsp + 0x40], ecx
mov r8, qword [rdi + 0x18]
lea rdx, str.2.5.4.11
lea rcx, [rbp + 0xb0]
call fcn.180004e04
test eax, eax
je 0x180005766
mov ecx, dword [rsp + 0x40]
lea rdx, [rbp + 0xb0]
mov eax, ecx
add rax, rax
inc ecx
mov qword [rbp + rax*8 + 0x58], rdx
mov dword [rsp + 0x40], ecx
mov r8, qword [rdi + 0x20]
lea rdx, str.2.5.4.10
lea rcx, [rbp + 0xd0]
call fcn.180004e04
test eax, eax
je 0x18000579c
mov ecx, dword [rsp + 0x40]
lea rdx, [rbp + 0xd0]
mov eax, ecx
add rax, rax
inc ecx
mov qword [rbp + rax*8 + 0x58], rdx
mov dword [rsp + 0x40], ecx
mov r8, qword [rdi + 0x28]
lea rdx, str.2.5.4.6
lea rcx, [rbp + 0xf0]
call fcn.180004e04
test eax, eax
je 0x1800057d2
mov ecx, dword [rsp + 0x40]
lea rdx, [rbp + 0xf0]
mov eax, ecx
add rax, rax
inc ecx
mov qword [rbp + rax*8 + 0x58], rdx
mov dword [rsp + 0x40], ecx
lea rdx, [rbp - 0x38]
lea rcx, [rbp - 0x40]
mov r9, rsi
mov r8, rdi
mov qword [rsp + 0x20], r13
call fcn.18000513c
lea r8, [rbp - 0x30]
lea rdx, [rsp + 0x40]
mov ecx, 7
call fcn.180004964
test eax, eax
je 0x180005d7f
lea rcx, [rbp - 0x30]
call fcn.18000422c
mov rsi, rax
test rax, rax
je 0x18000582e
lea rcx, str._s.cert__subject___:__s_n
mov rdx, rax
call fcn.18004d68c
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rdi + 0x30]
lea rdx, [rbp - 0x78]
call fcn.180004fa0
test eax, eax
je 0x180005d67
lea rcx, str._s.cert__serial____:
call fcn.18004d68c
mov edx, dword [rbp - 0x78]
mov rcx, qword [rbp - 0x70]
xor r8d, r8d
call fcn.180053168
lea rcx, reloc.Cabinet.dll_FCICreate
call fcn.18004d68c
movzx r8d, word [rdi + 0x38]
mov rcx, qword [rbp + 0x48]
mov esi, 1
mov edx, esi
call fcn.180004af4
test eax, eax
je 0x180005d4f
mov rcx, qword [rbp + 0x48]
lea rdx, [rsp + 0x68]
add rcx, 0x20
call fcn.180004de0
test eax, eax
je 0x180005d33
mov rdx, qword [rdi + 0x50]
test rdx, rdx
je 0x1800058cf
mov ecx, dword [rbp + 0x40]
movups xmm0, xmmword [rdx]
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
jmp 0x1800058d2
mov eax, dword [rbp + 0x40]
mov rdx, qword [rdi + 0x58]
test rdx, rdx
je 0x1800058fd
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 [rdi + 0x60]
test rdx, rdx
je 0x180005923
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
call fcn.18004d68c
mov rdx, qword [rbp - 0x68]
mov r8d, 0x80000000
mov ecx, esi
call qword [sym.imp.CRYPT32.dll_CryptFindOIDInfo]
test rax, rax
je 0x18000595a
mov rdx, qword [rax + 0x10]
lea rcx, [0x1800e6f20]
call fcn.18004d68c
lea rcx, str._n_s.cert__validity__:
call fcn.18004d68c
lea rcx, [rbp - 0x40]
call fcn.180053318
lea rcx, [0x1800e6d68]
call fcn.18004d68c
lea rcx, [rbp - 0x38]
call fcn.180053318
lea rcx, reloc.Cabinet.dll_FCICreate
call fcn.18004d68c
mov rdx, qword [rbx + 8]
lea rcx, str._s.key___provider__:__s_n
call fcn.18004d68c
call fcn.180053470
mov qword [rbx], rax
test rax, rax
je 0x180005d17
lea rcx, str._s.key___container_:__s_n
mov rdx, rax
call fcn.18004d68c
mov r9d, dword [rbx + 0x10]
mov r8, qword [rbx + 8]
lea rsi, [rbx + 0x40]
xor edx, edx
mov dword [rsp + 0x20], 0xf0000040
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x180005a35
mov rcx, qword [rsi]
xor r9d, r9d
lea rax, [rsp + 0x54]
mov qword [rsp + 0x28], rax
and qword [rsp + 0x20], r12
lea edx, [r9 + 3]
xor r8d, r8d
call fcn.180045304
test eax, eax
je 0x180005a2a
mov r15d, dword [rsp + 0x54]
and r15d, 1
je 0x180005a2a
mov r8, qword [rbx + 0x30]
mov rcx, qword [rsi]
and dword [rbx + 0x14], 0xffffffbf
and dword [rbx + 0x38], 0xfffffffe
mov edx, r15d
call fcn.180004f10
mov rcx, qword [rsi]
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, dword [rbx + 0x14]
mov r9d, dword [rbx + 0x10]
mov r8, qword [rbx + 8]
mov rdx, qword [rbx]
or eax, 8
mov rcx, rsi
mov dword [rsp + 0x20], eax
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x180005cf8
mov r8, qword [rbx + 0x30]
mov rcx, qword [rsi]
mov edx, r15d
call fcn.180004f10
movzx edx, word [rbx + 0x3c]
lea rcx, str._s.key___gen___4hu_:
call fcn.18004d68c
movzx r8d, word [rbx + 0x3c]
mov edx, dword [rbx + 0x28]
mov rcx, qword [rsi]
shl r8d, 0x10
lea r9, [rsp + 0x60]
or r8d, dword [rbx + 0x38]
call qword [sym.imp.ADVAPI32.dll_CryptGenKey]
test eax, eax
je 0x180005cd2
lea rcx, [0x1800e6de0]
call fcn.18004d68c
mov edx, dword [rbx + 0x28]
mov rcx, qword [rsi]
call fcn.180004e58
test rax, rax
je 0x180005cc5
movups xmm0, xmmword [rax]
mov rcx, qword [rbp + 0x48]
mov rdx, rax
add rcx, 0x40
movaps xmmword [rbp - 0x20], xmm0
movups xmm1, xmmword [rax + 0x10]
movaps xmmword [rbp - 0x10], xmm1
movups xmm0, xmmword [rax + 0x20]
movaps xmmword [rbp], xmm0
call fcn.180004be4
test eax, eax
je 0x180005cb9
mov eax, dword [rbp + 0x40]
lea rcx, [rbp - 0x50]
lea r9, [rbp + 0x238]
mov qword [rsp + 0x30], rcx
mov rcx, qword [rbp + 0x240]
shl rax, 5
add rax, qword [rbp + 0x48]
lea r8, [rsp + 0x58]
mov rdx, r13
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x50]
mov qword [rsp + 0x20], rax
call fcn.180005274
test eax, eax
je 0x180005b6f
mov eax, dword [rbp + 0x40]
lea rcx, [rbp - 0x50]
mov r14d, eax
inc eax
shl r14, 5
mov dword [rbp + 0x40], eax
add r14, qword [rbp + 0x48]
call fcn.18000422c
mov rdi, rax
test rax, rax
je 0x180005b78
lea rcx, str.__i.cert__subject__:__s_n
mov rdx, rax
call fcn.18004d68c
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x180005b78
movaps xmm0, xmmword [rbp - 0x30]
movdqu xmmword [rbp - 0x50], xmm0
lea rcx, str._s.cert__signature_:
call fcn.18004d68c
mov rcx, qword [rsp + 0x58]
mov edx, dword [rbp + 0x238]
test rcx, rcx
jne 0x180005b9a
mov edx, dword [rbx + 0x28]
mov rcx, qword [rsi]
mov rax, qword [rbp + 0x258]
mov rdi, qword [rbp + 0x250]
lea r9, [rbp - 0x80]
mov qword [rsp + 0x30], rax
lea rax, [rbp - 0x68]
mov r8d, 2
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x20], rax
call fcn.180005030
mov r12d, eax
test eax, eax
je 0x180005c86
lea rcx, [0x1800e6de0]
call fcn.18004d68c
test r15d, r15d
je 0x180005c2d
lea rcx, str._s.key___cert.assoc:
call fcn.18004d68c
mov r8, qword [rdi]
mov rcx, qword [rsp + 0x60]
xor r9d, r9d
lea edx, [r9 + 0x1a]
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x180005c19
lea rcx, [0x1800e6de0]
call fcn.18004d68c
jmp 0x180005c2d
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.ERROR_generateCertificate___CryptSetKeyParam_KP_CERTIFICATE___0x_08x__n
mov edx, eax
call fcn.18004d68c
mov rdi, qword [rbp + 0x260]
test rdi, rdi
je 0x180005c86
mov rax, qword [rsi]
mov ecx, 0x40
mov qword [rdi], rax
mov eax, dword [rbx + 0x28]
mov dword [rdi + 8], eax
mov rax, qword [rbp - 0x40]
mov qword [rdi + 0xc], rax
mov rax, qword [rbp - 0x38]
mov qword [rdi + 0x14], rax
mov eax, dword [rbp - 0x30]
mov edx, eax
mov dword [rdi + 0x20], eax
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rdi + 0x28], rax
test rax, rax
je 0x180005c83
mov r8d, dword [rdi + 0x20]
mov rdx, qword [rbp - 0x28]
mov rcx, rax
call fcn.1800ca790
jmp 0x180005c86
xor r12d, r12d
test r14, r14
je 0x180005c95
mov rcx, qword [r14 + 0x18]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov r8, qword [rsp + 0x58]
mov edx, dword [rbp + 0x238]
mov ecx, dword [rsp + 0x50]
call fcn.18000520c
mov rcx, qword [rbp + 0x48]
add rcx, 0x58
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x180005cc5
lea rcx, str.ERROR_generateCertificate___Unable_to_create_SKI_n
call fcn.18004d68c
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
jmp 0x180005ce6
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.ERROR_generateCertificate___CryptGenKey__0x_08x__n
mov edx, eax
call fcn.18004d68c
test r12d, r12d
jne 0x180005d23
mov rcx, qword [rsi]
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
jmp 0x180005d0c
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.ERROR_generateCertificate___CryptAcquireContext_CRYPT_NEWKEYSET___0x_08x__n
mov edx, eax
call fcn.18004d68c
mov rcx, qword [rbx]
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x180005d23
lea rcx, str.ERROR_generateCertificate___Unable_to_generate_a_container_name_n
call fcn.18004d68c
mov rcx, qword [rbp + 0x48]
add rcx, 0x38
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x180005d3f
lea rcx, str.ERROR_generateCertificate___Unable_to_create_BC2_n
call fcn.18004d68c
mov rcx, qword [rbp + 0x48]
add rcx, 0x18
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x180005d5b
lea rcx, str.ERROR_generateCertificate___Unable_to_create_KU_n
call fcn.18004d68c
mov rcx, qword [rbp - 0x70]
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x180005d73
lea rcx, str.ERROR_generateCertificate___Unable_to_create_SN_n
call fcn.18004d68c
mov rcx, qword [rbp - 0x28]
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x180005d8b
lea rcx, str.ERROR_generateCertificate___Unable_to_create_Subject_n
call fcn.18004d68c
mov eax, r12d
mov rbx, qword [rsp + 0x330]
add rsp, 0x2f0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret