Function at 0x1014f4e8
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov dword [ebp - 8], ebx
mov ebx, edx
mov dword [ebp - 4], edi
mov edi, eax
mov dword [ebp - 0xc], esi
push 0x103f287c
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp edi, 0xfffffffa
lea eax, [edi + 5]
jg 0x1014f510
mov eax, edi
and eax, 0x7f
mov esi, dword [eax*4 + 0x10540d00]
test esi, esi
je 0x1014f52a
cmp edi, dword [esi + 0x20]
je 0x1014f56e
mov esi, dword [esi + 0x1c]
test esi, esi
jne 0x1014f51e
cmp dword [0x103f28a4], 0
je 0x1014f541
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x103f28a4]
jne 0x1014f55b
push 0x103f287c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 4]
mov esp, ebp
pop ebp
ret
push 0x103f287c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
call dword [sym.imp.KERNEL32.dll_ExitThread]
mov eax, dword [esi + 0x18]
test eax, eax
je 0x1014f541
add eax, 0x18
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test ebx, ebx
je 0x1014f5fb
test byte [esi + 0x169], 0x18
jne 0x1014f5f2
mov eax, dword [esi + 0x20]
cmp eax, 0xfffffffa
lea edx, [eax + 5]
jg 0x1014f599
mov edx, eax
and edx, 0x7f
mov ecx, dword [edx*4 + 0x10540d00]
cmp eax, dword [ecx + 0x20]
jne 0x1014f5c6
cmp eax, 0xfffffffa
jle 0x1014f5b0
add eax, 5
and eax, 0x7f
mov edx, dword [eax*4 + 0x10540d00]
mov ecx, dword [edx + 0x1c]
mov dword [eax*4 + 0x10540d00], ecx
jmp 0x1014f5f2
cmp eax, 0xfffffffa
lea edx, [eax + 5]
jg 0x1014f5d0
mov edx, eax
and edx, 0x7f
mov ecx, dword [edx*4 + 0x10540d00]
mov edx, dword [ecx + 0x1c]
cmp eax, dword [edx + 0x20]
je 0x1014f5ec
mov ecx, edx
mov edx, dword [edx + 0x1c]
cmp eax, dword [edx + 0x20]
jne 0x1014f5e2
mov eax, dword [edx + 0x1c]
mov dword [ecx + 0x1c], eax
cmp ebx, 2
je 0x1014f880
push 0x103f287c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esi + 0x64]
test eax, eax
mov dword [esi + 0x64], 0
je 0x1014f61b
mov dword [eax + 4], 0
test ebx, ebx
je 0x1014f77d
mov edx, dword [esi + 0x18]
cmp ebx, 1
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]
je 0x1014f890
test eax, eax
je 0x1014f691
mov ecx, dword [eax]
mov dword [edx + 0x34], ecx
cmp dword [eax + 4], 0
je 0x1014f687
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 [esi + 0x18]
mov eax, dword [edx + 0x34]
test eax, eax
jne 0x1014f65a
mov ecx, dword [edx + 4]
test ecx, ecx
jle 0x1014f6c9
xor ebx, ebx
mov edi, dword [edx]
lea eax, [ebx + ebx*4]
test byte [edi + eax*4 + 0x10], 4
je 0x1014f6c4
mov edx, dword [edi + eax*4 + 4]
mov dword [edx], 1
mov ecx, dword [esi + 0x18]
mov edi, dword [ecx]
push dword [edi + eax*4]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [esi + 0x18]
mov ecx, dword [edx + 4]
inc ebx
cmp ebx, ecx
jl 0x1014f69a
cmp dword [edx + 0xc], 0
je 0x1014f708
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [esi + 0x18]
cmp eax, dword [edx + 0xc]
je 0x1014f708
cmp dword [edx + 8], 0
je 0x1014f708
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 edx, dword [esi + 0x18]
push dword [edx]
call fcn.10146540
push dword [esi + 0x18]
call fcn.10146540
add esp, 8
test byte [esi + 0x169], 0x18
je 0x1014f75e
push 0x180
push 0
push esi
mov ebx, dword [esi + 0x100]
call fcn.101715a0
add esp, 0xc
movzx eax, byte [esi + 0x169]
and eax, 0xffffffe7
or eax, 8
or byte [esi + 0x172], 4
mov byte [esi + 0x169], al
mov dword [esi + 0x100], ebx
mov dword [esi + 0x20], ebx
jmp 0x1014f767
push esi
call fcn.10146540
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 0x1014f54c
mov eax, dword [esi + 0x18]
mov dword [eax + 0xc], 0
movzx eax, byte [esi + 0x173]
test al, 1
je 0x1014f7b8
movzx edi, byte [esi + 0x16b]
mov edx, edi
shr edi, 6
and edx, 0xffffffdf
and edi, 1
and eax, 0xfffffffe
shl edi, 5
or edx, edi
mov byte [esi + 0x16b], dl
mov byte [esi + 0x173], al
test al, 2
je 0x1014f7d2
movzx edx, byte [esi + 0x162]
and eax, 0xfffffffd
mov byte [esi + 0x161], dl
mov byte [esi + 0x173], al
test al, 4
je 0x1014f7ec
movzx edx, byte [esi + 0x15a]
and eax, 0xfffffffb
mov byte [esi + 0x159], dl
mov byte [esi + 0x173], al
test al, 8
je 0x1014f815
movzx edi, byte [esi + 0x16e]
mov edx, edi
shr edi, 2
and edx, 0xfffffffd
and edi, 1
and eax, 0xfffffff7
add edi, edi
or edx, edi
mov byte [esi + 0x16e], dl
mov byte [esi + 0x173], al
test al, 0x10
je 0x1014f82f
movzx edx, byte [esi + 0x160]
and eax, 0xffffffef
mov byte [esi + 0x15f], dl
mov byte [esi + 0x173], al
test al, 0x20
je 0x1014f849
movzx edx, byte [esi + 0x164]
and eax, 0xffffffdf
mov byte [esi + 0x163], dl
mov byte [esi + 0x173], al
mov ebx, dword [esi + 0x18]
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and byte [ebx + 0x44], 0xfe
mov ecx, dword [esi + 0x18]
test byte [ecx + 0x44], 2
jne 0x1014f54c
mov edx, dword [ecx + 0x34]
test edx, edx
je 0x1014f8b5
mov eax, dword [edx]
mov dword [ecx + 0x34], eax
push dword [edx + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x1014f54c
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x103f28a4], eax
jmp 0x1014f5fb
test eax, eax
je 0x1014f708
mov ecx, dword [eax]
mov dword [edx + 0x34], ecx
push dword [eax + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [esi + 0x18]
mov eax, dword [edx + 0x34]
test eax, eax
jne 0x1014f898
jmp 0x1014f708
add ecx, 0x18
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x1014f54c