Function at 0x14008ead0
Capabilities:
Generate random numbers via winapi

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x88
mov r15d, dword [0x140175410]
mov edi, dword [rsp + 0xf0]
mov rsi, rcx
mov rcx, qword [0x140175408]
mov rbp, rdx
mov r12, r8
mov r13, r9
test rcx, rcx
je 0x14008ee50
cmp r15d, 0xffffffff
je 0x14008ee50
mov edx, edi
mov ebx, edi
lea r14, str.DHPUBLICBLOB
mov dword [rsp + 0x64], r15d
sar edx, 0x1f
shr edx, 0x1d
lea eax, [rdi + rdx]
and eax, 7
sub eax, edx
sub ebx, eax
cmp r15d, 1
lea rax, str.DHPRIVATEBLOB
cmove rax, r14
mov dword [rsp + 0x60], ebx
mov qword [rsp + 0x48], rax
lea rax, [rsp + 0x7c]
mov qword [rsp + 0x50], rax
mov edx, dword [r12 + 8]
mov eax, dword [r13 + 8]
mov ebx, dword [rsp + 0x60]
cmp eax, edx
cmovb eax, edx
mov rdx, rsi
cmp eax, ebx
cmovb eax, ebx
xor r9d, r9d
lea r8d, [rax*8]
mov dword [rsp + 0x7c], eax
call sub.bcrypt.dll_BCryptGenerateKeyPair
test eax, eax
js 0x14008ef78
mov edi, dword [rsp + 0x7c]
lea ecx, [rdi + rdi + 0xc]
mov r14, rcx
call sub.msvcrt.dll_malloc
mov rbx, rax
test rax, rax
je 0x14008ef78
mov r15d, dword [r13 + 8]
mov r9, qword [r13]
mov dword [rax], r14d
lea rcx, [rax + 0xc]
mov dword [rax + 4], 0x4d504844
mov dword [rax + 8], edi
cmp r15d, edi
jb 0x14008ede0
mov r8d, r15d
mov r15d, edi
mov rdx, r9
mov rax, r15
sub rax, r8
add rcx, rax
call sub.msvcrt.dll_memcpy
mov r9d, dword [r12 + 8]
mov r11, qword [r12]
lea rcx, [rbx + r15 + 0xc]
cmp r9d, edi
jb 0x14008edb0
mov r8d, r9d
mov r10, r15
mov rdx, r11
sub r10, r8
add rcx, r10
call sub.msvcrt.dll_memcpy
mov rcx, qword [rsi]
mov r9d, r14d
mov r8, rbx
mov dword [rsp + 0x20], 0
lea rdx, str.DHParameters
call sub.bcrypt.dll_BCryptSetProperty
mov qword [rsi + 8], rbx
test eax, eax
js 0x14008ef78
mov rcx, qword [rsi]
xor edx, edx
call sub.bcrypt.dll_BCryptFinalizeKeyPair
test eax, eax
js 0x14008ef78
mov r14, qword [rsp + 0x50]
mov rcx, qword [rsi]
xor r9d, r9d
xor edx, edx
mov r15, qword [rsp + 0x48]
mov dword [rsp + 0x30], 0
mov qword [rsp + 0x28], r14
mov dword [rsp + 0x20], 0
mov r8, r15
mov dword [rsp + 0x7c], 0
call sub.bcrypt.dll_BCryptExportKey
test eax, eax
js 0x14008ef78
mov ecx, dword [rsp + 0x7c]
mov rdi, rcx
call sub.msvcrt.dll_malloc
mov rbx, rax
test rax, rax
je 0x14008ef78
mov rcx, qword [rsi]
mov dword [rsp + 0x30], 0
xor edx, edx
mov r9, rax
mov qword [rsp + 0x28], r14
mov r8, r15
mov dword [rsp + 0x20], edi
call sub.bcrypt.dll_BCryptExportKey
test eax, eax
js 0x14008ef70
mov edi, dword [rbx + 4]
test rbp, rbp
je 0x14008ef70
mov r8d, dword [rbp + 8]
mov rcx, qword [rbp]
cmp edi, r8d
je 0x14008ed01
mov edx, edi
call sub.msvcrt.dll_realloc
mov rcx, rax
test rax, rax
je 0x14008ef70
mov qword [rbp], rax
mov r8d, dword [rbx + 4]
mov dword [rbp + 8], edi
lea eax, [r8 + r8]
lea rdx, [rbx + rax + 8]
call sub.msvcrt.dll_memcpy
cmp dword [rbx], 0x56504844
jne 0x14008ed95
mov ecx, 0x10
call sub.msvcrt.dll_malloc
mov rdi, rax
test rax, rax
je 0x14008ef67
mov r8d, dword [rbx + 4]
mov qword [rax], 0
mov dword [rax + 8], 0
mov qword [rsi + 0x10], rax
mov r14, r8
test r8d, r8d
je 0x14008ee00
mov rcx, r8
mov qword [rsp + 0x58], r8
call sub.msvcrt.dll_malloc
mov r8, qword [rsp + 0x58]
test rax, rax
mov rcx, rax
je 0x14008ef70
mov qword [rdi], rax
mov dword [rdi + 8], r14d
lea eax, [r14 + r14*2]
lea rdx, [rbx + rax + 8]
call sub.msvcrt.dll_memcpy
mov rax, qword [rsi + 0x10]
mov edx, dword [rax + 8]
mov rax, qword [rax]
sub edx, 1
test byte [rax + rdx], 1
je 0x14008ee10
xor eax, eax
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov r8d, edi
xor edx, edx
mov qword [rsp + 0x68], r11
sub r8d, r9d
mov dword [rsp + 0x58], r9d
call sub.msvcrt.dll_memset
mov r11, qword [rsp + 0x68]
mov r9d, dword [rsp + 0x58]
mov rcx, rax
jmp 0x14008ebfb
mov r8d, edi
xor edx, edx
mov qword [rsp + 0x58], r9
sub r8d, r15d
call sub.msvcrt.dll_memset
mov r9, qword [rsp + 0x58]
mov rcx, rax
jmp 0x14008ebcd
xor ecx, ecx
jmp 0x14008ed74
mov rcx, rbx
call fcn.140083fb8
mov rcx, rsi
call fcn.14008ea60
pxor xmm0, xmm0
mov qword [rsi + 0x10], 0
movups xmmword [rsi], xmm0
mov rcx, qword [0x140175408]
test rcx, rcx
jne 0x14008eb59
mov edi, dword [rsp + 0xf0]
nop word cs:[rax + rax]
mov ecx, 0x10
call sub.msvcrt.dll_malloc
mov r15, rax
test rax, rax
je 0x14008ef90
lea ebx, [rdi*8 - 1]
pxor xmm0, xmm0
movsd xmm2, qword [0x14019ded0]
movsd xmm3, qword [0x14019dec0]
cvtsi2sd xmm0, ebx
mulsd xmm0, qword [0x14019deb8]
mov qword [rax], 0
mov dword [rax + 8], 0
mov qword [rsi + 0x10], rax
movupd xmm1, xmm0
andpd xmm1, xmm2
ucomisd xmm3, xmm1
jbe 0x14008eee0
cvttsd2si rax, xmm0
pxor xmm1, xmm1
movupd xmm3, xmm0
movsd xmm4, qword [0x14019dec8]
andnpd xmm2, xmm0
cvtsi2sd xmm1, rax
cmpnlesd xmm3, xmm1
andpd xmm3, xmm4
addsd xmm1, xmm3
orpd xmm1, xmm2
movupd xmm0, xmm1
cvttsd2si rdi, xmm0
test edi, edi
je 0x14008ef88
mov ecx, edi
call sub.msvcrt.dll_malloc
mov r14, rax
test rax, rax
je 0x14008ef78
mov qword [r15], rax
mov dword [r15 + 8], edi
mov rcx, qword [0x140175380]
xor r9d, r9d
mov r8d, edi
mov rdx, r14
call sub.bcrypt.dll_BCryptGenRandom
test eax, eax
js 0x14008ef78
mov eax, ebx
mov r9, r13
sar eax, 0x1f
shr eax, 0x1d
lea ecx, [rbx + rax]
and ecx, 7
sub ecx, eax
mov eax, 1
sub ecx, 1
shl eax, cl
mov rcx, rbp
mov edx, eax
movzx eax, byte [r14]
and eax, 0x7f
or eax, edx
mov rdx, r12
mov byte [r14], al
lea eax, [rdi - 1]
or byte [r14 + rax], 1
mov r8, qword [rsi + 0x10]
call fcn.140096610
neg eax
sbb eax, eax
jmp 0x14008ed97
xor edx, edx
mov qword [rsi + 0x10], rdx
nop dword [rax]
mov rcx, rbx
call fcn.140083fb8
mov eax, 0xffffffff
jmp 0x14008ed97
xor r14d, r14d
jmp 0x14008ef03
xor eax, eax
mov qword [rsi + 0x10], rax
jmp 0x14008ef78