Function at 0x100c9f50
Capabilities:
Get thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov ebx, dword [esp + 0x60]
test ebx, ebx
je 0x100c9f67
mov edx, dword [esp + 0x64]
test edx, edx
jne 0x100c9f74
mov eax, 0x16
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
xor edx, edx
lock xadd dword [ebx], edx
xor eax, eax
test edx, edx
jne 0x100c9f6c
lea ecx, [ebx + 4]
lea esi, [esp + 0x30]
mov dword [esp + 0x3c], 0
mov dword [esp + 0x38], 0
mov dword [esp + 0x34], 0
mov dword [esp + 0x30], ecx
mov eax, esi
xchg dword [ecx], eax
test eax, eax
je 0x100c9fdb
mov dword [eax + 4], esi
lea ecx, [eax + 0xc]
mov edi, 0xffffffff
mov eax, edx
lock cmpxchg dword [ecx], edi
test eax, eax
je 0x100c9fcc
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
lea ebp, [esp + 0x38]
xor edi, edi
lock xadd dword [ebp], edi
test edi, edi
je 0x100ca025
mov eax, dword [ebx]
test eax, eax
je 0x100ca070
mov ecx, dword [esp + 0x30]
lea edi, [esp + 0x34]
xor edx, edx
lock xadd dword [edi], edx
test edx, edx
mov eax, edx
je 0x100ca123
lea edx, [eax + 8]
mov ecx, 0xffffffff
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x100ca01b
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
add esp, 0x4c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
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 0x100ca150
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100c9fdb
mov edi, dword [0x10103ce0]
mov dword [esp + 0x24], fcn.100bdaa0
mov dword [esp + 0x28], esi
test edi, edi
je 0x100ca1b3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x1c], eax
mov eax, dword [edi]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebp, eax
mov edx, dword [esp + 0x1c]
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov edi, dword [0x10103ce0]
sub esp, 4
lea eax, [esp + 0x24]
mov dword [esp], edi
mov dword [esp + 0x2c], ebp
mov dword [esp + 4], eax
call fcn.100c5450
call dword [esp + 0x64]
mov edi, dword [0x10103ce0]
test edi, edi
je 0x100ca118
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
mov eax, dword [edi]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov edi, eax
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_SetLastError]
sub esp, 4
test edi, edi
je 0x100ca118
mov eax, dword [edi + 8]
mov dword [esp + 4], eax
mov eax, dword [0x10103ce0]
mov dword [esp], eax
call fcn.100c5450
mov dword [ebx], 1
jmp 0x100c9fe5
mov eax, esi
lock cmpxchg dword [ecx], edx
cmp esi, eax
je 0x100ca01b
lea esi, [esp + 0x3c]
mov ebx, edx
lock xadd dword [esi], ebx
test ebx, ebx
je 0x100ca171
xor eax, eax
lock xadd dword [edi], eax
jmp 0x100c9ffd
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 0x100ca05e
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 ebp, eax
sub esp, 0x10
mov eax, ebx
lock cmpxchg dword [esi], ebp
test eax, eax
je 0x100ca1ba
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
jmp 0x100ca13f
xor ebp, ebp
jmp 0x100ca0ba
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
jmp 0x100ca1a5