Function at 0x14005e5f0
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 [0x1400c9008]
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 0x14005e850
mov eax, ebx
cmp dword [rsp + 0x70], r14d
jne 0x14005e642
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 0x14005e850
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 0x14005e850
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 0x14005e850
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 0x14005e850
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 0x14005e850
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 0x14005e850
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 0x14005e7b7
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 0x14005e798
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 0x14005e847
mov dword [rsp + 0x34], ebx
nop word [rax + rax]
cmp ebx, dword [rsp + 0x30]
jae 0x14005e80d
mov eax, ebx
cmp byte [rax + rdi], 0
jne 0x14005e802
mov byte [rax + rdi], 1
lea eax, [rbx + 1]
mov dword [rsp + 0x34], eax
mov ebx, eax
jmp 0x14005e7f0
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 0x14005e850
mov ebx, dword [rsp + 0x40]
mov rdi, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x38]
test rcx, rcx
je 0x14005e860
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
test rdi, rdi
je 0x14005e86e
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, ebx
mov rcx, qword [rsp + 0xd0]
xor rcx, rsp
call fcn.140061b20
add rsp, 0xe0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret