Function at 0x1007f6d0
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 [0x101d4038]
mov edi, ecx
test eax, eax
je 0x1007f703
dec eax
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
jbe 0x1007f71b
cmp dword [eax + 4], 0
mov esi, eax
je 0x1007f71b
add esi, 4
jmp 0x1007f8d7
push 0x101d4038
call fcn.10160f60
add esp, 4
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
ja 0x1007f6f3
mov eax, dword [0x101d4038]
test eax, eax
je 0x1007f8b9
dec eax
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
je 0x1007f8d5
mov esi, eax
test eax, eax
jne 0x1007f797
mov eax, dword [0x103564a0]
mov esi, dword [0x1035648c]
movzx eax, byte [eax]
mov eax, dword [esi]
test eax, eax
jne 0x1007f761
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x1007f8fc
mov dword [esi], eax
push 8
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x1007f8fc
mov dword [eax], 0x101d4038
mov dword [eax + 4], 0
mov esi, eax
mov eax, dword [0x101d4038]
test eax, eax
je 0x1007f8e1
dec eax
push esi
push eax
call sub.KERNEL32.dll_TlsSetValue
test edi, edi
je 0x1007f7ab
mov ebx, dword [edi]
mov dword [edi], 0
test ebx, ebx
jne 0x1007f893
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 0x1007f7e1
mov edi, eax
push 0x20
push ebx
call sub.advapi32.dll_SystemFunction036
test al, al
je 0x1007f900
movups xmm0, xmmword [esp + 0x10]
movups xmm1, xmmword [esp + 0x20]
mov eax, dword [0x103564a0]
mov edi, dword [0x1035648c]
movaps xmmword [esp + 0x40], xmm0
movaps xmmword [esp + 0x30], xmm1
movzx eax, byte [eax]
mov eax, dword [edi]
test eax, eax
jne 0x1007f818
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x1007f8f3
mov dword [edi], eax
push 0x158
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x1007f8f3
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 [0x102469e0]
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 0x1007f8d7
dec dword [eax]
jne 0x1007f8d7
dec dword [eax + 4]
jne 0x1007f8d7
mov ecx, dword [0x1035648c]
push eax
push 0
push dword [ecx]
call sub.KERNEL32.dll_HeapFree
jmp 0x1007f8d7
push 0x101d4038
call fcn.10160f60
add esp, 4
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
jne 0x1007f738
xor esi, esi
mov eax, esi
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
push 0x101d4038
call fcn.10160f60
add esp, 4
jmp 0x1007f790
push 0x158
push 8
jmp 0x1007f931
push 8
jmp 0x1007f92f
mov eax, dword [0x103564a0]
mov esi, dword [0x1035648c]
movzx eax, byte [eax]
mov eax, dword [esi]
test eax, eax
jne 0x1007f91f
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x1007f92d
mov dword [esi], eax
push 4
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
jne 0x1007f93b
push 4
push 4
call fcn.1001a7e0
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], 0x10246bd8
mov dword [esp + 0x14], 1
mov dword [esp + 0x20], 0
mov dword [esp + 0x18], ecx
mov dword [esp + 4], 0x10246e00
mov dword [esp + 0xc], 0x1007fd80
mov dword [esp + 0x1c], 1
push 0x10246c3c
push ebx
call fcn.10026810
add esp, 8
ud2