Function at 0x4101a0
Capabilities:
Hijack thread execution
Resume thread
Suspend thread

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2ec
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.___pth_gpointer_locked
test eax, eax
mov ebx, eax
je 0x4101c8
mov eax, dword [eax + 0x14]
lea ecx, [eax - 1]
cmp ecx, 0xfffffffd
jbe 0x4101d5
mov eax, 3
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea esi, [ebp - 0x2e4]
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetHandleInformation]
sub esp, 8
test eax, eax
je 0x4101c8
lea edi, [ebx + 0x1c]
mov dword [esp], edi
call sym._pthread_mutex_lock
call sym.___pthread_self_lite
test eax, eax
je 0x4103c0
mov eax, dword [eax + 0xbc]
cmp dword [ebp + 8], eax
je 0x410286
mov eax, dword [ebx + 0x24]
and eax, 3
cmp eax, 3
movzx eax, byte [ebx + 0x20]
je 0x4102f0
test al, 3
jne 0x41026d
and eax, 0xfffffffc
or eax, 1
mov byte [ebx + 0x20], al
mov eax, dword [0x41f418]
test eax, eax
je 0x4103c7
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov eax, dword [ebx + 0x18]
sub esp, 4
test eax, eax
je 0x41025e
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov dword [esp], edi
call sym._pthread_mutex_unlock
xor eax, eax
jmp 0x4101cd
mov dword [esp], edi
call sym._pthread_mutex_unlock
test byte [ebx + 0x20], 0xc
jne 0x4101c8
xor eax, eax
jmp 0x4101cd
movzx eax, byte [ebx + 0x20]
test al, 3
jne 0x41026d
and eax, 0xfffffffc
or eax, 1
mov byte [ebx + 0x20], al
mov eax, dword [0x41f418]
test eax, eax
je 0x4103ed
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov eax, dword [ebx + 0x18]
sub esp, 4
test eax, eax
je 0x4102c3
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
sub esp, 4
mov eax, dword [ebx + 0x24]
and eax, 3
cmp eax, 3
jne 0x41025e
movzx eax, byte [ebx + 0x20]
and dword [ebx + 0x24], 0xfffffffe
and eax, 0xfffffff3
or eax, 4
mov byte [ebx + 0x20], al
mov dword [esp], edi
call sym._pthread_mutex_unlock
call sym.__pthread_invoke_cancel
lea esi, [esi]
test al, 0xc
jne 0x41026d
test al, 0xf
jne 0x4101c8
mov eax, dword [ebx + 0x14]
mov dword [ebp - 0x2e4], 0x10001
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SuspendThread]
push eax
mov dword [esp + 4], 0
mov eax, dword [ebx + 0x14]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
push edx
push edx
jne 0x41025e
mov dword [esp + 4], esi
mov eax, dword [ebx + 0x14]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
mov dword [ebp - 0x22c], sym.__pthread_invoke_cancel
push eax
push eax
mov dword [esp + 4], esi
mov eax, dword [ebx + 0x14]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
push eax
push eax
movzx eax, byte [ebx + 0x20]
and dword [ebx + 0x24], 0xfffffffe
and eax, 0xfffffff0
or eax, 5
mov byte [ebx + 0x20], al
mov eax, dword [0x41f418]
test eax, eax
je 0x410413
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
push eax
mov eax, dword [ebx + 0x18]
test eax, eax
je 0x41039f
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
push eax
mov dword [esp], edi
call sym._pthread_mutex_unlock
mov eax, dword [ebx + 0x14]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ResumeThread]
push eax
jmp 0x41025e
xor eax, eax
jmp 0x41020d
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], str._pthread_cancelling_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41f418], eax
jmp 0x41023f
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], str._pthread_cancelling_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41f418], eax
jmp 0x4102a4
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], str._pthread_cancelling_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41f418], eax
jmp 0x410384