Function at 0x1002c2cc
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
push esi
push edi
push ebx
sub esp, 0x28
mov esi, edx
push 0x10246d6c
mov edi, eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp edi, 0xfffffff9
lea eax, [edi + 6]
jg 0x1002c2ee
mov eax, edi
and eax, 0x7f
mov ebx, dword [eax*4 + 0x1024e4a0]
test ebx, ebx
je 0x1002c69b
cmp edi, dword [ebx + 0x28]
je 0x1002c315
mov ebx, dword [ebx + 0x24]
test ebx, ebx
je 0x1002c69b
cmp edi, dword [ebx + 0x28]
jne 0x1002c305
mov eax, dword [ebx + 0x20]
test eax, eax
je 0x1002c68e
add eax, 0x18
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test esi, esi
je 0x1002c526
test byte [ebx + 0x191], 0x18
jne 0x1002c3a1
mov eax, dword [ebx + 0x28]
cmp eax, 0xfffffff9
lea edx, [eax + 6]
jg 0x1002c348
mov edx, eax
and edx, 0x7f
mov ecx, dword [edx*4 + 0x1024e4a0]
cmp eax, dword [ecx + 0x28]
jne 0x1002c375
cmp eax, 0xfffffff9
jle 0x1002c35f
add eax, 6
and eax, 0x7f
mov edx, dword [eax*4 + 0x1024e4a0]
mov ecx, dword [edx + 0x24]
mov dword [eax*4 + 0x1024e4a0], ecx
jmp 0x1002c3a1
cmp eax, 0xfffffff9
lea edx, [eax + 6]
jg 0x1002c37f
mov edx, eax
and edx, 0x7f
mov ecx, dword [edx*4 + 0x1024e4a0]
mov edx, dword [ecx + 0x24]
cmp eax, dword [edx + 0x28]
je 0x1002c39b
mov ecx, edx
mov edx, dword [edx + 0x24]
cmp eax, dword [edx + 0x28]
jne 0x1002c391
mov eax, dword [edx + 0x24]
mov dword [ecx + 0x24], eax
cmp esi, 2
je 0x1002c672
push 0x10246d6c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebx + 0x78]
mov dword [ebx + 0x78], 0
test eax, eax
je 0x1002c3ca
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 0x1002c64d
test eax, eax
je 0x1002c438
mov ecx, dword [eax]
mov dword [edx + 0x34], ecx
cmp dword [eax + 4], 0
je 0x1002c42e
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 0x1002c401
mov eax, dword [edx + 4]
test eax, eax
jle 0x1002c472
xor edi, edi
xor esi, esi
mov ecx, dword [edx]
test byte [ecx + esi + 0x10], 4
je 0x1002c46a
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 0x1002c443
cmp dword [edx + 0xc], 0
je 0x1002c4ae
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [ebx + 0x20]
cmp eax, dword [edx + 0xc]
je 0x1002c4ae
cmp dword [edx + 8], 0
je 0x1002c4ae
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.10025800
push dword [ebx + 0x20]
call fcn.10025800
add esp, 8
test byte [ebx + 0x191], 0x18
je 0x1002c507
push 0x1a8
push 0
push ebx
mov esi, dword [ebx + 0x118]
call fcn.10061620
add esp, 0xc
movzx eax, byte [ebx + 0x191]
and eax, 0xffffffe7
add eax, 8
or byte [ebx + 0x19a], 4
mov byte [ebx + 0x191], al
mov dword [ebx + 0x118], esi
mov dword [ebx + 0x28], esi
jmp 0x1002c510
push ebx
call fcn.10025800
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 0x1002c643
push 0x10246d6c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebx + 0x78]
mov dword [ebx + 0x78], 0
test eax, eax
je 0x1002c546
mov dword [eax + 4], 0
mov eax, dword [ebx + 0x20]
mov dword [eax + 0xc], 0
movzx eax, byte [ebx + 0x19b]
mov edx, eax
btr edx, 0
jae 0x1002c584
movzx esi, byte [ebx + 0x193]
mov eax, esi
shr esi, 6
and eax, 0xffffffdf
and esi, 1
shl esi, 5
or eax, esi
mov byte [ebx + 0x193], al
mov eax, edx
mov byte [ebx + 0x19b], al
test al, 2
je 0x1002c59e
movzx edx, byte [ebx + 0x18a]
and eax, 0xfffffffd
mov byte [ebx + 0x189], dl
mov byte [ebx + 0x19b], al
test al, 4
je 0x1002c5b8
movzx edx, byte [ebx + 0x182]
and eax, 0xfffffffb
mov byte [ebx + 0x181], dl
mov byte [ebx + 0x19b], al
test al, 8
je 0x1002c5e1
movzx esi, byte [ebx + 0x196]
mov edx, esi
shr esi, 2
and edx, 0xfffffffd
and esi, 1
and eax, 0xfffffff7
add esi, esi
or edx, esi
mov byte [ebx + 0x196], dl
mov byte [ebx + 0x19b], al
test al, 0x10
je 0x1002c5fb
movzx edx, byte [ebx + 0x188]
and eax, 0xffffffef
mov byte [ebx + 0x187], dl
mov byte [ebx + 0x19b], al
test al, 0x20
je 0x1002c615
movzx edx, byte [ebx + 0x18c]
and eax, 0xffffffdf
mov byte [ebx + 0x18b], dl
mov byte [ebx + 0x19b], 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 0x1002c643
mov edx, dword [ecx + 0x34]
test edx, edx
je 0x1002c682
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 0x1002c4ae
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 0x1002c655
jmp 0x1002c4ae
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x10246d9c], eax
jmp 0x1002c3aa
add ecx, 0x18
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x1002c643
push 0x10246d6c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x1002c643
cmp dword [0x10246d9c], 0
je 0x1002c68e
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x10246d9c]
je 0x1002c68e
push 0x10246d6c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
call dword [sym.imp.KERNEL32.dll_ExitThread]