Function at 0x1400652f0
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 [section..data]
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 0x14006556a
mov eax, ebx
cmp dword [rsp + 0x70], r14d
jne 0x140065342
mov dword [rsp + 0x5c], 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 0x14006556a
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 0x14006556a
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 0x14006556a
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 0x14006556a
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]
mov dword [rsp + 0x44], eax
test eax, eax
je 0x14006556a
mov eax, dword [rsp + 0x54]
shr eax, 3
add eax, 0xc
mov dword [rsp + 0x44], 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 0x14006556a
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 + 0x60], rdi
mov dword [rsp + 0x34], ebx
mov eax, ebx
mov edx, ebx
mov r8d, ebx
mov ecx, ebx
mov r9, qword [rsp + 0x140]
cmp eax, esi
jae 0x1400654c6
mov eax, esi
sub eax, ecx
dec eax
movzx ecx, byte [rax + r9]
mov eax, edx
mov byte [rax + rdi], cl
lea eax, [r8 + 1]
mov ecx, eax
mov dword [rsp + 0x34], eax
mov edx, eax
mov r8d, eax
jmp 0x1400654a1
lfence
mov r14d, dword [rsp + 0x44]
mov edx, r14d
sub edx, esi
sub edx, 0xf
mov dword [rsp + 0x30], edx
lea ecx, [rsi + 1]
mov rdi, qword [rsp + 0x60]
add rdi, rcx
mov r8, rdi
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test eax, eax
je 0x140065561
mov dword [rsp + 0x34], ebx
mov eax, ebx
mov ecx, ebx
mov r8d, ebx
mov edx, ebx
cmp ebx, dword [rsp + 0x30]
jae 0x140065527
cmp byte [rax + rdi], 0
jne 0x140065515
mov byte [rdx + rdi], 1
mov ecx, r8d
lea eax, [rcx + 1]
mov edx, eax
mov dword [rsp + 0x34], eax
mov ebx, eax
mov ecx, eax
mov r8d, eax
jmp 0x140065502
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 0x14006556a
mov ebx, dword [rsp + 0x40]
mov rdi, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x38]
test rcx, rcx
je 0x14006557a
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
test rdi, rdi
je 0x140065588
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, ebx
mov rcx, qword [rsp + 0xd0]
xor rcx, rsp
call fcn.140068870
add rsp, 0xe0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret