Function at 0x1000f170
Capabilities:
Allocate thread local storage
Create thread
Query environment variable
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
lea esi, [eax + 0xf]
and esi, 0xfffffff0
push edi
mov dword [ebp - 0x20], eax
mov dword [eax + 0xfc], esi
call fcn.10005190
mov ebx, dword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov dword [ebp - 0x2c], eax
or eax, edx
mov dword [ebp - 0x28], edx
jne 0x1000f1be
lock xchg dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x100b6010], eax
jmp 0x1000f24c
mov eax, dword [0x10013c58]
cmp eax, 0xffffffff
jne 0x1000f1f2
mov edi, 1
mov dword [0x10013c58], edi
call fcn.10005210
cmp dword [0x10013c54], edi
jne 0x1000f1e8
mov dword [0x10013c58], edi
jmp 0x1000f1f2
mov dword [0x10013c58], 0x1f4
mov eax, dword [0x10013c58]
inc eax
xor ecx, ecx
test eax, eax
jle 0x1000f212
mov edi, edi
pause
mov edx, dword [0x100b6010]
cmp edx, 0xffffffff
jne 0x1000f24c
inc ecx
cmp ecx, eax
jl 0x1000f200
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetThreadPriority]
push 2
mov edi, eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp edi, 0x40000000
je 0x1000f242
push edi
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov eax, dword [0x100b6010]
cmp eax, 0xffffffff
je 0x1000f212
cmp dword [0x100b6028], 0
jne 0x1000f284
push 0x10
lea ecx, [ebp - 0x18]
push ecx
push 0x100b7020
mov dword [0x100b6028], 1
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x1000f284
cmp byte [ebp - 0x18], 0x31
jne 0x1000f284
mov dword [0x100b6028], 0xffffffff
mov dword [ebp - 0x1c], 0
mov edi, 0x100b6020
mov edx, dword [edi]
mov eax, edx
not eax
bsf ecx, eax
mov dword [ebp - 0x24], ecx
je 0x1000f2c3
mov eax, 1
shl eax, cl
mov ebx, edi
or eax, edx
mov ecx, eax
mov eax, edx
lock cmpxchg dword [ebx], ecx
cmp eax, edx
je 0x1000f2e6
mov edx, dword [edi]
mov eax, edx
not eax
bsf ecx, eax
mov dword [ebp - 0x24], ecx
jne 0x1000f29e
inc dword [ebp - 0x1c]
add edi, 4
cmp edi, 0x100b6028
jl 0x1000f290
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.100055da
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp + 0xc]
mov edi, dword [ebp - 0x1c]
mov dword [esi], ecx
lea ecx, [esi + 0x48]
push ecx
push 4
mov dword [esi + 4], edx
mov edx, dword [ebp - 0x20]
push edx
mov dword [esi + 8], eax
mov eax, dword [ebp + 0x10]
xor ebx, ebx
push 0x1000f0f0
shl edi, 5
add edi, dword [ebp - 0x24]
push eax
push ebx
mov dword [esi + 0xc], ebx
mov dword [esi + 0x44], edi
mov dword [esi + 0x10], ebx
mov dword [esi + 0x38], ebx
mov dword [esi + 0x3c], 1
mov dword [esi + 0x40], ebx
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [esi + 0x34], eax
cmp eax, ebx
jne 0x1000f370
mov ecx, edi
mov edx, 1
mov dword [esi + 0x40], edx
and ecx, 0x1f
shl edx, cl
sar edi, 5
mov dword [esi + 0x3c], ebx
lea esi, [edi*4 + 0x100b6020]
not edx
mov ecx, dword [esi]
mov eax, edx
and eax, ecx
mov edi, eax
mov ebx, esi
mov eax, ecx
lock cmpxchg dword [ebx], edi
cmp eax, ecx
jne 0x1000f357
jmp 0x1000f2d1
mov ecx, dword [ebp - 0x20]
mov edi, dword [ecx + 0xfc]
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov edx, dword [edi + 0x34]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov eax, 1
mov ecx, 0x100b6014
lock xadd dword [ecx], eax
test eax, eax
jne 0x1000f3ab
push 1
call dword [sym.imp.WINMM.dll_timeBeginPeriod]
mov edx, dword [esi + 0x34]
push edx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
mov eax, 1
pop ebx
call fcn.100055da
mov esp, ebp
pop ebp
ret 0xc