Function at 0x472680
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 [0x599068]
mov edi, ecx
test eax, eax
je 0x4726b3
dec eax
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
jbe 0x4726cb
cmp dword [eax + 4], 0
mov esi, eax
je 0x4726cb
add esi, 4
jmp 0x472887
push 0x599068
call fcn.00541e40
add esp, 4
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
ja 0x4726a3
mov eax, dword [0x599068]
test eax, eax
je 0x472869
dec eax
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
je 0x472885
mov esi, eax
test eax, eax
jne 0x472747
mov eax, dword [0x607474]
mov esi, dword [0x607460]
movzx eax, byte [eax]
mov eax, dword [esi]
test eax, eax
jne 0x472711
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x4728ac
mov dword [esi], eax
push 8
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x4728ac
mov dword [eax], 0x599068
mov dword [eax + 4], 0
mov esi, eax
mov eax, dword [0x599068]
test eax, eax
je 0x472891
dec eax
push esi
push eax
call sub.KERNEL32.dll_TlsSetValue
test edi, edi
je 0x47275b
mov ebx, dword [edi]
mov dword [edi], 0
test ebx, ebx
jne 0x472843
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 0x472791
mov edi, eax
push 0x20
push ebx
call sub.advapi32.dll_SystemFunction036
test al, al
je 0x4728b0
movups xmm0, xmmword [esp + 0x10]
movups xmm1, xmmword [esp + 0x20]
mov eax, dword [0x607474]
mov edi, dword [0x607460]
movaps xmmword [esp + 0x40], xmm0
movaps xmmword [esp + 0x30], xmm1
movzx eax, byte [eax]
mov eax, dword [edi]
test eax, eax
jne 0x4727c8
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x4728a3
mov dword [edi], eax
push 0x158
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x4728a3
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 [0x5abb30]
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 0x472887
dec dword [eax]
jne 0x472887
dec dword [eax + 4]
jne 0x472887
mov ecx, dword [0x607460]
push eax
push 0
push dword [ecx]
call sub.KERNEL32.dll_HeapFree
jmp 0x472887
push 0x599068
call fcn.00541e40
add esp, 4
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
jne 0x4726e8
xor esi, esi
mov eax, esi
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
push 0x599068
call fcn.00541e40
add esp, 4
jmp 0x472740
push 0x158
push 8
jmp 0x4728e1
push 8
jmp 0x4728df
mov eax, dword [0x607474]
mov esi, dword [0x607460]
movzx eax, byte [eax]
mov eax, dword [esi]
test eax, eax
jne 0x4728cf
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x4728dd
mov dword [esi], eax
push 4
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
jne 0x4728eb
push 4
push 4
call fcn.0041a8c0
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], 0x5abd28
mov dword [esp + 0x14], 1
mov dword [esp + 0x20], 0
mov dword [esp + 0x18], ecx
mov dword [esp + 4], 0x5abe5c
mov dword [esp + 0xc], 0x472cb0
mov dword [esp + 0x1c], 1
push 0x5abd8c
push ebx
call fcn.00425150
add esp, 8
ud2