Function at 0x508f70
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x18
mov esi, ecx
mov eax, dword [0x5f3418]
xor eax, ebp
mov dword [esp + 0x10], eax
test byte [0x5f5168], 0x19
jne 0x509136
call fcn.00510cbf
mov eax, dword [eax]
mov dword [esp + 4], eax
call fcn.00510cbf
xor edi, edi
mov dword [eax], edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], eax
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ebx, dword [0x6cebb4]
cmp ebx, 1
jbe 0x5090e3
mov edi, dword [esi + 4]
push dword [0x5f50f8]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
and eax, 0xfffffffc
je 0x509124
mov ecx, dword [ebx]
mov dword [eax + ecx*8], edi
mov ecx, dword [ebx]
mov edx, dword [ebx + 4]
mov dword [eax + ecx*8 + 4], edx
mov ecx, dword [esi]
test ecx, ecx
jne 0x5090bb
push dword [esp]
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.00510cbf
mov ecx, dword [esp + 4]
mov dword [eax], ecx
cmp byte [esi + 0x20], 0
jne 0x5090cf
mov eax, dword [esi + 0xc]
test eax, eax
jne 0x509158
mov edi, dword [esi + 0x14]
mov dword [esi + 0x14], 0
test edi, edi
jne 0x5091a8
mov ecx, dword [esi + 0xc]
xor eax, eax
test ecx, ecx
jne 0x5091bd
mov ecx, eax
shr ecx, 0xe
mov edx, eax
shr edx, 0x13
mov edx, dword [edx*4 + 0x6c24fc]
bt edx, ecx
jb 0x5091d3
mov dword [esi + 0xc], 0
mov eax, dword [esi + 4]
mov ecx, eax
shr ecx, 0xe
mov edx, eax
shr edx, 0x13
mov edx, dword [edx*4 + 0x6c24fc]
bt edx, ecx
jb 0x5091e1
mov dword [esi + 4], 0
mov eax, dword [esi]
mov ecx, eax
shr ecx, 0xe
mov edx, eax
shr edx, 0x13
mov edx, dword [edx*4 + 0x6c24fc]
bt edx, ecx
jb 0x5091ef
mov dword [esi], 0
mov ecx, dword [esp + 0x10]
xor ecx, ebp
call fcn.00512ee3
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
cmp dword [esi + 4], 0
jne 0x508ff9
call fcn.00407cf0
jmp 0x508ff9
mov edi, dword [esi + 0x30]
test edi, edi
jne 0x5091fd
mov byte [esi + 0x20], 0
jmp 0x509017
push 0x6cebb4
call fcn.00408860
add esp, 4
test al, al
je 0x509245
xor eax, eax
mov dword [0x6cebbc], eax
mov dword [0x6cebb8], 0xffffffff
mov ebx, 0x6cebb8
mov ecx, 0x6cebb8
push eax
call fcn.0040c200
mov dword [0x6cebb4], ebx
jmp 0x508fc9
test edi, edi
je 0x508fef
call fcn.00404220
jmp 0x508fe1
xor eax, eax
push eax
push eax
push 0x5e2088
push 0x5db484
push 0x5f5168
push 0x45
call fcn.005553e0
add esp, 0x18
jmp 0x508f96
mov ecx, dword [esi + 0x10]
cmp dword [eax + 0xc], ecx
jbe 0x509022
mov eax, dword [eax + 8]
shl ecx, 7
cmp dword [eax + ecx + 0x68], 0
je 0x509022
mov ebx, dword [0x6bede4]
lea edi, [ebx + 0x74]
push edi
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x509250
add ebx, 0x48
mov ecx, dword [esi + 0xc]
push ebx
push dword [esi + 0x10]
call fcn.00565de0
push edi
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
jmp 0x509022
mov ecx, edi
call fcn.00565540
push edi
call fcn.0050fc7c
add esp, 4
jmp 0x509034
mov eax, dword [ecx + 4]
lock dec dword [eax + 0x38]
mov eax, dword [ecx + 4]
lock inc dword [eax + 0x3c]
mov eax, dword [esi + 0xc]
jmp 0x509041
push eax
call fcn.004e3ba0
add esp, 4
jmp 0x50905b
push eax
call fcn.004e3ba0
add esp, 4
jmp 0x50907f
push eax
call fcn.004e3ba0
add esp, 4
jmp 0x5090a2
lea ebx, [esp + 8]
push ebx
call fcn.00504e70
add esp, 4
mov ecx, edi
push dword [ebx + 4]
push dword [ebx]
push dword [esi + 0x2c]
push dword [esi + 0x28]
call fcn.00584820
mov edi, dword [esi + 0x30]
test edi, edi
je 0x5090da
lock dec dword [edi]
jne 0x5090da
mov ecx, edi
call fcn.00584a90
push edi
call fcn.0050fc7c
add esp, 4
jmp 0x5090da
mov ebx, dword [0x6cebb4]
jmp 0x508fc9
mov ecx, edi
call fcn.004f8930
jmp 0x50918d