Function at 0x14005e060
Capabilities:
Create new key via cryptacquirecontext

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
mov qword [rsp + 0x18], rdi
mov qword [rsp + 0x20], r12
push r13
push r14
push r15
sub rsp, 0x50
mov rsi, r9
mov r14d, r8d
mov r15, rdx
xor edi, edi
mov dword [rsp + 0x38], edi
mov r13d, edi
mov qword [rsp + 0x40], rdi
mov rcx, qword [rsp + 0x98]
mov qword [rcx], rdi
mov r12, qword [rsp + 0xa0]
mov qword [r12], rdi
mov ebx, dword [rsp + 0x90]
lea eax, [rbx - 1]
cmp eax, 1
ja 0x14005e2b1
mov dword [rsp + 0x20], 8
mov r9d, r8d
mov r8, rdx
mov rdx, rsi
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x14005e113
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x8009000f
jne 0x14005e2b6
mov dword [rsp + 0x20], edi
mov r9d, r14d
mov r8, r15
mov rdx, rsi
mov rsi, qword [rsp + 0x98]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x14005e2be
jmp 0x14005e11b
mov rsi, qword [rsp + 0x98]
mov r9, r12
mov r14d, 1
mov r8d, r14d
mov edx, ebx
mov rcx, qword [rsi]
call qword [sym.imp.ADVAPI32.dll_CryptGenKey]
test eax, eax
je 0x14005e2be
lea rax, [rsp + 0x34]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rdi
xor r9d, r9d
xor edx, edx
lea r8d, [r14 + 6]
mov rcx, qword [r12]
call qword [sym.imp.ADVAPI32.dll_CryptExportKey]
test eax, eax
je 0x14005e2be
mov edx, dword [rsp + 0x34]
lea ecx, [r14 + 0x3f]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov r13, rax
mov qword [rsp + 0x40], rax
test rax, rax
je 0x14005e2be
lea rax, [rsp + 0x34]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], r13
xor r9d, r9d
xor edx, edx
lea r8d, [r14 + 6]
mov rcx, qword [r12]
call qword [sym.imp.ADVAPI32.dll_CryptExportKey]
test eax, eax
je 0x14005e2be
mov rcx, qword [r12]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov qword [r12], rdi
lea rbx, [r13 + 0xc]
test rbx, rbx
je 0x14005e1c8
mov ebx, dword [rbx]
jmp 0x14005e1da
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], 0x16
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
lea r8, [r13 + 0x10]
mov edx, edi
mov dword [rsp + 0x30], edx
cmp edx, 4
jge 0x14005e1fb
movsxd rax, edx
lea rcx, [rax + r8]
test edx, edx
sete al
mov byte [rcx], al
inc edx
jmp 0x14005e1e0
mov ecx, ebx
mov eax, ebx
shr rax, 4
shr rcx, 3
add rcx, r8
lea r8, [rax + 2]
lea r8, [rcx + r8*2]
mov edx, edi
mov dword [rsp + 0x30], edx
mov eax, ebx
shr eax, 4
cmp edx, eax
jae 0x14005e233
movsxd rax, edx
lea rcx, [rax + r8]
test edx, edx
sete al
mov byte [rcx], al
inc edx
jmp 0x14005e214
mov eax, ebx
shr rax, 4
add r8, rax
mov edx, edi
mov dword [rsp + 0x30], edx
mov eax, ebx
shr eax, 4
cmp edx, eax
jae 0x14005e25d
movsxd rax, edx
lea rcx, [rax + r8]
test edx, edx
sete al
mov byte [rcx], al
inc edx
jmp 0x14005e23e
mov eax, ebx
shr rax, 4
lea r9, [r8 + rax*2]
mov edx, edi
mov dword [rsp + 0x30], edx
mov eax, ebx
shr eax, 3
cmp edx, eax
jae 0x14005e288
movsxd rax, edx
lea rcx, [rax + r9]
test edx, edx
sete al
mov byte [rcx], al
inc edx
jmp 0x14005e269
mov qword [rsp + 0x28], r12
mov dword [rsp + 0x20], edi
xor r9d, r9d
mov r8d, dword [rsp + 0x34]
mov rdx, r13
mov rcx, qword [rsi]
call qword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
cmovne edi, r14d
mov dword [rsp + 0x38], edi
jmp 0x14005e2be
mov rsi, rcx
jmp 0x14005e2be
mov rsi, qword [rsp + 0x98]
test r13, r13
je 0x14005e2cc
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_LocalFree]
test edi, edi
jne 0x14005e2ef
mov rcx, qword [r12]
test rcx, rcx
je 0x14005e2df
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov rcx, qword [rsi]
test rcx, rcx
je 0x14005e2ef
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, edi
lea r11, [rsp + 0x50]
mov rbx, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x28]
mov rdi, qword [r11 + 0x30]
mov r12, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop r13
ret