Function at 0x6f21a060
Capabilities:
Get thread local storage value
Hijack thread execution

Disassembly:
push edi
push esi
push ebx
sub esp, 0x2f0
mov eax, dword [0x6f2540f4]
mov dword [esp + 0x2ec], eax
xor eax, eax
mov esi, dword [esp + 0x300]
test esi, esi
je 0x6f21a170
mov dword [esp], 0x6f23605c
call sym.hal.dll_pthread_mutex_lock
mov eax, esi
call fcn.6f218400
mov dword [esp], 0x6f23605c
mov ebx, eax
call sym.hal.dll_pthread_mutex_unlock
test ebx, ebx
je 0x6f21a170
mov eax, dword [ebx + 0x14]
lea edx, [eax - 1]
cmp edx, 0xfffffffd
ja 0x6f21a170
lea edx, [esp + 0x1c]
mov dword [esp], eax
mov dword [esp + 4], edx
call dword [sym.imp.KERNEL32.dll_GetHandleInformation]
sub esp, 8
test eax, eax
je 0x6f21a170
lea edi, [ebx + 0x1c]
mov dword [esp], edi
call sym.hal.dll_pthread_mutex_lock
call fcn.6f218a80
mov eax, dword [0x6f236064]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
test eax, eax
je 0x6f21a2c0
movzx edx, byte [ebx + 0x20]
cmp esi, dword [eax + 0xb4]
je 0x6f21a198
mov eax, dword [ebx + 0x24]
not eax
test al, 3
je 0x6f21a1f8
test dl, 3
jne 0x6f21a158
and edx, 0xfffffffc
or edx, 1
mov byte [ebx + 0x20], dl
lock add dword [0x6f254af8], 1
mov eax, dword [ebx + 0x18]
test eax, eax
je 0x6f21a149
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov dword [esp], edi
call sym.hal.dll_pthread_mutex_unlock
xor eax, eax
jmp 0x6f21a175
mov dword [esp], edi
call sym.hal.dll_pthread_mutex_unlock
test byte [ebx + 0x20], 0xc
je 0x6f21a151
lea esi, cs:[esi]
nop
mov eax, 3
mov edx, dword [esp + 0x2ec]
sub edx, dword [0x6f2540f4]
jne 0x6f21a2d6
add esp, 0x2f0
pop ebx
pop esi
pop edi
ret
test dl, 3
jne 0x6f21a158
and edx, 0xfffffffc
or edx, 1
mov byte [ebx + 0x20], dl
lock add dword [0x6f254af8], 1
mov eax, dword [ebx + 0x18]
test eax, eax
je 0x6f21a1c1
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov eax, dword [ebx + 0x24]
mov edx, eax
not edx
and edx, 3
jne 0x6f21a149
and eax, 0xfffffffe
mov dword [ebx + 0x24], eax
movzx eax, byte [ebx + 0x20]
and eax, 0xfffffff3
or eax, 4
mov byte [ebx + 0x20], al
mov dword [esp], edi
call sym.hal.dll_pthread_mutex_unlock
call sym.hal.dll__pthread_invoke_cancel
lea esi, [esi]
test dl, 0xc
jne 0x6f21a158
and edx, 0xf
jne 0x6f21a170
mov eax, dword [ebx + 0x14]
mov dword [esp + 0x20], 0x10001
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SuspendThread]
sub esp, 4
mov dword [esp + 4], 0
mov eax, dword [ebx + 0x14]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
cmp eax, 0x102
jne 0x6f21a149
lea esi, [esp + 0x20]
mov dword [esp + 4], esi
mov eax, dword [ebx + 0x14]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
sub esp, 8
mov dword [esp + 4], esi
mov eax, dword [ebx + 0x14]
mov dword [esp + 0xd8], sym.hal.dll__pthread_invoke_cancel
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
movzx eax, byte [ebx + 0x20]
and dword [ebx + 0x24], 0xfffffffe
sub esp, 8
and eax, 0xfffffff0
or eax, 5
mov byte [ebx + 0x20], al
lock add dword [0x6f254af8], 1
mov eax, dword [ebx + 0x18]
test eax, eax
je 0x6f21a2a4
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov dword [esp], edi
call sym.hal.dll_pthread_mutex_unlock
mov eax, dword [ebx + 0x14]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ResumeThread]
sub esp, 4
jmp 0x6f21a149
call fcn.6f218b40
test eax, eax
jne 0x6f21a103
movzx edx, byte [ebx + 0x20]
jmp 0x6f21a113
call fcn.6f211f00
lea esi, cs:[esi]