Function at 0x140041af0
Capabilities:
Create new key via cryptacquirecontext
Generate random numbers via winapi

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x1e8]
sub rsp, 0x2e8
mov qword [rbp + 8], 0xfffffffffffffffe
mov rax, qword [0x1401411c8]
xor rax, rsp
mov qword [rbp + 0x1d0], rax
mov r13, r9
mov r12, r8
mov r15, rdx
mov r14, qword [rbp + 0x250]
xor eax, eax
mov qword [rsp + 0x68], rax
mov rsi, qword [rcx]
and qword [rsp + 0x78], rax
lea r8, [rsp + 0x78]
lea edx, [rax + 8]
mov rcx, rsi
call qword [sym.imp.api_ms_win_security_cryptoapi_l1_1_0.dll_CryptGenRandom]
test eax, eax
jne 0x140041bfc
mov ebx, 0x80070000
cmp dword [0x140142444], 2
jb 0x140041b9b
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
movzx r8d, ax
or r8d, ebx
test eax, eax
cmovle r8d, eax
mov eax, 0x80004005
test r8d, r8d
cmovns r8d, eax
lea rdx, str.Failed_to_generate_the_certificates_serial_number:_0x_x
mov ecx, 2
call fcn.14003929c
lea rax, section..data
mov rcx, qword [section..data]
cmp rcx, rax
je 0x140041bf5
test byte [rcx + 0x1c], 8
je 0x140041bf5
cmp byte [rcx + 0x19], 2
jb 0x140041bf5
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
movzx r9d, ax
or r9d, ebx
test eax, eax
cmovle r9d, eax
mov eax, 0x80004005
test r9d, r9d
cmovns r9d, eax
mov edx, 0x2e
lea r8, [0x1400ff168]
mov rcx, qword [section..data]
mov rcx, qword [rcx + 0x10]
call fcn.140007608
xor eax, eax
jmp 0x14004243d
mov rdx, rsi
lea rcx, [rbp - 0x70]
call fcn.140041614
nop
mov rdi, qword [rbp - 0x70]
test rdi, rdi
jne 0x140041c19
xor ebx, ebx
jmp 0x14004242c
xor edx, edx
mov r8d, 0xd0
lea rcx, [rbp + 0x30]
call sub.msvcrt.dll_memset
mov ebx, 2
mov dword [rbp + 0x30], ebx
mov dword [rbp + 0x38], 8
lea rax, [rsp + 0x78]
mov qword [rbp + 0x40], rax
lea rax, str.1.2.840.113549.1.1.13
mov qword [rbp + 0x48], rax
mov rdx, qword [r14]
mov rax, qword [rdx + 0x18]
mov ecx, dword [rax + 0x30]
mov dword [rbp + 0x60], ecx
mov rax, qword [rdx + 0x18]
mov rcx, qword [rax + 0x38]
mov qword [rbp + 0x68], rcx
xor eax, eax
mov qword [rbp + 0x100], rax
mov qword [rbp + 0x108], rax
lea rcx, [rbp + 0x100]
call qword [sym.imp.api_ms_win_core_sysinfo_l1_1_0.dll_GetSystemTime]
lea rdx, [rsp + 0x58]
lea rcx, [rbp + 0x100]
call qword [sym.imp.api_ms_win_core_timezone_l1_1_0.dll_SystemTimeToFileTime]
mov rax, qword [rsp + 0x58]
movabs rcx, 0x861c46800
sub rax, rcx
mov dword [rsp + 0x58], eax
shr rax, 0x20
mov dword [rsp + 0x5c], eax
lea rdx, [rbp + 0x100]
lea rcx, [rsp + 0x58]
call qword [sym.imp.api_ms_win_core_timezone_l1_1_0.dll_FileTimeToSystemTime]
lea rdx, [rbp + 0x70]
lea rcx, [rbp + 0x100]
call qword [sym.imp.api_ms_win_core_timezone_l1_1_0.dll_SystemTimeToFileTime]
lea edx, [rbx + 1]
lea rcx, [rbp + 0x100]
call fcn.14003f73c
lea rdx, [rbp + 0x78]
lea rcx, [rbp + 0x100]
call qword [sym.imp.api_ms_win_core_timezone_l1_1_0.dll_SystemTimeToFileTime]
lea r8, [rbp + 0x80]
mov rdx, r15
lea rcx, [rbp - 0x80]
call fcn.140040810
nop
cmp qword [rbp - 0x80], 0
jne 0x140041d18
xor ebx, ebx
jmp 0x140042421
lea rax, str.1.2.840.113549.1.1.1
mov qword [rbp + 0x90], rax
mov eax, dword [rdi + 0x18]
mov dword [rbp + 0xa8], eax
mov eax, dword [rdi + 0x28]
mov dword [rbp + 0xb8], eax
mov rax, qword [rdi + 0x20]
mov qword [rbp + 0xb0], rax
mov rdx, qword [r14]
lea r8, [rbp + 0x110]
mov rdx, qword [rdx + 0x18]
lea rcx, [rsp + 0x58]
call fcn.14004133c
nop
lea r9, [rbp + 0x130]
lea r8, [rbp + 0x90]
mov rdx, rsi
lea rcx, [rbp - 0x68]
call fcn.1400414c0
nop
lea r9, [rbp + 0x150]
mov r8, r13
mov rdx, r12
lea rcx, [rbp - 0x60]
call fcn.140040cc4
nop
lea rdx, [rbp + 0x170]
lea rcx, [rbp - 0x58]
call fcn.140040a50
nop
lea r8, [rbp + 0x190]
mov dl, 0x80
lea rcx, [rbp - 0x50]
call fcn.1400408f8
nop
lea r8, [rbp + 0x1b0]
xor edx, edx
lea rcx, [rbp - 0x48]
call fcn.140040b8c
nop
mov r15, qword [rbp - 0x68]
mov r13, qword [rbp - 0x60]
mov r12, qword [rbp - 0x58]
mov r14, qword [rbp - 0x50]
mov rsi, qword [rbp - 0x48]
cmp qword [rsp + 0x58], 0
je 0x140042377
test r15, r15
je 0x140042377
test r13, r13
je 0x140042377
test r12, r12
je 0x140042377
test r14, r14
je 0x140042377
test rsi, rsi
je 0x140042377
mov dword [rbp + 0xf0], 6
lea rax, [rbp + 0x110]
mov qword [rbp + 0xf8], rax
and qword [rsp + 0x60], 0
mov dword [rsp + 0x20], 0x20
mov r9d, 0x18
lea r8, [0x1400fe710]
lea rdx, str.WebbRootCA
lea rcx, [rsp + 0x60]
call qword [sym.imp.api_ms_win_security_cryptoapi_l1_1_0.dll_CryptAcquireContextW]
test eax, eax
jne 0x140041f06
cmp dword [0x140142444], ebx
jb 0x140041e98
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
movzx r8d, ax
or r8d, 0x80070000
test eax, eax
cmovle r8d, eax
mov eax, 0x80004005
test r8d, r8d
cmovns r8d, eax
lea rdx, str.Cannot_open_signing_authoritys_context:_0x_x
mov ecx, ebx
call fcn.14003929c
lea rax, section..data
mov rcx, qword [section..data]
cmp rcx, rax
je 0x1400423c0
test byte [rcx + 0x1c], 8
je 0x1400423c0
cmp byte [rcx + 0x19], bl
jb 0x1400423c0
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
movzx r9d, ax
or r9d, 0x80070000
test eax, eax
cmovle r9d, eax
mov eax, 0x80004005
test r9d, r9d
cmovns r9d, eax
mov edx, 0x30
lea r8, [0x1400ff168]
mov rcx, qword [section..data]
mov rcx, qword [rcx + 0x10]
call fcn.140007608
jmp 0x1400423c0
lea rax, [rsp + 0x60]
mov qword [rbp + 0x18], rax
mov byte [rbp + 0x20], 1
lea r8, [rbp + 0x10]
mov edx, ebx
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.api_ms_win_security_cryptoapi_l1_1_0.dll_CryptGetUserKey]
xor ecx, ecx
test eax, eax
jne 0x140041f9d
cmp dword [0x140142444], ebx
jb 0x140041f63
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
movzx r8d, ax
or r8d, 0x80070000
test eax, eax
cmovle r8d, eax
mov eax, 0x80004005
test r8d, r8d
cmovns r8d, eax
lea rdx, str.Failed_to_get_signing_authoritys_signing_key:_0x_x
mov ecx, ebx
call fcn.14003929c
lea rax, section..data
mov rcx, qword [section..data]
cmp rcx, rax
je 0x14004208d
test byte [rcx + 0x1c], 8
je 0x14004208d
cmp byte [rcx + 0x19], bl
jb 0x14004208d
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
mov edx, 0x31
jmp 0x140042059
mov dword [rsp + 0x50], ecx
lea rax, str.1.2.840.113549.1.1.13
mov qword [rbp - 0x40], rax
mov dword [rbp - 0x38], ecx
mov qword [rbp - 0x30], rcx
lea rax, [rsp + 0x50]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x38], rcx
mov qword [rsp + 0x30], rcx
lea rax, [rbp - 0x40]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0x30]
mov qword [rsp + 0x20], rax
mov r9, rbx
mov r8d, 1
mov edx, ebx
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.CRYPT32.dll_CryptSignAndEncodeCertificate]
test eax, eax
jne 0x140042094
cmp dword [0x140142444], ebx
jb 0x140042030
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
movzx r8d, ax
or r8d, 0x80070000
test eax, eax
cmovle r8d, eax
mov eax, 0x80004005
test r8d, r8d
cmovns r8d, eax
lea rdx, str.Failed_to_get_encoded_certificate_size:_0x_x
mov ecx, ebx
call fcn.14003929c
lea rax, section..data
mov rcx, qword [section..data]
cmp rcx, rax
je 0x14004208d
test byte [rcx + 0x1c], 8
je 0x14004208d
cmp byte [rcx + 0x19], bl
jb 0x14004208d
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
mov edx, 0x32
movzx r9d, ax
or r9d, 0x80070000
test eax, eax
cmovle r9d, eax
test r9d, r9d
mov eax, 0x80004005
mov rcx, qword [section..data]
cmovns r9d, eax
lea r8, [0x1400ff168]
mov rcx, qword [rcx + 0x10]
call fcn.140007608
xor ebx, ebx
jmp 0x140042368
xor ebx, ebx
mov qword [rbp - 0x78], rbx
mov ecx, dword [rsp + 0x50]
call fcn.1400c1d60
mov qword [rsp + 0x70], rax
test rax, rax
je 0x1400420be
xor ecx, ecx
call qword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void____ptr64_]
mov rbx, qword [rsp + 0x70]
mov qword [rbp - 0x78], rbx
lea rax, [rsp + 0x50]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x38], rbx
and qword [rsp + 0x30], 0
lea rax, [rbp - 0x40]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0x30]
mov qword [rsp + 0x20], rax
mov edx, 2
mov r9d, edx
lea r8d, [rdx - 1]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.CRYPT32.dll_CryptSignAndEncodeCertificate]
test eax, eax
jne 0x140042178
cmp dword [0x140142444], 2
jb 0x14004213d
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
movzx r8d, ax
or r8d, 0x80070000
test eax, eax
cmovle r8d, eax
mov eax, 0x80004005
test r8d, r8d
cmovns r8d, eax
lea rdx, str.Failed_to_encode_and_sign_certificate:_0x_x
mov ecx, 2
call fcn.14003929c
lea rax, section..data
mov rcx, qword [section..data]
cmp rcx, rax
je 0x140042236
test byte [rcx + 0x1c], 8
je 0x140042236
cmp byte [rcx + 0x19], 2
jb 0x140042236
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
mov edx, 0x33
jmp 0x140042202
mov r8d, dword [rsp + 0x50]
mov rdx, rbx
mov ecx, 1
call qword [sym.imp.CRYPT32.dll_CertCreateCertificateContext]
mov qword [rsp + 0x70], rax
xor edx, edx
test rax, rax
jne 0x140042242
cmp dword [0x140142444], 2
jb 0x1400421d8
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
movzx r8d, ax
or r8d, 0x80070000
test eax, eax
cmovle r8d, eax
mov eax, 0x80004005
test r8d, r8d
cmovns r8d, eax
lea rdx, str.Failed_to_get_context_from_encoded_certificate:_0x_x
mov ecx, 2
call fcn.14003929c
lea rax, section..data
mov rcx, qword [section..data]
cmp rcx, rax
je 0x140042236
test byte [rcx + 0x1c], 8
je 0x140042236
cmp byte [rcx + 0x19], 2
jb 0x140042236
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
mov edx, 0x34
movzx r9d, ax
or r9d, 0x80070000
test eax, eax
cmovle r9d, eax
test r9d, r9d
mov eax, 0x80004005
mov rcx, qword [section..data]
cmovns r9d, eax
lea r8, [0x1400ff168]
mov rcx, qword [rcx + 0x10]
call fcn.140007608
xor eax, eax
mov qword [rsp + 0x68], rax
jmp 0x14004235a
lea rcx, str.WebbSSL
mov qword [rbp - 0x28], rcx
mov qword [rbp - 0x20], rdx
mov dword [rbp - 0x18], 0x18
mov qword [rbp - 0x14], 0x20
mov qword [rbp - 8], rdx
mov dword [rbp], 2
lea r9, [rbp - 0x28]
xor r8d, r8d
lea edx, [r8 + 2]
mov rcx, rax
call qword [sym.imp.CRYPT32.dll_CertSetCertificateContextProperty]
test eax, eax
je 0x1400422b3
mov ecx, 8
call fcn.1400c1958
mov qword [rsp + 0x68], rax
mov qword [rbp - 0x78], rax
test rax, rax
je 0x1400422a1
and qword [rax], 0
jmp 0x1400422a6
mov qword [rsp + 0x68], rax
mov rcx, qword [rsp + 0x70]
mov qword [rax], rcx
jmp 0x14004235a
cmp dword [0x140142444], 2
jb 0x1400422f0
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
movzx r8d, ax
or r8d, 0x80070000
test eax, eax
cmovle r8d, eax
mov eax, 0x80004005
test r8d, r8d
cmovns r8d, eax
lea rdx, str.Failed_to_add_private_key_to_the_certificate:_0x_x
mov ecx, 2
call fcn.14003929c
lea rax, section..data
mov rcx, qword [section..data]
cmp rcx, rax
je 0x14004234e
test byte [rcx + 0x1c], 8
je 0x14004234e
cmp byte [rcx + 0x19], 2
jb 0x14004234e
call qword [sym.imp.api_ms_win_downlevel_kernel32_l1_1_0.dll_GetLastError]
movzx r9d, ax
or r9d, 0x80070000
test eax, eax
cmovle r9d, eax
mov eax, 0x80004005
test r9d, r9d
cmovns r9d, eax
mov edx, 0x35
lea r8, [0x1400ff168]
mov rcx, qword [section..data]
mov rcx, qword [rcx + 0x10]
call fcn.140007608
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.CRYPT32.dll_CertFreeCertificateContext]
nop
mov rcx, rbx
call qword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void____ptr64_]
mov rbx, qword [rsp + 0x68]
xor edx, edx
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.api_ms_win_security_cryptoapi_l1_1_0.dll_CryptReleaseContext]
jmp 0x1400423c2
cmp dword [0x140142444], ebx
jb 0x14004238d
lea rdx, str.Initialization_of_extensions_failed_for_certificate
mov ecx, ebx
call fcn.14003929c
lea rax, section..data
mov rcx, qword [section..data]
cmp rcx, rax
je 0x1400423c0
test byte [rcx + 0x1c], 8
je 0x1400423c0
cmp byte [rcx + 0x19], bl
jb 0x1400423c0
mov edx, 0x2f
lea r8, [0x1400ff168]
mov rcx, qword [rcx + 0x10]
call fcn.1400075e4
xor ebx, ebx
test rsi, rsi
je 0x1400423d1
mov rcx, rsi
call qword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalFree]
nop
test r14, r14
je 0x1400423e0
mov rcx, r14
call qword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalFree]
nop
test r12, r12
je 0x1400423ef
mov rcx, r12
call qword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalFree]
nop
test r13, r13
je 0x1400423fe
mov rcx, r13
call qword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalFree]
nop
test r15, r15
je 0x14004240d
mov rcx, r15
call qword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalFree]
nop
cmp qword [rsp + 0x58], 0
je 0x140042421
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalFree]
nop
mov rcx, qword [rbp - 0x80]
call qword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void____ptr64_]
nop
test rdi, rdi
je 0x14004243a
mov rcx, rdi
call qword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void____ptr64_]
mov rax, rbx
mov rcx, qword [rbp + 0x1d0]
xor rcx, rsp
call fcn.1400c20a0
add rsp, 0x2e8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret