Function at 0x140028640
Capabilities:
Generate random numbers via rtlgenrandom
Generate random numbers via winapi
Get thread local storage value
Set thread local storage value

Disassembly:
push rsi
push rdi
push rbx
sub rsp, 0xb0
mov esi, dword [0x14005d020]
test esi, esi
je 0x1400288c9
dec esi
mov ecx, esi
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 1
ja 0x1400288be
je 0x14002870a
xorps xmm0, xmm0
movaps xmmword [rsp + 0x30], xmm0
movaps xmmword [rsp + 0x20], xmm0
lea rdx, [rsp + 0x20]
xor ecx, ecx
mov r8d, 0x20
mov r9d, 2
call sub.bcrypt.dll_BCryptGenRandom
cmp eax, 0xc0000000
jb 0x1400286b6
mov edi, eax
lea rcx, [rsp + 0x20]
mov edx, 0x20
call sub.ADVAPI32.dll_SystemFunction036
test al, al
je 0x1400288f4
movaps xmm0, xmmword [rsp + 0x20]
movaps xmm1, xmmword [rsp + 0x30]
movaps xmmword [rsp + 0x90], xmm1
movaps xmmword [rsp + 0x80], xmm0
mov rax, qword [0x141d1d100]
test rax, rax
je 0x1400288ea
and eax, 0x4000
xor ecx, ecx
lea rdi, [rsp + 0x50]
or rax, rcx
je 0x140028711
lea r8, [0x141d169b0]
lea rdx, [rsp + 0x80]
mov rcx, rdi
call fcn.140028980
jmp 0x140028733
xor eax, eax
jmp 0x1400288be
movaps xmm0, xmmword [rsp + 0x80]
movaps xmm1, xmmword [rsp + 0x90]
movaps xmmword [rsp + 0x50], xmm0
movaps xmmword [rsp + 0x60], xmm1
xorps xmm0, xmm0
movaps xmmword [rsp + 0x70], xmm0
movaps xmm0, xmmword [rdi]
movaps xmm1, xmmword [rdi + 0x10]
movaps xmm2, xmmword [rdi + 0x20]
movaps xmmword [rsp + 0x80], xmm0
movaps xmmword [rsp + 0x90], xmm1
movaps xmmword [rsp + 0xa0], xmm2
movups xmmword [rsp + 0x48], xmm0
movups xmmword [rsp + 0x58], xmm1
movups xmmword [rsp + 0x68], xmm2
movzx eax, byte [0x141d1d110]
mov edx, 0x170
xor ecx, ecx
call fcn.140040a50
test rax, rax
je 0x14002890c
mov rdi, rax
mov qword [rax], 1
mov qword [rax + 8], 1
xorps xmm0, xmm0
movaps xmmword [rax + 0x10], xmm0
movaps xmmword [rax + 0x20], xmm0
movaps xmmword [rax + 0x30], xmm0
movaps xmmword [rax + 0x40], xmm0
movaps xmmword [rax + 0x50], xmm0
movaps xmmword [rax + 0x60], xmm0
movaps xmmword [rax + 0x70], xmm0
movaps xmmword [rax + 0x80], xmm0
movaps xmmword [rax + 0x90], xmm0
movaps xmmword [rax + 0xa0], xmm0
movaps xmmword [rax + 0xb0], xmm0
movaps xmmword [rax + 0xc0], xmm0
movaps xmmword [rax + 0xd0], xmm0
movaps xmmword [rax + 0xe0], xmm0
movaps xmmword [rax + 0xf0], xmm0
movaps xmmword [rax + 0x100], xmm0
mov qword [rax + 0x110], 0x40
movups xmm0, xmmword [rsp + 0x40]
movups xmm1, xmmword [rsp + 0x50]
movups xmm2, xmmword [rsp + 0x60]
movups xmmword [rax + 0x118], xmm0
movups xmmword [rax + 0x128], xmm1
movups xmmword [rax + 0x138], xmm2
mov rax, qword [rsp + 0x70]
mov qword [rdi + 0x148], rax
mov qword [rdi + 0x150], 0x10000
mov qword [rdi + 0x158], 0x10000
mov qword [rdi + 0x160], 0
movzx eax, byte [0x141d1d110]
mov edx, 0x10
xor ecx, ecx
call fcn.140040a50
test rax, rax
je 0x14002890c
mov qword [rax], rdi
mov dword [rax + 8], esi
mov ecx, esi
mov rbx, rax
call sub.KERNEL32.dll_TlsGetValue
mov rdi, rax
mov ecx, esi
mov rsi, rbx
mov rdx, rbx
call sub.KERNEL32.dll_TlsSetValue
test rdi, rdi
je 0x1400288bb
mov r8, qword [rdi]
dec qword [r8]
jne 0x1400288aa
dec qword [r8 + 8]
jne 0x1400288aa
mov rcx, qword [0x141d1d0f0]
xor edx, edx
call fcn.14004dc58
mov rcx, qword [0x141d1d0f0]
xor edx, edx
mov r8, rdi
call fcn.14004dc58
mov rax, rsi
add rsp, 0xb0
pop rbx
pop rdi
pop rsi
ret
lea rcx, [0x14005d008]
call fcn.140031460
mov esi, eax
mov ecx, esi
call sub.KERNEL32.dll_TlsGetValue
cmp rax, 1
jbe 0x14002866b
jmp 0x1400288be
call fcn.1400411e0
jmp 0x1400286e0
movzx eax, byte [0x141d1d110]
mov edx, 4
xor ecx, ecx
call fcn.140040a50
test rax, rax
jne 0x14002890e
ud2
and edi, 0x7fffffff
mov dword [rax], edi
ud2