Function at 0x100c5450
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov ebx, dword [esp + 0x60]
cmp dword [0x10103ce4], ebx
je 0x100c5660
call fcn.100c5ae0
test eax, eax
mov esi, eax
je 0x100c56d4
test ebx, ebx
je 0x100c5790
mov edi, dword [ebx + 4]
test edi, edi
je 0x100c569b
mov ecx, dword [esp + 0x64]
test ecx, ecx
je 0x100c569b
lea edx, [ebx + 8]
mov dword [esp + 0x2c], 0
mov dword [esp + 0x28], 0
mov dword [esp + 0x24], 0
lea eax, [esp + 0x20]
mov dword [esp + 0x20], edx
xchg dword [edx], eax
test eax, eax
je 0x100c54f6
lea edi, [esp + 0x20]
lea edx, [eax + 0xc]
mov ecx, 0xffffffff
mov dword [eax + 4], edi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100c54e3
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
lea ebp, [esp + 0x28]
xor edi, edi
lock xadd dword [ebp], edi
test edi, edi
je 0x100c5732
lea edx, [esi + 0x1c]
lea ebp, [esp + 0x30]
mov dword [esp + 0x3c], 0
mov dword [esp + 0x38], 0
mov dword [esp + 0x34], 0
mov dword [esp + 0x30], edx
mov eax, ebp
xchg dword [edx], eax
test eax, eax
je 0x100c5554
mov dword [eax + 4], ebp
lea edx, [eax + 0xc]
mov ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100c5542
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
lea edx, [esp + 0x38]
xor edi, edi
lock xadd dword [edx], edi
test edi, edi
je 0x100c56e1
mov edx, dword [esi + 0x30]
test edx, edx
je 0x100c5580
cmp ebx, dword [edx + 4]
je 0x100c5780
mov eax, edx
jmp 0x100c5579
cmp ebx, dword [eax + 4]
je 0x100c5780
mov eax, dword [eax + 8]
test eax, eax
jne 0x100c5570
mov dword [esp + 4], 0x18
mov dword [esp], 1
mov edi, 0xc
mov dword [esp + 0x1c], edx
call sub.msvcrt.dll_calloc
test eax, eax
mov edx, dword [esp + 0x1c]
je 0x100c55e0
mov ecx, dword [ebx + 0xc]
mov dword [eax], esi
mov dword [eax + 4], ebx
mov dword [eax + 0x14], 0
test ecx, ecx
mov dword [eax + 0xc], ecx
je 0x100c55be
mov dword [ecx + 0x14], eax
test edx, edx
mov dword [ebx + 0xc], eax
mov dword [eax + 0x10], 0
mov dword [eax + 8], edx
je 0x100c55d2
mov dword [edx + 0x10], eax
mov dword [esi + 0x30], eax
xor edi, edi
mov esi, esi
lea edi, [edi]
mov ecx, dword [esp + 0x30]
lea esi, [esp + 0x34]
xor edx, edx
lock xadd dword [esi], edx
test edx, edx
mov eax, edx
je 0x100c57d1
lea edx, [eax + 8]
mov ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100c5616
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov ecx, dword [esp + 0x20]
lea esi, [esp + 0x24]
xor edx, edx
lock xadd dword [esi], edx
test edx, edx
mov eax, edx
je 0x100c57a0
lea edx, [eax + 8]
mov ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100c564c
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
test edi, edi
je 0x100c569b
add esp, 0x4c
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
test ebx, ebx
je 0x100c56c8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov eax, dword [ebx]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov esi, eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
test esi, esi
je 0x100c5839
mov esi, dword [esi + 0xc]
test esi, esi
jne 0x100c547e
mov eax, dword [esp + 0x64]
mov dword [esp + 4], eax
mov eax, dword [ebx]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov edx, eax
sub esp, 8
mov eax, 0xb
test edx, edx
jne 0x100c5790
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [esp + 0x64]
test edx, edx
jne 0x100c5790
add esp, 0x4c
mov eax, 2
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0x1c], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov ecx, eax
mov eax, edi
mov edx, dword [esp + 0x1c]
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100c5818
mov dword [esp], ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100c5554
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov edx, eax
sub esp, 0x10
mov eax, edi
lock cmpxchg dword [ebp], edx
test eax, eax
je 0x100c57f7
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100c54f6
xor edi, edi
jmp 0x100c55e0
add esp, 0x4c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [esp + 0x20]
lock cmpxchg dword [ecx], edx
lea ecx, [esp + 0x20]
cmp ecx, eax
je 0x100c564c
lea ecx, [esp + 0x2c]
mov ebp, edx
lock xadd dword [ecx], ebp
test ebp, ebp
je 0x100c589e
xor eax, eax
lock xadd dword [esi], eax
jmp 0x100c562e
mov eax, ebp
lock cmpxchg dword [ecx], edx
cmp ebp, eax
je 0x100c5616
lea ebp, [esp + 0x3c]
lock xadd dword [ebp], edx
test edx, edx
je 0x100c5850
xor eax, eax
lock xadd dword [esi], eax
jmp 0x100c55f8
mov dword [esp], edx
mov dword [esp + 0x1c], edx
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
mov edx, dword [esp + 0x1c]
jmp 0x100c576b
mov dword [esp], ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
mov ecx, dword [esp + 0x1c]
jmp 0x100c5721
mov eax, dword [esp + 0x64]
test eax, eax
je 0x100c56d4
mov eax, dword [esp + 0x64]
mov esi, dword [eax]
jmp 0x100c5693
mov dword [esp + 0x1c], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov ecx, eax
mov edx, dword [esp + 0x1c]
mov eax, edx
lock cmpxchg dword [ebp], ecx
test eax, eax
je 0x100c58eb
mov dword [esp], ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100c57ec
mov dword [esp + 0x1c], ecx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov edx, eax
mov eax, ebp
mov ecx, dword [esp + 0x1c]
lock cmpxchg dword [ecx], edx
test eax, eax
je 0x100c5909
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100c57c6
mov dword [esp], ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
mov ecx, dword [esp + 0x1c]
jmp 0x100c588d
mov dword [esp], edx
mov dword [esp + 0x1c], edx
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
mov edx, dword [esp + 0x1c]
jmp 0x100c58da