Function at 0x14005ef50
Capabilities:
Generate random numbers via winapi

Disassembly:
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xe0
mov rax, qword [0x1400cb008]
xor rax, rsp
mov qword [rsp + 0xd0], rax
mov r14d, r9d
mov r12, r8
mov r15, rdx
mov esi, dword [rsp + 0x148]
mov r13, qword [rsp + 0x150]
xor ebx, ebx
mov dword [rsp + 0x40], ebx
mov edi, ebx
mov qword [rsp + 0x48], rbx
lea eax, [rbx + 1]
mov qword [rsp + 0x38], rbx
mov dword [rsp + 0x30], 0x58
mov dword [rsp + 0x20], eax
lea r9, [rsp + 0x30]
lea r8, [rsp + 0x70]
mov edx, 0x16
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_CryptGetProvParam]
test eax, eax
je 0x14005f1b0
mov eax, ebx
cmp dword [rsp + 0x70], r14d
jne 0x14005efa2
mov dword [rsp + 0x60], 1
lea r9, [rsp + 0x38]
xor r8d, r8d
mov edx, r14d
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_CryptGenKey]
test eax, eax
je 0x14005f1b0
mov dword [rsp + 0x30], 4
mov dword [rsp + 0x20], ebx
lea r9, [rsp + 0x30]
lea r8, [rsp + 0x50]
mov edx, 9
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.ADVAPI32.dll_CryptGetKeyParam]
test eax, eax
je 0x14005f1b0
mov rcx, qword [rsp + 0x38]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov qword [rsp + 0x38], rbx
lea eax, [rsi*8]
cmp eax, dword [rsp + 0x50]
ja 0x14005f1b0
mov dword [rsp + 0x30], 4
mov dword [rsp + 0x20], ebx
lea r9, [rsp + 0x30]
lea r8, [rsp + 0x58]
mov edx, 7
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CryptGetKeyParam]
test eax, eax
je 0x14005f1b0
mov dword [rsp + 0x30], 4
mov dword [rsp + 0x20], ebx
lea r9, [rsp + 0x30]
lea r8, [rsp + 0x54]
mov edx, 9
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CryptGetKeyParam]
test eax, eax
je 0x14005f1b0
mov eax, dword [rsp + 0x54]
shr eax, 3
add eax, 0xc
mov dword [rsp + 0x5c], eax
mov edx, eax
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rdi, rax
mov qword [rsp + 0x48], rax
test rax, rax
je 0x14005f1b0
mov dword [rax], 0x201
mov dword [rax + 4], r14d
mov eax, dword [rsp + 0x58]
mov dword [rdi + 8], eax
add rdi, 0xc
mov qword [rsp + 0x68], rdi
mov ecx, ebx
mov dword [rsp + 0x34], ebx
mov edx, ebx
mov r8, qword [rsp + 0x140]
cmp edx, esi
jae 0x14005f117
mov eax, esi
sub eax, ecx
dec eax
movzx ecx, byte [rax + r8]
mov eax, edx
mov byte [rax + rdi], cl
lea ecx, [rdx + 1]
mov dword [rsp + 0x34], ecx
mov edx, ecx
jmp 0x14005f0f8
lfence
mov r14d, dword [rsp + 0x5c]
mov edx, r14d
sub edx, esi
sub edx, 0xf
mov dword [rsp + 0x30], edx
lea ecx, [rsi + 1]
mov rdi, qword [rsp + 0x68]
add rdi, rcx
mov r8, rdi
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test eax, eax
je 0x14005f1a7
mov dword [rsp + 0x34], ebx
nop word [rax + rax]
cmp ebx, dword [rsp + 0x30]
jae 0x14005f16d
mov eax, ebx
cmp byte [rax + rdi], 0
jne 0x14005f162
mov byte [rax + rdi], 1
lea eax, [rbx + 1]
mov dword [rsp + 0x34], eax
mov ebx, eax
jmp 0x14005f150
lea eax, [r14 - 2]
mov rdi, qword [rsp + 0x48]
mov byte [rax + rdi], 2
mov qword [rsp + 0x28], r13
mov ebx, 1
mov dword [rsp + 0x20], ebx
mov r9, r12
mov r8d, r14d
mov rdx, rdi
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_CryptImportKey]
mov ecx, dword [rsp + 0x40]
test eax, eax
cmovne ecx, ebx
mov ebx, ecx
jmp 0x14005f1b0
mov ebx, dword [rsp + 0x40]
mov rdi, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x38]
test rcx, rcx
je 0x14005f1c0
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
test rdi, rdi
je 0x14005f1ce
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, ebx
mov rcx, qword [rsp + 0xd0]
xor rcx, rsp
call fcn.140062480
add rsp, 0xe0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret