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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x60
mov eax, dword [0x102bc068]
mov edi, ecx
test eax, eax
je 0x1009c133
dec eax
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
jbe 0x1009c14b
cmp dword [eax + 4], 0
mov esi, eax
je 0x1009c14b
add esi, 4
jmp 0x1009c307
push 0x102bc068
call fcn.1017d760
add esp, 4
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
ja 0x1009c123
mov eax, dword [0x102bc068]
test eax, eax
je 0x1009c2e9
dec eax
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
je 0x1009c305
mov esi, eax
test eax, eax
jne 0x1009c1c7
mov eax, dword [0x1044f00c]
mov esi, dword [0x1044eff8]
movzx eax, byte [eax]
mov eax, dword [esi]
test eax, eax
jne 0x1009c191
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x1009c32c
mov dword [esi], eax
push 8
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x1009c32c
mov dword [eax], 0x102bc068
mov dword [eax + 4], 0
mov esi, eax
mov eax, dword [0x102bc068]
test eax, eax
je 0x1009c311
dec eax
push esi
push eax
call sub.KERNEL32.dll_TlsSetValue
test edi, edi
je 0x1009c1db
mov ebx, dword [edi]
mov dword [edi], 0
test ebx, ebx
jne 0x1009c2c3
xorps xmm0, xmm0
movups xmmword [esp + 0x20], xmm0
movups xmmword [esp + 0x10], xmm0
lea ebx, [esp + 0x10]
push 2
push 0x20
push ebx
push 0
call sub.bcrypt.dll_BCryptGenRandom
cmp eax, 0xc0000000
jb 0x1009c211
mov edi, eax
push 0x20
push ebx
call sub.advapi32.dll_SystemFunction036
test al, al
je 0x1009c330
movups xmm0, xmmword [esp + 0x10]
movups xmm1, xmmword [esp + 0x20]
mov eax, dword [0x1044f00c]
mov edi, dword [0x1044eff8]
movaps xmmword [esp + 0x40], xmm0
movaps xmmword [esp + 0x30], xmm1
movzx eax, byte [eax]
mov eax, dword [edi]
test eax, eax
jne 0x1009c248
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x1009c323
mov dword [edi], eax
push 0x158
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x1009c323
mov ebx, eax
mov dword [eax], 1
mov dword [eax + 4], 1
add eax, 8
push 0x100
push 0
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
movaps xmm0, xmmword [esp + 0x40]
movaps xmm2, xmmword [esp + 0x30]
movaps xmm1, xmmword [0x10335170]
mov dword [ebx + 0x108], 0x40
movups xmmword [ebx + 0x110], xmm0
movups xmmword [ebx + 0x120], xmm2
xorps xmm2, xmm2
movups xmmword [ebx + 0x130], xmm2
movups xmmword [ebx + 0x140], xmm1
mov dword [ebx + 0x150], 0
add esi, 4
mov eax, dword [esi]
mov dword [esi], ebx
test eax, eax
je 0x1009c307
dec dword [eax]
jne 0x1009c307
dec dword [eax + 4]
jne 0x1009c307
mov ecx, dword [0x1044eff8]
push eax
push 0
push dword [ecx]
call sub.KERNEL32.dll_HeapFree
jmp 0x1009c307
push 0x102bc068
call fcn.1017d760
add esp, 4
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
jne 0x1009c168
xor esi, esi
mov eax, esi
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
push 0x102bc068
call fcn.1017d760
add esp, 4
jmp 0x1009c1c0
push 0x158
push 8
jmp 0x1009c361
push 8
jmp 0x1009c35f
mov eax, dword [0x1044f00c]
mov esi, dword [0x1044eff8]
movzx eax, byte [eax]
mov eax, dword [esi]
test eax, eax
jne 0x1009c34f
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x1009c35d
mov dword [esi], eax
push 4
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
jne 0x1009c36b
push 4
push 4
call fcn.1001ac80
add esp, 8
ud2
add edi, 0x80000000
mov edx, esp
lea ecx, [esp + 8]
mov dword [eax], edi
mov dword [esp], eax
mov dword [esp + 8], edx
mov dword [esp + 0x10], 0x10335368
mov dword [esp + 0x14], 1
mov dword [esp + 0x20], 0
mov dword [esp + 0x18], ecx
mov dword [esp + 4], 0x10335590
mov dword [esp + 0xc], 0x1009c7b0
mov dword [esp + 0x1c], 1
push 0x103353cc
push ebx
call fcn.100272b0
add esp, 8
ud2