Function at 0x42a178
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], edi
mov dword [ebp - 4], esi
mov ebx, edx
mov edi, eax
push 0x53577c
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [edi + 5]
and eax, 0x8000007f
jge 0x42a1a7
sub eax, 1
or eax, 0xffffff80
inc eax
mov esi, dword [eax*4 + 0x53a880]
test esi, esi
je 0x42a1c2
cmp edi, dword [esi + 0x20]
je 0x42a534
mov esi, dword [esi + 0x1c]
test esi, esi
jne 0x42a1b2
cmp dword [0x5357a0], 0
je 0x42a1dd
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x5357a0]
jne 0x42a521
xor esi, esi
test esi, esi
je 0x42a514
mov eax, dword [esi + 0x18]
add eax, 0x18
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test ebx, ebx
je 0x42a24f
test byte [esi + 0x159], 0x18
jne 0x42a246
mov edx, dword [esi + 0x20]
lea ecx, [edx + 5]
and ecx, 0x8000007f
jge 0x42a216
sub ecx, 1
or ecx, 0xffffff80
inc ecx
mov eax, dword [ecx*4 + 0x53a880]
cmp edx, dword [eax + 0x20]
jne 0x42a22e
mov eax, dword [eax + 0x1c]
mov dword [ecx*4 + 0x53a880], eax
jmp 0x42a246
mov ecx, dword [eax + 0x1c]
cmp edx, dword [ecx + 0x20]
je 0x42a240
mov eax, ecx
mov ecx, dword [ecx + 0x1c]
cmp edx, dword [ecx + 0x20]
jne 0x42a236
mov edx, dword [ecx + 0x1c]
mov dword [eax + 0x1c], edx
cmp ebx, 2
je 0x42a4d3
push 0x53577c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esi + 0x64]
mov dword [esi + 0x64], 0
test eax, eax
je 0x42a26f
mov dword [eax + 4], 0
test ebx, ebx
je 0x42a3ce
mov eax, dword [esi + 0x18]
mov edx, dword [eax + 0x18]
mov dword [ebp - 0x24], edx
mov ecx, dword [eax + 0x1c]
cmp ebx, 1
mov dword [ebp - 0x20], ecx
mov edi, dword [eax + 0x20]
mov dword [ebp - 0x1c], edi
mov edx, dword [eax + 0x24]
mov dword [ebp - 0x18], edx
mov ecx, dword [eax + 0x28]
mov dword [ebp - 0x14], ecx
mov eax, dword [eax + 0x2c]
mov dword [ebp - 0x10], eax
mov edx, dword [esi + 0x18]
mov eax, dword [edx + 0x34]
je 0x42a4e3
test eax, eax
je 0x42a2e6
mov ecx, dword [eax]
mov dword [edx + 0x34], ecx
cmp dword [eax + 4], 0
je 0x42a2dc
mov edx, dword [eax + 4]
mov dword [ebp - 0x2c], edx
mov eax, dword [eax + 8]
mov dword [ebp - 0x28], eax
push 0
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_TerminateThread]
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esi + 0x18]
mov eax, dword [edx + 0x34]
test eax, eax
jne 0x42a2b1
mov ecx, dword [edx + 4]
test ecx, ecx
jle 0x42a31e
xor ebx, ebx
mov edi, dword [edx]
lea eax, [ebx + ebx*4]
test byte [edi + eax*4 + 0x10], 4
je 0x42a319
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 0x42a2ef
cmp dword [edx + 0xc], 0
je 0x42a35b
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [esi + 0x18]
cmp eax, dword [edx + 0xc]
je 0x42a35b
cmp dword [edx + 8], 0
je 0x42a35b
mov eax, dword [edx + 8]
mov dword [ebp - 0x2c], eax
mov edx, dword [edx + 0xc]
mov dword [ebp - 0x28], edx
push 0
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_TerminateThread]
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esi + 0x18]
push dword [edx]
call fcn.0042e370
push dword [esi + 0x18]
call fcn.0042e370
add esp, 8
test byte [esi + 0x159], 0x18
je 0x42a3b1
push 0x170
push 0
mov ebx, dword [esi + 0xf0]
push esi
call fcn.004b11c0
add esp, 0xc
movzx eax, byte [esi + 0x159]
or byte [esi + 0x162], 4
and eax, 0xffffffe7
or eax, 8
mov byte [esi + 0x159], al
mov dword [esi + 0xf0], ebx
mov dword [esi + 0x20], ebx
jmp 0x42a3b8
push esi
call fcn.0042e370
pop ecx
lea ebx, [ebp - 0x24]
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push ebx
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x42a4c4
mov eax, dword [esi + 0x18]
mov dword [eax + 0xc], 0
movzx eax, byte [esi + 0x163]
test al, 1
je 0x42a405
movzx edi, byte [esi + 0x15b]
mov edx, edi
and edx, 0xffffffdf
and edi, 0x40
shr edi, 1
or edx, edi
mov byte [esi + 0x15b], dl
and eax, 0xfffffffe
mov byte [esi + 0x163], al
test al, 2
je 0x42a41f
movzx edx, byte [esi + 0x152]
mov byte [esi + 0x151], dl
and eax, 0xfffffffd
mov byte [esi + 0x163], al
test al, 4
je 0x42a439
movzx edx, byte [esi + 0x14a]
mov byte [esi + 0x149], dl
and eax, 0xfffffffb
mov byte [esi + 0x163], al
test al, 8
je 0x42a45f
movzx edi, byte [esi + 0x15e]
mov edx, edi
and edx, 0xfffffffd
and edi, 4
shr edi, 1
or edx, edi
mov byte [esi + 0x15e], dl
and eax, 0xfffffff7
mov byte [esi + 0x163], al
test al, 0x10
je 0x42a479
movzx edx, byte [esi + 0x150]
mov byte [esi + 0x14f], dl
and eax, 0xffffffef
mov byte [esi + 0x163], al
test al, 0x20
je 0x42a493
movzx edx, byte [esi + 0x154]
mov byte [esi + 0x153], dl
and eax, 0xffffffdf
mov byte [esi + 0x163], al
mov eax, dword [esi + 0x18]
push dword [eax + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 0x18]
and byte [eax + 0x44], 0xfe
mov ecx, dword [esi + 0x18]
test byte [ecx + 0x44], 2
jne 0x42a4c4
mov edx, dword [ecx + 0x34]
test edx, edx
je 0x42a508
mov eax, dword [edx]
mov dword [ecx + 0x34], eax
push dword [edx + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 0xc]
xor eax, eax
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x5357a0], eax
jmp 0x42a24f
test eax, eax
je 0x42a35b
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 0x42a4eb
jmp 0x42a35b
add ecx, 0x18
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x42a4c4
push 0x53577c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x42a4c4
push 0x53577c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
call dword [sym.imp.KERNEL32.dll_ExitThread]
cmp dword [esi + 0x18], 0
jne 0x42a1df
mov esi, 0
jmp 0x42a1df