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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x14
mov eax, dword [section..data]
cmp eax, 2
jne 0x10027a96
lea esi, [0x100d4008]
push esi
call sub.KERNEL32.dll_AcquireSRWLockExclusive
mov eax, dword [0x100d4184]
mov eax, dword [eax]
test eax, 0x7fffffff
jne 0x10027aad
mov dword [ebp - 0x10], 0
movzx eax, byte [0x100d400c]
test al, al
jne 0x10027ac6
mov edx, dword [0x100d4018]
test edx, edx
je 0x10027963
mov esi, edx
mov ecx, 1
dec esi
mov dword [0x100d4018], esi
mov edi, dword [0x100d4010]
mov ebx, dword [edi + edx*4 - 4]
je 0x1002796c
mov eax, dword [edi]
mov dword [ebp - 0x18], ebx
mov dword [edi], ebx
xor ebx, ebx
mov dword [ebp - 0x14], eax
mov eax, esi
sub eax, 2
cmovb eax, ebx
cmp edx, 4
jae 0x10027930
xor ebx, ebx
cmp esi, 2
mov esi, dword [ebp - 0x18]
je 0x10027956
jmp 0x100279bc
mov esi, ebx
mov ebx, dword [edi + ecx*4]
cmp ebx, dword [edi + ecx*4 + 4]
mov ebx, ecx
sbb ebx, 0xffffffff
mov ecx, dword [edi + ebx*4]
mov dword [edi + esi*4], ecx
lea ecx, [ebx + ebx + 1]
cmp ecx, eax
jbe 0x10027930
add edx, 0xfffffffe
cmp ecx, edx
jne 0x10027991
mov esi, dword [ebp - 0x18]
mov edx, dword [edi + ecx*4]
lea eax, [edi + ecx*4]
mov dword [edi + ebx*4], edx
mov ebx, ecx
jmp 0x10027997
xor ecx, ecx
cmp ecx, 1
jne 0x10027974
jmp 0x100279c9
mov dword [ebp - 0x14], ebx
cmp ecx, 1
je 0x100279c9
mov eax, dword [0x100d401c]
lea esi, [eax + 1]
mov dword [ebp - 0x14], eax
mov dword [0x100d401c], esi
test esi, esi
je 0x100279d3
bsr eax, esi
xor eax, 0x1f
jmp 0x100279d8
mov esi, dword [ebp - 0x18]
lea eax, [edi + ebx*4]
mov dword [eax], esi
mov eax, ebx
nop dword [eax + eax]
lea ecx, [eax - 1]
mov ebx, ecx
shr ebx, 1
mov edx, dword [edi + ebx*4]
cmp edx, esi
jbe 0x100279ba
mov dword [edi + eax*4], edx
cmp ecx, 1
mov eax, ebx
ja 0x100279a0
jmp 0x100279bc
mov ebx, eax
mov ecx, 1
mov dword [edi + ebx*4], esi
cmp ecx, 1
jne 0x10027974
mov eax, dword [ebp - 0x14]
lea esi, [eax + 1]
test esi, esi
jne 0x10027989
mov eax, 0x20
mov ecx, 0x1f
mov ebx, 1
sub ecx, eax
mov edi, ecx
shl ebx, cl
sub esi, ebx
cmp byte [ebp - 0x10], 0
jne 0x10027a02
mov eax, dword [0x100d4184]
mov eax, dword [eax]
test eax, 0x7fffffff
jne 0x10027bb3
lea eax, [0x100d4008]
push eax
call sub.KERNEL32.dll_ReleaseSRWLockExclusive
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x10], edi
mov dword [ecx], 1
mov dword [ecx + 4], eax
mov dword [ecx + 8], edi
mov dword [ecx + 0xc], ebx
mov dword [ecx + 0x10], esi
mov edi, esi
mov eax, dword [0x100d4034]
test eax, eax
je 0x10027aee
dec eax
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 2
jb 0x10027a50
cmp dword [eax + 4], 0
mov esi, eax
jne 0x10027b92
mov eax, dword [0x100d4034]
test eax, eax
je 0x10027b0f
dec eax
push eax
call sub.KERNEL32.dll_TlsGetValue
test eax, eax
je 0x10027b2a
mov esi, eax
cmp eax, 1
jne 0x10027b66
lea eax, [ebp - 0x20]
push 0x100d8154
push 0x100d7fd0
push eax
push 0x46
push 0x100d80bc
call fcn.100b12e0
add esp, 0x14
ud2
push section..data
push section..data
call fcn.10028560
add esp, 8
jmp 0x100278a7
call fcn.1006d910
xor al, 1
mov dword [ebp - 0x10], eax
movzx eax, byte [0x100d400c]
test al, al
je 0x100278db
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], esi
mov byte [ebp - 0x1c], al
lea eax, [ebp - 0x20]
push 0x100d80ac
push 0x100d800c
push eax
push 0x2b
push 0x100d7fe0
call fcn.100b12e0
add esp, 0x14
ud2
push 0x100d4034
call fcn.1007e000
add esp, 4
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 2
jae 0x10027a44
jmp 0x10027a50
push 0x100d4034
call fcn.1007e000
add esp, 4
push eax
call sub.KERNEL32.dll_TlsGetValue
test eax, eax
jne 0x10027a6c
mov eax, dword [0x100f5654]
movzx eax, byte [eax]
push 4
push 0xc
call fcn.10004670
add esp, 8
test eax, eax
je 0x10027bdb
mov dword [eax], 0x100d4034
mov dword [eax + 4], 0
mov esi, eax
mov eax, dword [0x100d4034]
test eax, eax
je 0x10027bcc
dec eax
push esi
push eax
call sub.KERNEL32.dll_TlsSetValue
movq xmm0, qword [esi + 4]
movd eax, xmm0
movq qword [ebp - 0x20], xmm0
mov dword [esi + 4], 1
mov dword [esi + 8], 0
test eax, eax
je 0x10027b92
lea eax, [ebp - 0x1c]
push eax
call fcn.10027730
add esp, 4
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
mov eax, dword [ebp + 8]
add esi, 8
mov dword [esi], ecx
mov dword [eax], ecx
mov dword [eax + 4], edx
mov dword [eax + 8], ebx
mov dword [eax + 0xc], edi
add esp, 0x14
pop esi
pop edi
pop ebx
pop ebp
ret
call fcn.1006d910
test al, al
jne 0x10027a02
mov byte [0x100d400c], 1
jmp 0x10027a02
push 0x100d4034
call fcn.1007e000
add esp, 4
jmp 0x10027b5f
push 0xc
push 4
call fcn.100a32d0
add esp, 8
ud2