Function at 0x40ebc0
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 0x40ebe8
mov eax, dword [eax + 0x14]
lea ecx, [eax - 1]
cmp ecx, 0xfffffffd
jbe 0x40ebf5
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 0x40ebe8
lea edi, [ebx + 0x1c]
mov dword [esp], edi
call sym._pthread_mutex_lock
call sym.___pthread_self_lite
test eax, eax
je 0x40ede0
mov eax, dword [eax + 0xbc]
cmp dword [ebp + 8], eax
je 0x40eca6
mov eax, dword [ebx + 0x24]
and eax, 3
cmp eax, 3
movzx eax, byte [ebx + 0x20]
je 0x40ed10
test al, 3
jne 0x40ec8d
and eax, 0xfffffffc
or eax, 1
mov byte [ebx + 0x20], al
mov eax, dword [0x41e418]
test eax, eax
je 0x40ede7
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov eax, dword [ebx + 0x18]
sub esp, 4
test eax, eax
je 0x40ec7e
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 0x40ebed
mov dword [esp], edi
call sym._pthread_mutex_unlock
test byte [ebx + 0x20], 0xc
jne 0x40ebe8
xor eax, eax
jmp 0x40ebed
movzx eax, byte [ebx + 0x20]
test al, 3
jne 0x40ec8d
and eax, 0xfffffffc
or eax, 1
mov byte [ebx + 0x20], al
mov eax, dword [0x41e418]
test eax, eax
je 0x40ee0d
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov eax, dword [ebx + 0x18]
sub esp, 4
test eax, eax
je 0x40ece3
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 0x40ec7e
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 0x40ec8d
test al, 0xf
jne 0x40ebe8
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 0x40ec7e
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 [0x41e418]
test eax, eax
je 0x40ee33
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
push eax
mov eax, dword [ebx + 0x18]
test eax, eax
je 0x40edbf
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 0x40ec7e
xor eax, eax
jmp 0x40ec2d
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], str._pthread_cancelling_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41e418], eax
jmp 0x40ec5f
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], str._pthread_cancelling_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41e418], eax
jmp 0x40ecc4
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], str._pthread_cancelling_shmem
call sym.___shmem_winpthreads_grab
mov dword [0x41e418], eax
jmp 0x40eda4