Function at 0x5567e0
Capabilities:
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, 0x140
mov eax, dword [0x605040]
test eax, eax
je 0x556805
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
ja 0x55681a
jmp 0x556829
mov ecx, 0x605040
call fcn.005dcc80
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 1
jbe 0x556829
mov esi, eax
mov eax, dword [eax]
test eax, eax
cmove esi, eax
jne 0x556a6f
mov eax, dword [0x605040]
test eax, eax
je 0x55684b
push eax
call sub.KERNEL32.dll_TlsGetValue
test eax, eax
je 0x55685f
xor esi, esi
cmp eax, 1
je 0x556a6f
mov esi, eax
jmp 0x5568b5
mov ecx, 0x605040
call fcn.005dcc80
push eax
call sub.KERNEL32.dll_TlsGetValue
test eax, eax
jne 0x55683c
mov eax, dword [0x6f1130]
test eax, eax
jne 0x55687a
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x556a8a
mov dword [0x6f1130], eax
push 8
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x556a8a
mov dword [eax], 0
mov dword [eax + 4], 0x605040
mov esi, eax
mov eax, dword [0x605040]
test eax, eax
jne 0x5568ae
mov ecx, 0x605040
call fcn.005dcc80
push esi
push eax
call sub.KERNEL32.dll_TlsSetValue
xorps xmm0, xmm0
lea eax, [esp + 0x30]
movaps xmmword [esp + 0x40], xmm0
movaps xmmword [esp + 0x30], xmm0
push 2
push 0x20
push eax
push 0
call sub.bcrypt.dll_BCryptGenRandom
cmp eax, 0xc0000000
jb 0x5568e7
mov edi, eax
xor edi, 0x80000000
jne 0x556a91
mov eax, dword [esp + 0x44]
movups xmm0, xmmword [esp + 0x34]
mov ebx, dword [esp + 0x30]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x48]
movaps xmmword [esp + 0x20], xmm0
xorps xmm0, xmm0
mov dword [esp + 8], eax
mov eax, dword [esp + 0x4c]
movaps xmmword [esp + 0x120], xmm0
movaps xmmword [esp + 0x110], xmm0
movaps xmmword [esp + 0x100], xmm0
movaps xmmword [esp + 0xf0], xmm0
movaps xmmword [esp + 0xe0], xmm0
movaps xmmword [esp + 0xd0], xmm0
movaps xmmword [esp + 0xc0], xmm0
movaps xmmword [esp + 0xb0], xmm0
movaps xmmword [esp + 0xa0], xmm0
movaps xmmword [esp + 0x90], xmm0
movaps xmmword [esp + 0x80], xmm0
movaps xmmword [esp + 0x70], xmm0
movaps xmmword [esp + 0x60], xmm0
movaps xmmword [esp + 0x50], xmm0
movaps xmmword [esp + 0x40], xmm0
movaps xmmword [esp + 0x30], xmm0
mov dword [esp + 4], eax
mov eax, dword [0x6f1130]
test eax, eax
jne 0x55699c
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x556a79
mov dword [0x6f1130], eax
push 0x158
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x556a79
mov edi, eax
add eax, 8
push 0x100
lea ecx, [esp + 0x34]
push ecx
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
movaps xmm0, xmmword [esp + 0x20]
mov eax, dword [esp + 0xc]
mov dword [edi + 0x108], 0x40
mov dword [edi + 0x110], ebx
movups xmmword [edi + 0x114], xmm0
mov dword [edi + 0x124], eax
mov eax, dword [esp + 8]
movaps xmm0, xmmword [0x607260]
mov dword [edi + 0x128], eax
mov eax, dword [esp + 4]
mov dword [edi + 0x12c], eax
mov dword [edi + 0x134], 0
mov dword [edi + 0x130], 0
mov dword [edi + 0x13c], 0
mov dword [edi + 0x138], 0
movups xmmword [edi + 0x140], xmm0
mov dword [edi + 0x150], 0
mov dword [edi], 1
mov dword [edi + 4], 1
mov eax, dword [esi]
mov dword [esi], edi
test eax, eax
je 0x556a6f
dec dword [eax]
jne 0x556a6f
dec dword [eax + 4]
jne 0x556a6f
push eax
push 0
push dword [0x6f1130]
call sub.KERNEL32.dll_HeapFree
mov eax, esi
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, 0x158
mov edx, 8
call fcn.0040a640
ud2
mov ecx, 8
jmp 0x556abb
mov eax, dword [0x6f1130]
test eax, eax
jne 0x556aa8
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x556ab6
mov dword [0x6f1130], eax
push 4
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
jne 0x556ac7
mov ecx, 4
mov edx, 4
call fcn.0040a640
ud2
lea edx, [esp + 0x10]
lea ecx, [esp + 0x18]
mov dword [eax], edi
mov dword [esp + 0x30], 0x688ef4
mov dword [esp + 0x34], 1
mov dword [esp + 0x38], 0
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], 0x688f94
mov dword [esp + 0x18], edx
mov dword [esp + 0x40], ecx
lea ecx, [esp + 0x30]
mov edx, 0x688f4c
mov dword [esp + 0x1c], 0x556b20
mov dword [esp + 0x44], 1
call fcn.0045a2c0
ud2