Function at 0x1001ded2
Capabilities:
Allocate thread local storage
Get thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
push ecx
push ecx
mov eax, dword [ebp + 0xc]
push ebx
xor ebx, ebx
push esi
sub eax, ebx
je 0x1001e00c
sub eax, 1
je 0x1001df07
sub eax, 1
je 0x1001e1e0
sub eax, 1
je 0x1001e0f2
jmp 0x1001e1e0
mov dword [0x1008b2c0], ebx
mov dword [0x1008b2b0], 0x1008b2d8
mov dword [0x1008b2c8], 1
mov dword [0x1008b2cc], ebx
mov dword [0x1008b2e8], ebx
mov dword [0x1008b2d8], ebx
mov dword [0x1008b2f0], 1
mov dword [0x1008b2f4], ebx
mov dword [0x1008b300], 0x10004270
mov dword [0x1008b304], 0x10004260
mov dword [0x10089098], 0x1008b2b0
call fcn.1001de86
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x1008b440], eax
cmp eax, 0xfffffff
jne 0x1001df7f
xor eax, eax
jmp 0x1001e1e3
mov esi, dword [ebp + 8]
mov ecx, esi
push 0x7b
pop edx
call fcn.100847bf
push 0x10004edc
mov dword [0x1008b1e8], esi
call dword [sym.imp.USER32.dll_RegisterWindowMessageW]
mov dword [0x1008b8a8], eax
call fcn.1001f097
push 0x1008b444
mov dword [0x1008b468], eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x1008b428
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x1008b410
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x1008ba30
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x1008b3f8
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov dword [0x1008b474], 1
call fcn.1003061d
mov ecx, esi
call fcn.10065898
mov ecx, esi
call fcn.1003b47a
mov ecx, esi
call fcn.10011ac6
jmp 0x1001e1e0
push dword [0x1008ba28]
push 0x10007a90
call dword [sym.imp.USER32.dll_UnregisterClassW]
push dword [0x1008b96c]
push 0x10005c34
call dword [sym.imp.USER32.dll_UnregisterClassW]
mov eax, dword [0x1008b968]
test eax, eax
je 0x1001e044
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [0x1008b968], ebx
push dword [0x1008b1d4]
push 0x100043e0
call dword [sym.imp.USER32.dll_UnregisterClassW]
cmp dword [0x1008b468], ebx
je 0x1001e07b
mov esi, 0x1008b47c
cmp dword [esi], ebx
je 0x1001e070
push dword [esi]
call dword [sym.imp.GDI32.dll_DeleteObject]
mov dword [esi], ebx
add esi, 4
cmp esi, 0x1008b484
jl 0x1001e062
mov eax, dword [0x1008b1e4]
test eax, eax
je 0x1001e091
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [0x1008b1e4], ebx
mov eax, dword [0x1008acac]
cmp eax, 0xffffffff
je 0x1001e0a9
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseActCtx]
or dword [0x1008acac], 0xffffffff
cmp dword [0x1008b45c], ebx
je 0x1001e0b8
or dword [0x1008b45c], 0xffffffff
mov esi, dword [0x10089098]
cmp esi, 0x10089098
je 0x1001e0f2
jmp 0x1001e0e4
mov eax, dword [esi + 8]
or eax, dword [esi + 0xc]
je 0x1001e0e2
push dword [esi + 0xc]
push dword [esi + 8]
call dword [sym.imp.ADVAPI32.dll_UnregisterTraceGuids]
mov dword [esi + 8], ebx
mov dword [esi + 0xc], ebx
mov esi, dword [esi]
test esi, esi
jne 0x1001e0c8
mov dword [0x10089098], 0x10089098
push dword [0x1008b440]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
mov dword [esp + 0xc], esi
test esi, esi
jne 0x1001e112
cmp dword [ebp + 0xc], ebx
je 0x1001e152
jmp 0x1001e1e0
mov eax, dword [esi + 0x998]
test eax, eax
je 0x1001e123
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [esi + 0x99c]
test eax, eax
je 0x1001e134
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
lea ecx, [esi + 0x98c]
call fcn.10037062
lea ecx, [esp + 0xc]
call fcn.10037062
cmp dword [ebp + 0xc], 3
je 0x1001e1e0
mov eax, dword [0x1008b95c]
mov esi, 0x1008b428
test eax, eax
je 0x1001e173
sub dword [eax], 1
jne 0x1001e173
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [0x1008b470], ebx
je 0x1001e180
call fcn.10061ee4
mov eax, dword [0x1008ba18]
test eax, eax
je 0x1001e196
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [0x1008ba18], ebx
push 0x1008b444
mov dword [0x1008b474], ebx
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push esi
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push 0x1008b410
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push 0x1008b3f8
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push 0x1008ba30
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push dword [0x1008b440]
call dword [sym.imp.KERNEL32.dll_TlsFree]
call fcn.1000d1c5
xor eax, eax
inc eax
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc