Function at 0x5e88f8
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
push esi
push edi
push ebx
sub esp, 0x28
mov esi, edx
push 0x71f1fc
mov edi, eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp edi, 0xfffffff9
lea eax, [edi + 6]
jg 0x5e891a
mov eax, edi
and eax, 0x7f
mov ebx, dword [eax*4 + 0x81f440]
test ebx, ebx
je 0x5e8cc7
cmp edi, dword [ebx + 0x28]
je 0x5e8941
mov ebx, dword [ebx + 0x24]
test ebx, ebx
je 0x5e8cc7
cmp edi, dword [ebx + 0x28]
jne 0x5e8931
mov eax, dword [ebx + 0x20]
test eax, eax
je 0x5e8cba
add eax, 0x18
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test esi, esi
je 0x5e8b52
test byte [ebx + 0x1a1], 0x18
jne 0x5e89cd
mov eax, dword [ebx + 0x28]
cmp eax, 0xfffffff9
lea edx, [eax + 6]
jg 0x5e8974
mov edx, eax
and edx, 0x7f
mov ecx, dword [edx*4 + 0x81f440]
cmp eax, dword [ecx + 0x28]
jne 0x5e89a1
cmp eax, 0xfffffff9
jle 0x5e898b
add eax, 6
and eax, 0x7f
mov edx, dword [eax*4 + 0x81f440]
mov ecx, dword [edx + 0x24]
mov dword [eax*4 + 0x81f440], ecx
jmp 0x5e89cd
cmp eax, 0xfffffff9
lea edx, [eax + 6]
jg 0x5e89ab
mov edx, eax
and edx, 0x7f
mov ecx, dword [edx*4 + 0x81f440]
mov edx, dword [ecx + 0x24]
cmp eax, dword [edx + 0x28]
je 0x5e89c7
mov ecx, edx
mov edx, dword [edx + 0x24]
cmp eax, dword [edx + 0x28]
jne 0x5e89bd
mov eax, dword [edx + 0x24]
mov dword [ecx + 0x24], eax
cmp esi, 2
je 0x5e8c9e
push 0x71f1fc
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebx + 0x7c]
mov dword [ebx + 0x7c], 0
test eax, eax
je 0x5e89f6
mov dword [eax + 4], 0
mov edx, dword [ebx + 0x20]
mov eax, dword [edx + 0x18]
mov ecx, dword [edx + 0x1c]
mov edi, dword [edx + 0x20]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], edi
mov eax, dword [edx + 0x24]
mov ecx, dword [edx + 0x28]
mov edi, dword [edx + 0x2c]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x18], edi
mov eax, dword [edx + 0x34]
cmp esi, 1
je 0x5e8c79
test eax, eax
je 0x5e8a64
mov ecx, dword [eax]
mov dword [edx + 0x34], ecx
cmp dword [eax + 4], 0
je 0x5e8a5a
mov edx, dword [eax + 4]
mov dword [ebp - 0x14], edx
mov eax, dword [eax + 8]
mov dword [ebp - 0x10], eax
push 0
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebx + 0x20]
mov eax, dword [edx + 0x34]
test eax, eax
jne 0x5e8a2d
mov eax, dword [edx + 4]
test eax, eax
jle 0x5e8a9e
xor edi, edi
xor esi, esi
mov ecx, dword [edx]
test byte [ecx + esi + 0x10], 4
je 0x5e8a96
mov eax, dword [ecx + esi + 4]
mov dword [eax], 1
mov edx, dword [ebx + 0x20]
mov ecx, dword [edx]
push dword [ecx + esi]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [ebx + 0x20]
mov eax, dword [edx + 4]
inc edi
add esi, 0x14
cmp edi, eax
jl 0x5e8a6f
cmp dword [edx + 0xc], 0
je 0x5e8ada
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [ebx + 0x20]
cmp eax, dword [edx + 0xc]
je 0x5e8ada
cmp dword [edx + 8], 0
je 0x5e8ada
mov eax, dword [edx + 8]
mov dword [ebp - 0x34], eax
mov edx, dword [edx + 0xc]
mov dword [ebp - 0x30], edx
push 0
mov eax, dword [ebp - 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov eax, dword [ebp - 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebx + 0x20]
push dword [eax]
call fcn.005c0a60
push dword [ebx + 0x20]
call fcn.005c0a60
add esp, 8
test byte [ebx + 0x1a1], 0x18
je 0x5e8b33
push 0x1b8
push 0
push ebx
mov esi, dword [ebx + 0x124]
call fcn.0062a5e0
add esp, 0xc
movzx eax, byte [ebx + 0x1a1]
and eax, 0xffffffe7
add eax, 8
or byte [ebx + 0x1aa], 4
mov byte [ebx + 0x1a1], al
mov dword [ebx + 0x124], esi
mov dword [ebx + 0x28], esi
jmp 0x5e8b3c
push ebx
call fcn.005c0a60
add esp, 4
lea ebx, [ebp - 0x2c]
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push ebx
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x5e8c6f
push 0x71f1fc
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebx + 0x7c]
mov dword [ebx + 0x7c], 0
test eax, eax
je 0x5e8b72
mov dword [eax + 4], 0
mov eax, dword [ebx + 0x20]
mov dword [eax + 0xc], 0
movzx eax, byte [ebx + 0x1ab]
mov edx, eax
btr edx, 0
jae 0x5e8bb0
movzx esi, byte [ebx + 0x1a3]
mov eax, esi
shr esi, 6
and eax, 0xffffffdf
and esi, 1
shl esi, 5
or eax, esi
mov byte [ebx + 0x1a3], al
mov eax, edx
mov byte [ebx + 0x1ab], al
test al, 2
je 0x5e8bca
movzx edx, byte [ebx + 0x19a]
and eax, 0xfffffffd
mov byte [ebx + 0x199], dl
mov byte [ebx + 0x1ab], al
test al, 4
je 0x5e8be4
movzx edx, byte [ebx + 0x192]
and eax, 0xfffffffb
mov byte [ebx + 0x191], dl
mov byte [ebx + 0x1ab], al
test al, 8
je 0x5e8c0d
movzx esi, byte [ebx + 0x1a6]
mov edx, esi
shr esi, 2
and edx, 0xfffffffd
and esi, 1
and eax, 0xfffffff7
add esi, esi
or edx, esi
mov byte [ebx + 0x1a6], dl
mov byte [ebx + 0x1ab], al
test al, 0x10
je 0x5e8c27
movzx edx, byte [ebx + 0x198]
and eax, 0xffffffef
mov byte [ebx + 0x197], dl
mov byte [ebx + 0x1ab], al
test al, 0x20
je 0x5e8c41
movzx edx, byte [ebx + 0x19c]
and eax, 0xffffffdf
mov byte [ebx + 0x19b], dl
mov byte [ebx + 0x1ab], al
mov esi, dword [ebx + 0x20]
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and byte [esi + 0x44], 0xfe
mov ecx, dword [ebx + 0x20]
test byte [ecx + 0x44], 2
jne 0x5e8c6f
mov edx, dword [ecx + 0x34]
test edx, edx
je 0x5e8cae
mov eax, dword [edx]
mov dword [ecx + 0x34], eax
push dword [edx + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop edi
pop esi
pop ebp
ret
test eax, eax
je 0x5e8ada
mov ecx, dword [eax]
mov dword [edx + 0x34], ecx
push dword [eax + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [ebx + 0x20]
mov eax, dword [edx + 0x34]
test eax, eax
jne 0x5e8c81
jmp 0x5e8ada
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x71f22c], eax
jmp 0x5e89d6
add ecx, 0x18
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x5e8c6f
push 0x71f1fc
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x5e8c6f
cmp dword [0x71f22c], 0
je 0x5e8cba
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x71f22c]
je 0x5e8cba
push 0x71f1fc
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
call dword [sym.imp.KERNEL32.dll_ExitThread]