Function at 0x14002c890
Capabilities:
Generate random numbers via rtlgenrandom
Generate random numbers via winapi

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x4d8
movaps xmmword [rsp + 0x4c0], xmm6
mov rbx, r9
mov r14, r8
mov rdi, rdx
mov rsi, rcx
mov r15, qword [rdx]
mov r13, qword [rdx + 0x20]
movzx eax, byte [0x14024a148]
cmp al, 2
jne 0x14002cc21
mov rax, qword [r13 + 0x10]
mov rdx, qword [r13 + 0x18]
mov rcx, rdx
sub rcx, rax
jb 0x14002d3e1
cmp rdx, qword [r13 + 8]
ja 0x14002d3e1
add rax, qword [r13]
mov qword [rsp + 0x310], rax
mov qword [rsp + 0x318], rcx
lea rax, [rsp + 0x310]
mov qword [rsp + 0x1d0], rax
mov byte [rsp + 0x1d8], 0
lea rcx, [rsp + 0x80]
lea r9, [rsp + 0x1d0]
mov rdx, r14
mov r8, rbx
call fcn.140029a80
mov rax, qword [rsp + 0x80]
mov r12, qword [rsp + 0x88]
test rax, rax
je 0x14002cbb6
lea rbx, [0x1401c89d0]
mov ebp, 0xf
test r12, r12
je 0x14002cbc1
movzx ecx, byte [rax]
mov edx, ecx
not dl
test dl, 0x1f
je 0x14002cbc1
cmp r12, 2
jb 0x14002cbc1
movzx edx, byte [rax + 1]
test dl, dl
js 0x14002cbec
mov r8d, 2
lea r14, [r8 + rdx]
cmp r14, r12
ja 0x14002cbc1
cmp cl, 0x30
jne 0x14002cbc1
add rax, r8
mov qword [rsp + 0x80], rax
mov qword [rsp + 0x88], rdx
mov qword [rsp + 0x90], 0
lea rcx, [rsp + 0x80]
call fcn.140021fb0
mov ebp, 0xf
lea r10, [0x1401c89d0]
test rax, rax
je 0x14002ccb2
cmp rdx, 1
jne 0x14002ccb2
cmp byte [rax], 1
jne 0x14002cc44
mov rax, qword [rsp + 0x88]
mov rdx, qword [rsp + 0x90]
cmp rdx, rax
jae 0x14002ccb2
mov r9, qword [rsp + 0x80]
movzx ecx, byte [r9 + rdx]
mov r8d, ecx
not r8b
test r8b, 0x1f
je 0x14002ccb2
lea r8, [rdx + 1]
cmp r8, rax
jae 0x14002ccb2
lea r11, [rdx + 2]
movzx r8d, byte [r9 + rdx + 1]
test r8b, r8b
js 0x14002cc55
add r8, r11
jb 0x14002ccb2
cmp r8, rax
ja 0x14002ccb2
mov qword [rsp + 0x90], r8
cmp cl, 4
jne 0x14002ccb2
mov qword [rsp + 0x40], r11
cmp r8, rax
jae 0x14002cb36
cmp byte [r9 + r8], 0xa0
jne 0x14002cb36
lea rcx, [r8 + 1]
cmp rcx, rax
jae 0x14002ccb2
lea rcx, [r8 + 2]
mov r10, r9
mov qword [rsp + 0x38], r8
movzx r8d, byte [r9 + r8 + 1]
test r8b, r8b
js 0x14002d09b
add r8, rcx
jb 0x14002d171
cmp r8, rax
ja 0x14002d171
mov qword [rsp + 0x90], r8
mov rdx, qword [r13 + 0x10]
mov r9, qword [r13 + 0x18]
mov rax, r9
sub rax, rdx
jb 0x14002d3e1
cmp r9, qword [r13 + 8]
ja 0x14002d3e1
mov r9, qword [r13 + 0x20]
sub rax, r9
jb 0x14002d3e1
sub r8, rcx
mov ebp, 0xe
lea rbx, [0x1401c8885]
cmp r8, rax
jne 0x14002cbc1
add rdx, qword [r13]
add rdx, r9
mov r13, r10
add rcx, r10
call sub.msvcrt.dll_memcmp
mov r9, r13
test eax, eax
lea r10, [0x1401c89d0]
mov r8, qword [rsp + 0x38]
jne 0x14002cbc1
lea rcx, [rsp + 0x80]
mov rbx, r9
mov rbp, r10
mov r13, r8
call fcn.140021e70
mov rcx, rbx
mov rbx, rbp
mov ebp, 0xf
test rax, rax
je 0x14002cbc1
mov r8, r13
mov r13, rax
mov rax, qword [rsp + 0x90]
lea rbx, [0x1401c89d0]
cmp rax, qword [rsp + 0x88]
jne 0x14002cbc1
cmp r14, r12
jne 0x14002cbc1
mov rax, qword [rsp + 0x40]
sub r8, rax
cmp qword [r15 + 0x20], r8
jne 0x14002cba8
mov r12, rdx
add rcx, rax
mov rdx, r8
mov rbx, rcx
mov r14, r8
call qword [r15]
test al, al
je 0x14002ccba
lea rbx, [0x1401c89df]
mov ebp, 0x10
jmp 0x14002cbc1
mov rbp, qword [rsp + 0x90]
mov rbx, r12
mov qword [rsi + 8], rbx
mov qword [rsi + 0x10], rbp
mov qword [rsi], 0
movaps xmm6, xmmword [rsp + 0x4c0]
add rsp, 0x4d8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
cmp rdx, 0x81
je 0x14002cc2b
cmp edx, 0x82
jne 0x14002cbc1
cmp r12, 4
jb 0x14002cbc1
movzx edx, word [rax + 2]
rol dx, 8
movzx edx, dx
cmp edx, 0x100
jb 0x14002cbc1
mov r8d, 4
jmp 0x14002c98c
call fcn.140051b90
jmp 0x14002c8cd
cmp r12, 2
jbe 0x14002cbc1
movzx edx, byte [rax + 2]
test dl, dl
jns 0x14002cbc1
mov r8d, 3
jmp 0x14002c98c
mov ebp, 0x13
lea rbx, [0x1401c8872]
jmp 0x14002cbc1
cmp r8, 0x81
je 0x14002cc93
cmp r8d, 0x82
jne 0x14002ccb2
cmp r11, rax
jae 0x14002ccb2
lea r8, [rdx + 3]
cmp r8, rax
jae 0x14002ccb2
movzx r8d, word [r9 + rdx + 2]
rol r8w, 8
movzx r8d, r8w
cmp r8d, 0x100
jb 0x14002ccb2
add rdx, 4
jmp 0x14002cca6
cmp r11, rax
jae 0x14002ccb2
movzx r8d, byte [r9 + r11]
test r8b, r8b
jns 0x14002ccb2
add rdx, 3
mov r11, rdx
add r8, r11
jae 0x14002ca55
mov rbx, r10
jmp 0x14002cbc1
mov rcx, r14
xorps xmm6, xmm6
movaps xmmword [rsp + 0xa0], xmm6
movaps xmmword [rsp + 0x90], xmm6
movaps xmmword [rsp + 0x80], xmm6
cmp r14, 0x31
jae 0x14002d3e1
lea rcx, [rsp + 0x80]
mov rdx, rbx
mov r8, r14
call sub.msvcrt.dll_memcpy
movaps xmm0, xmmword [rsp + 0x80]
movaps xmm1, xmmword [rsp + 0x90]
movaps xmm2, xmmword [rsp + 0xa0]
movaps xmmword [rsp + 0x1e0], xmm2
movups xmmword [rsp + 0x60], xmm1
movups xmmword [rsp + 0x70], xmm2
mov qword [rsp + 0x48], r15
movups xmmword [rsp + 0x50], xmm0
mov rdx, qword [r15 + 0x18]
movups xmmword [rsp + 0x1b8], xmm6
movups xmmword [rsp + 0x1a8], xmm6
movups xmmword [rsp + 0x198], xmm6
movups xmmword [rsp + 0x188], xmm6
movups xmmword [rsp + 0x178], xmm6
movups xmmword [rsp + 0x168], xmm6
mov byte [rsp + 0x1c8], 0
mov qword [rsp + 0x160], rdx
cmp rdx, 0x62
jae 0x14002d3e1
lea rcx, [rsp + 0x168]
lea r8, [rsp + 0x48]
call qword [r15 + 0x10]
test al, al
jne 0x14002d151
lea rax, [rsp + 0x60]
movups xmm0, xmmword [rsp + 0x1c0]
movaps xmmword [rsp + 0x250], xmm0
movups xmm0, xmmword [rsp + 0x1b0]
movaps xmmword [rsp + 0x240], xmm0
movups xmm0, xmmword [rsp + 0x1a0]
movaps xmmword [rsp + 0x230], xmm0
movups xmm0, xmmword [rsp + 0x160]
movups xmm1, xmmword [rsp + 0x170]
movups xmm2, xmmword [rsp + 0x180]
movups xmm3, xmmword [rsp + 0x190]
movaps xmmword [rsp + 0x220], xmm3
movaps xmmword [rsp + 0x210], xmm2
movaps xmmword [rsp + 0x200], xmm1
movaps xmmword [rsp + 0x1f0], xmm0
mov rbx, qword [rsp + 0x48]
mov r14, qword [rsp + 0x50]
mov r15, qword [rsp + 0x58]
movups xmm0, xmmword [rax]
movups xmm1, xmmword [rax + 0x10]
movaps xmmword [rsp + 0x1e0], xmm1
movaps xmmword [rsp + 0x1d0], xmm0
lea rcx, [rsp + 0x310]
lea rdx, [rsp + 0x1d0]
mov r8d, 0x90
call sub.msvcrt.dll_memcpy
mov qword [rsp + 0x40], rbx
test rbx, rbx
je 0x14002d151
lea rcx, [rsp + 0x98]
lea rdx, [rsp + 0x310]
mov r8d, 0x90
call sub.msvcrt.dll_memcpy
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0x80], rax
mov qword [rsp + 0x88], r14
mov qword [rsp + 0x90], r15
mov rax, qword [rsp + 0xb8]
cmp rax, 0x62
jae 0x14002d3e1
lea rbx, [0x1401c8837]
mov ebp, 0x16
cmp r12, rax
jne 0x14002cbc1
lea rdx, [rsp + 0xc0]
mov rcx, r13
mov r8, r12
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x14002cbc1
lea rbx, [rsp + 0x430]
mov r8d, 0x90
mov rcx, rbx
lea rdx, [rsp + 0x98]
call sub.msvcrt.dll_memcpy
lea rcx, [rsp + 0x3a0]
mov r8d, 0x90
mov rdx, rbx
call sub.msvcrt.dll_memcpy
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x50], r14
mov qword [rsp + 0x58], r15
movups xmm0, xmmword [rsp + 0x3a0]
movups xmm1, xmmword [rsp + 0x3b0]
movups xmmword [rsp + 0x60], xmm0
movups xmmword [rsp + 0x70], xmm1
mov rdx, qword [rax + 0x20]
cmp rdx, 0x31
jae 0x14002d3e1
mov rax, qword [rdi + 0x10]
mov r9, qword [rax]
mov rax, qword [r9 + 0x18]
cmp rax, 7
jae 0x14002d3e1
lea rcx, [rax*8]
cmp rcx, rdx
jne 0x14002d3e1
lea r8, [rsp + 0x50]
sub r9, 0xffffffffffffff80
xorps xmm6, xmm6
movaps xmmword [rsp + 0xa0], xmm6
movaps xmmword [rsp + 0x90], xmm6
movaps xmmword [rsp + 0x80], xmm6
mov qword [rsp + 0x30], rax
lea rcx, [rsp + 0x80]
mov qword [rsp + 0x28], rcx
mov qword [rsp + 0x20], rax
mov rcx, r8
xor r8d, r8d
call fcn.140029570
test al, al
jne 0x14002d3e1
movaps xmm0, xmmword [rsp + 0x80]
movaps xmm1, xmmword [rsp + 0x90]
movaps xmm2, xmmword [rsp + 0xa0]
movaps xmmword [rsp + 0x300], xmm2
movaps xmmword [rsp + 0x2f0], xmm1
movaps xmmword [rsp + 0x2e0], xmm0
mov r8, qword [rdi + 8]
mov rax, qword [r8]
mov rax, qword [rax + 8]
movaps xmmword [rsp + 0xa0], xmm6
movaps xmmword [rsp + 0x90], xmm6
movaps xmmword [rsp + 0x80], xmm6
add r8, 0x10
lea rcx, [rsp + 0x80]
lea rdx, [rsp + 0x2e0]
call rax
movaps xmm0, xmmword [rsp + 0x80]
movaps xmm1, xmmword [rsp + 0x90]
movaps xmm2, xmmword [rsp + 0xa0]
movaps xmmword [rsp + 0x2d0], xmm2
movaps xmmword [rsp + 0x2c0], xmm1
movaps xmmword [rsp + 0x2b0], xmm0
mov rax, qword [rdi]
mov rbp, qword [rdi + 0x18]
movaps xmmword [rsp + 0x190], xmm6
movaps xmmword [rsp + 0x180], xmm6
movaps xmmword [rsp + 0x170], xmm6
movaps xmmword [rsp + 0x160], xmm6
mov r14, qword [rax + 0x20]
cmp r14, 0x41
jae 0x14002d3e1
test r14, r14
je 0x14002d18b
lea r15, [rsp + 0x160]
mov ebx, 0xffffffff
mov r13, r14
jmp 0x14002d10a
cmp r8, 0x81
je 0x14002d162
cmp r8d, 0x82
jne 0x14002d171
cmp rcx, rax
jae 0x14002d171
mov rcx, qword [rsp + 0x38]
add rcx, 3
cmp rcx, rax
jae 0x14002d171
mov rcx, qword [rsp + 0x38]
movzx ecx, word [r10 + rcx + 2]
rol cx, 8
movzx r8d, cx
cmp r8d, 0x100
jb 0x14002d171
mov rcx, qword [rsp + 0x38]
add rcx, 4
jmp 0x14002cab0
add r15, r12
sub r13, r12
je 0x14002d18b
cmp r13, rbx
mov r12d, 0xffffffff
cmovb r12, r13
xor ecx, ecx
mov rdx, r15
mov r8d, r12d
mov r9d, 2
call sub.bcrypt.dll_BCryptGenRandom
cmp eax, 0xbfffffff
jbe 0x14002d0fe
mov rcx, r15
mov edx, r12d
call sub.ADVAPI32.dll_SystemFunction036
test al, al
jne 0x14002d0fe
lea rax, str.RNG_failed
mov ecx, 0xa
jmp 0x14002d3f3
lea rbx, str.UnexpectedErrorInconsistentComponents0Q
mov ebp, 0xf
jmp 0x14002cbc1
cmp rcx, rax
jae 0x14002d171
movzx r8d, byte [r10 + rcx]
test r8b, r8b
js 0x14002d17d
lea rbx, [0x1401c89d0]
jmp 0x14002cbc1
mov rcx, qword [rsp + 0x38]
add rcx, 3
jmp 0x14002cab0
movups xmm0, xmmword [rbp + 0x30]
movups xmm1, xmmword [rbp + 0x40]
movups xmm2, xmmword [rbp + 0x50]
movups xmm3, xmmword [rbp + 0x60]
movups xmmword [rsp + 0x208], xmm3
movups xmmword [rsp + 0x1f8], xmm2
movups xmmword [rsp + 0x1e8], xmm1
movups xmmword [rsp + 0x1d8], xmm0
xorps xmm0, xmm0
movups xmmword [rsp + 0x220], xmm0
movups xmmword [rsp + 0x230], xmm0
movups xmmword [rsp + 0x240], xmm0
movups xmmword [rsp + 0x250], xmm0
movups xmmword [rsp + 0x260], xmm0
movups xmmword [rsp + 0x270], xmm0
movups xmmword [rsp + 0x280], xmm0
movups xmmword [rsp + 0x290], xmm0
mov qword [rsp + 0x1d0], rbp
mov qword [rsp + 0x218], 0
mov qword [rsp + 0x2a0], 0
lea rcx, [rsp + 0x1d0]
lea rdx, [rsp + 0x160]
mov r8, r14
call fcn.14002fae0
mov rax, qword [rsp + 0x40]
mov r8, qword [rax + 0x20]
cmp r8, 0x31
jae 0x14002d3e1
lea r14, [rsp + 0x1d0]
mov rcx, r14
lea rdx, [rsp + 0x50]
call fcn.14002fae0
lea rcx, [rsp + 0x80]
mov r8d, 0xd8
mov rdx, r14
call sub.msvcrt.dll_memcpy
mov rax, qword [rsp + 0x80]
mov r9, qword [rax + 0x20]
movups xmm0, xmmword [rsp + 0x210]
movaps xmmword [rsp + 0x350], xmm0
movups xmm0, xmmword [rsp + 0x1d0]
movups xmm1, xmmword [rsp + 0x1e0]
movups xmm2, xmmword [rsp + 0x1f0]
movups xmm3, xmmword [rsp + 0x200]
movaps xmmword [rsp + 0x340], xmm3
movaps xmmword [rsp + 0x330], xmm2
movaps xmmword [rsp + 0x320], xmm1
movaps xmmword [rsp + 0x310], xmm0
cmp r9, 0x81
jae 0x14002d3e1
lea r8, [rsp + 0xd0]
mov rax, qword [rsp + 0x150]
mov qword [rsp + 0x20], rax
lea rcx, [rsp + 0x430]
lea rdx, [rsp + 0x310]
call fcn.14002f980
mov rax, qword [rsp + 0x430]
test rax, rax
je 0x14002d3e3
movups xmm0, xmmword [rsp + 0x438]
movups xmm1, xmmword [rsp + 0x448]
movups xmm2, xmmword [rsp + 0x458]
movups xmm3, xmmword [rsp + 0x468]
movups xmmword [rsi + 0x38], xmm3
movups xmmword [rsi + 0x28], xmm2
movups xmmword [rsi + 0x18], xmm1
movups xmm1, xmmword [rsp + 0x420]
movups xmmword [rsi + 0xe0], xmm1
movups xmm1, xmmword [rsp + 0x410]
movups xmmword [rsi + 0xd0], xmm1
movups xmm1, xmmword [rsp + 0x400]
movups xmmword [rsi + 0xc0], xmm1
movups xmm1, xmmword [rsp + 0x3c0]
movups xmm2, xmmword [rsp + 0x3d0]
movups xmm3, xmmword [rsp + 0x3e0]
movups xmm4, xmmword [rsp + 0x3f0]
movups xmmword [rsi + 0xb0], xmm4
movups xmmword [rsi + 0xa0], xmm3
movups xmmword [rsi + 0x90], xmm2
movups xmmword [rsi + 0x80], xmm1
movaps xmm1, xmmword [rsp + 0x2b0]
movaps xmm2, xmmword [rsp + 0x2c0]
movaps xmm3, xmmword [rsp + 0x2d0]
movups xmmword [rsi + 0x50], xmm1
movups xmmword [rsi + 0x60], xmm2
movups xmmword [rsi + 0x70], xmm3
mov qword [rsi], rax
movups xmmword [rsi + 8], xmm0
mov qword [rsi + 0x48], rdi
jmp 0x14002cbd0
ud2
mov rax, qword [rsp + 0x438]
mov rcx, qword [rsp + 0x440]
mov qword [rsi + 8], rax
mov qword [rsi + 0x10], rcx
jmp 0x14002cbc9