Function at 0x1400589ec
Capabilities:
Generate random numbers via winapi

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
mov qword [rsp + 0x18], r8
push rbp
push r14
push r15
mov rbp, rsp
sub rsp, 0x50
mov r14, rdx
mov rbx, rcx
test rdx, rdx
je 0x140058b9a
cmp qword [rcx], 0
lea r15, vtable.McCryptoLib::CWinError.0
jne 0x140058b10
xor r9d, r9d
lea rdx, [0x14012b300]
xor r8d, r8d
lea rcx, [rbp + 0x30]
call qword [sym.imp.bcrypt.dll_BCryptOpenAlgorithmProvider]
mov rcx, qword [rbx]
mov rdx, r15
mov dword [rbp - 0x18], eax
mov rax, qword [rbp + 0x30]
mov qword [rbx], rax
mov qword [rbp - 0x20], rdx
test rcx, rcx
je 0x140058a63
xor edx, edx
call qword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov rdx, qword [rbp - 0x20]
mov rax, qword [rdx + 8]
lea rcx, [rbp - 0x20]
call qword [case.0x14005c601.0]
test eax, eax
lea rcx, [rbp - 0x20]
mov rax, qword [rbp - 0x20]
mov rax, qword [rax + 8]
je 0x140058ac8
call qword [case.0x14005c601.0]
mov ecx, eax
call fcn.140058ca0
mov qword [rsp + 0x28], rax
lea r8, str.E:BT0d644dee_4938_4dd1_adb5_57a9b8943c6dCoreTechMcCryptoLib_srcwindowswin_random.cpp
mov r9d, 0x36
lea rax, str.McCryptoLib::CMcCryptoRandomWin::Initialize
lea rdx, str.__S:__d____S___s:_Error_trying_to_Initialize_BCryptOpenAlgorithmProvider
mov qword [rsp + 0x20], rax
lea ecx, [r9 - 0x34]
call fcn.140058d88
mov rax, qword [rbp - 0x20]
lea rcx, [rbp - 0x20]
mov rax, qword [rax + 8]
call qword [case.0x14005c601.0]
mov esi, eax
test eax, eax
je 0x140058b10
mov ecx, eax
call fcn.140058ca0
mov qword [rsp + 0x28], rax
lea r8, str.E:BT0d644dee_4938_4dd1_adb5_57a9b8943c6dCoreTechMcCryptoLib_srcwindowswin_random.cpp
mov r9d, 0x49
lea rax, str.McCryptoLib::CMcCryptoRandomWin::GetRandomBytes
lea rdx, str.__S:__d____S___s:_Error_trying_to_Initialize_default_CMcCryptoRandomWin
mov qword [rsp + 0x20], rax
lea ecx, [r9 - 0x47]
call fcn.140058d88
mov eax, esi
jmp 0x140058bd4
mov rcx, qword [rbx]
xor r9d, r9d
mov rdx, r14
lea r8d, [r9 + 0x40]
call qword [sym.imp.bcrypt.dll_BCryptGenRandom]
lea rcx, [rbp - 0x10]
mov qword [rbp - 0x10], r15
mov dword [rbp - 8], eax
mov rax, qword [0x14012b5f8]
call qword [case.0x14005c601.0]
test eax, eax
lea rcx, [rbp - 0x10]
mov rax, qword [rbp - 0x10]
mov rax, qword [rax + 8]
je 0x140058b92
call qword [case.0x14005c601.0]
mov ecx, eax
call fcn.140058ca0
mov qword [rsp + 0x28], rax
lea r8, str.E:BT0d644dee_4938_4dd1_adb5_57a9b8943c6dCoreTechMcCryptoLib_srcwindowswin_random.cpp
mov r9d, 0x57
lea rax, str.McCryptoLib::CMcCryptoRandomWin::GetRandomBytes
lea rdx, str.__S:__d____S___s:_Error_trying_to_BCryptGenRandom
mov qword [rsp + 0x20], rax
lea ecx, [r9 - 0x55]
call fcn.140058d88
mov rax, qword [rbp - 0x10]
lea rcx, [rbp - 0x10]
mov rax, qword [rax + 8]
call qword [case.0x14005c601.0]
jmp 0x140058bd4
mov r9d, 0x43
lea rax, str.STATUS_INVALID_PARAMETER
mov qword [rsp + 0x28], rax
lea r8, str.E:BT0d644dee_4938_4dd1_adb5_57a9b8943c6dCoreTechMcCryptoLib_srcwindowswin_random.cpp
lea rax, str.McCryptoLib::CMcCryptoRandomWin::GetRandomBytes
lea rdx, str.__S:__d____S___s:_Wrong_input_params_for_GetRandomBytes__
mov qword [rsp + 0x20], rax
lea ecx, [r9 - 0x41]
call fcn.140058d88
mov eax, 0x8000000a
mov rbx, qword [rsp + 0x70]
mov rsi, qword [rsp + 0x78]
add rsp, 0x50
pop r15
pop r14
pop rbp
ret