Function at 0x418f80
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 0x418fa8
mov eax, dword [eax + 0x14]
lea ecx, [eax - 1]
cmp ecx, 0xfffffffd
jbe 0x418fb5
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 0x418fa8
lea edi, [ebx + 0x1c]
mov dword [esp], edi
call sym._pthread_mutex_lock
call sym.___pthread_self_lite
test eax, eax
je 0x4191a0
mov eax, dword [eax + 0xbc]
cmp dword [ebp + 8], eax
je 0x419066
mov eax, dword [ebx + 0x24]
and eax, 3
cmp eax, 3
movzx eax, byte [ebx + 0x20]
je 0x4190d0
test al, 3
jne 0x41904d
and eax, 0xfffffffc
or eax, 1
mov byte [ebx + 0x20], al
mov eax, dword [0x488dcc]
test eax, eax
je 0x4191a7
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov eax, dword [ebx + 0x18]
sub esp, 4
test eax, eax
je 0x41903e
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 0x418fad
mov dword [esp], edi
call sym._pthread_mutex_unlock
test byte [ebx + 0x20], 0xc
jne 0x418fa8
xor eax, eax
jmp 0x418fad
movzx eax, byte [ebx + 0x20]
test al, 3
jne 0x41904d
and eax, 0xfffffffc
or eax, 1
mov byte [ebx + 0x20], al
mov eax, dword [0x488dcc]
test eax, eax
je 0x4191cd
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov eax, dword [ebx + 0x18]
sub esp, 4
test eax, eax
je 0x4190a3
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 0x41903e
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 0x41904d
test al, 0xf
jne 0x418fa8
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 0x41903e
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 [0x488dcc]
test eax, eax
je 0x4191f3
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
push eax
mov eax, dword [ebx + 0x18]
test eax, eax
je 0x41917f
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 0x41903e
xor eax, eax
jmp 0x418fed
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], str._pthread_cancelling_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x488dcc], eax
jmp 0x41901f
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], str._pthread_cancelling_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x488dcc], eax
jmp 0x419084
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], str._pthread_cancelling_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x488dcc], eax
jmp 0x419164