Function at 0x6601310b
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x280
cmp dword [0x6610f788], 1
push ebx
push esi
push edi
jne 0x6601312b
push 0x6610fd50
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp + 0xc]
xor ebx, ebx
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x10], ebx
mov eax, dword [eax + 4]
mov dword [ebp - 0x14], ebx
mov ecx, eax
mov dword [ebp - 0x1c], eax
call fcn.6601332f
test eax, eax
je 0x66042c06
lea eax, [ebp - 0x280]
push eax
lea eax, [ebp - 0x80]
push eax
push 0x20
call fcn.66013369
push ebx
push eax
call fcn.660133df
mov edi, dword [ebp - 0x1c]
mov esi, eax
pop ecx
cmp esi, ebx
pop ecx
jne 0x66042c24
movzx eax, word [edi + 0x2a]
cmp dword [0x6610feb4], ebx
mov dword [ebp - 0xc], eax
jne 0x66042c7f
mov eax, dword [ebp - 0x20]
mov esi, dword [edi + 4]
mov ecx, dword [eax + 0x20]
cmp ecx, ebx
jne 0x66013322
cmp esi, ebx
je 0x660131ae
mov dword [esi + 0x220], 0x6601ab88
mov dword [esi], 0x6601ab78
mov dword [esi + 0x24c], eax
add eax, 0x24
push eax
lea eax, [esi + 0x10]
push eax
mov dword [esi + 4], 1
mov dword [esi + 0xc], edi
call fcn.6601342c
mov ax, word [edi + 0x2a]
pop ecx
pop ecx
push eax
mov ecx, esi
call fcn.6601344c
push esi
push dword [ebp + 8]
call fcn.6601356c
cmp eax, ebx
mov dword [ebp - 4], eax
jne 0x66042d19
mov eax, dword [edi + 0x14]
mov ecx, dword [ebp + 8]
cmp dword [0x6610f788], ebx
mov dword [ebp - 0x14], 1
mov dword [eax + 8], ecx
je 0x66013240
push dword [0x6610feb0]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, dword [eax + 0x18]
push 1
push esi
push dword [ebp + 8]
call fcn.660135c6
mov esi, eax
test esi, esi
mov dword [ebp - 0x10], esi
je 0x66042d10
push 1
push dword [ebp + 8]
call fcn.660136c3
mov eax, dword [ebx + 0x10]
mov dword [ebx + 0x10], esi
mov dword [esi], eax
xor ebx, ebx
lea eax, [ebp - 0x18]
push eax
push edi
call fcn.660136c6
cmp eax, ebx
jl 0x66042d23
cmp dword [0x6610feb4], ebx
mov esi, dword [ebp - 0x18]
jne 0x66042d2e
mov eax, dword [edi + 0x14]
cmp dword [ebp - 0xc], ebx
mov dword [eax + 0xc], esi
mov dword [ebp - 4], ebx
jbe 0x660132ec
mov dword [ebp - 8], ebx
mov eax, dword [ebp - 8]
add eax, dword [edi + 0x30]
mov eax, dword [eax]
mov esi, eax
inc esi
neg esi
sbb esi, esi
and esi, eax
mov ecx, esi
call fcn.6601378f
mov ecx, esi
mov dword [eax + 0x18], esi
call fcn.6601378f
mov ebx, dword [eax + 4]
cmp dword [0x6610feb4], 0
mov dword [ebx + 8], esi
jne 0x66042d3a
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 4]
mov dword [eax], ebx
movzx eax, word [esi + 2]
mov ecx, dword [ecx + 0x30]
lea eax, [eax + eax*2]
shl eax, 4
mov eax, dword [ecx + eax + 8]
movzx eax, word [eax + 2]
mov dword [ebx + 0x1c], eax
mov eax, dword [esi + 0x18]
test byte [eax + 0x28], 2
jne 0x660132db
push 0
push dword [ebp - 4]
push edi
call fcn.660137ab
inc dword [ebp - 4]
mov eax, dword [ebp - 4]
add dword [ebp - 8], 0x30
cmp eax, dword [ebp - 0xc]
jb 0x66013272
xor ebx, ebx
mov eax, dword [edi + 4]
push ebx
push 0x6601389e
mov ecx, dword [eax + 0x24c]
call fcn.66013869
call fcn.660138ac
cmp dword [0x6610f788], 1
jne 0x66013319
push 0x6610fd50
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 8
mov edx, dword [0x6610d7b8]
mov dword [ecx], edx
jmp 0x6601319a
cmp dword [0x6610f788], 1
jne 0x66042c1a
push 0x6610fd50
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 0x9cfe
jmp 0x6601331b
call fcn.660138ac
push esi
call fcn.6600fd75
mov dword [ebp - 4], eax
cmp dword [ebp - 0x14], ebx
je 0x66042c48
push ebx
push dword [ebp + 8]
call fcn.660136c3
push dword [ebp + 8]
call fcn.6600369d
push edi
call fcn.6601768d
cmp dword [0x6610f788], ebx
je 0x66042c63
cmp dword [ebp - 0x10], ebx
je 0x66042c63
push dword [ebp + 8]
call fcn.66017930
cmp dword [0x6610f788], 1
jne 0x66042c77
push 0x6610fd50
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 4]
jmp 0x6601331b
push dword [ebp + 8]
call fcn.66013bc8
cmp eax, ebx
mov dword [ebp - 8], eax
je 0x66013189
push dword [0x6610feb0]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, dword [eax + 0x18]
push ebx
push dword [ebp - 8]
push dword [ebp + 8]
call fcn.660135c6
mov ebx, eax
test ebx, ebx
mov dword [ebp - 0x10], ebx
jne 0x66042cc0
push 0x8007000e
call fcn.660dec27
push 1
push dword [ebp + 8]
call fcn.660136c3
mov eax, dword [esi + 0x10]
mov dword [esi + 0x10], ebx
mov dword [ebx], eax
xor ebx, ebx
xor esi, esi
cmp dword [ebp - 0xc], ebx
jbe 0x66013300
mov eax, ebx
add eax, dword [edi + 0x30]
mov ecx, dword [eax]
mov eax, ecx
inc eax
neg eax
sbb eax, eax
and eax, ecx
mov eax, dword [eax + 0x18]
test byte [eax + 0x28], 2
jne 0x66042d01
push 0
push esi
push edi
call fcn.660137ab
inc esi
add ebx, 0x30
cmp esi, dword [ebp - 0xc]
jae 0x66013300
jmp 0x66042cdf
mov dword [ebp - 4], 7
xor ebx, ebx
call fcn.660138ac
jmp 0x66042c32
push eax
call fcn.6600fd75
mov dword [ebp - 4], eax
jmp 0x66042d19
mov ecx, edi
call fcn.660de036
jmp 0x66013264
mov ecx, esi
call fcn.660de018
jmp 0x660132aa