Function at 0x421438
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 0x4e92c0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [edi + 5]
and eax, 0x8000007f
jge 0x421467
sub eax, 1
or eax, 0xffffff80
inc eax
mov esi, dword [eax*4 + 0x4edf60]
test esi, esi
je 0x421482
cmp edi, dword [esi + 0x20]
je 0x4217f4
mov esi, dword [esi + 0x1c]
test esi, esi
jne 0x421472
cmp dword [0x4e92e4], 0
je 0x42149d
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x4e92e4]
jne 0x4217e1
xor esi, esi
test esi, esi
je 0x4217d4
mov eax, dword [esi + 0x18]
add eax, 0x18
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test ebx, ebx
je 0x42150f
test byte [esi + 0x161], 0x18
jne 0x421506
mov edx, dword [esi + 0x20]
lea ecx, [edx + 5]
and ecx, 0x8000007f
jge 0x4214d6
sub ecx, 1
or ecx, 0xffffff80
inc ecx
mov eax, dword [ecx*4 + 0x4edf60]
cmp edx, dword [eax + 0x20]
jne 0x4214ee
mov eax, dword [eax + 0x1c]
mov dword [ecx*4 + 0x4edf60], eax
jmp 0x421506
mov ecx, dword [eax + 0x1c]
cmp edx, dword [ecx + 0x20]
je 0x421500
mov eax, ecx
mov ecx, dword [ecx + 0x1c]
cmp edx, dword [ecx + 0x20]
jne 0x4214f6
mov edx, dword [ecx + 0x1c]
mov dword [eax + 0x1c], edx
cmp ebx, 2
je 0x421793
push 0x4e92c0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esi + 0x64]
mov dword [esi + 0x64], 0
test eax, eax
je 0x42152f
mov dword [eax + 4], 0
test ebx, ebx
je 0x42168e
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 0x4217a3
test eax, eax
je 0x4215a6
mov ecx, dword [eax]
mov dword [edx + 0x34], ecx
cmp dword [eax + 4], 0
je 0x42159c
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 0x421571
mov ecx, dword [edx + 4]
test ecx, ecx
jle 0x4215de
xor ebx, ebx
mov edi, dword [edx]
lea eax, [ebx + ebx*4]
test byte [edi + eax*4 + 0x10], 4
je 0x4215d9
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 0x4215af
cmp dword [edx + 0xc], 0
je 0x42161b
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [esi + 0x18]
cmp eax, dword [edx + 0xc]
je 0x42161b
cmp dword [edx + 8], 0
je 0x42161b
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.00419310
push dword [esi + 0x18]
call fcn.00419310
add esp, 8
test byte [esi + 0x161], 0x18
je 0x421671
push 0x178
push 0
mov ebx, dword [esi + 0xf8]
push esi
call fcn.004a6330
add esp, 0xc
movzx eax, byte [esi + 0x161]
or byte [esi + 0x16a], 4
and eax, 0xffffffe7
or eax, 8
mov byte [esi + 0x161], al
mov dword [esi + 0xf8], ebx
mov dword [esi + 0x20], ebx
jmp 0x421678
push esi
call fcn.00419310
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 0x421784
mov eax, dword [esi + 0x18]
mov dword [eax + 0xc], 0
movzx eax, byte [esi + 0x16b]
test al, 1
je 0x4216c5
movzx edi, byte [esi + 0x163]
mov edx, edi
and edx, 0xffffffdf
and edi, 0x40
shr edi, 1
or edx, edi
mov byte [esi + 0x163], dl
and eax, 0xfffffffe
mov byte [esi + 0x16b], al
test al, 2
je 0x4216df
movzx edx, byte [esi + 0x15a]
mov byte [esi + 0x159], dl
and eax, 0xfffffffd
mov byte [esi + 0x16b], al
test al, 4
je 0x4216f9
movzx edx, byte [esi + 0x152]
mov byte [esi + 0x151], dl
and eax, 0xfffffffb
mov byte [esi + 0x16b], al
test al, 8
je 0x42171f
movzx edi, byte [esi + 0x166]
mov edx, edi
and edx, 0xfffffffd
and edi, 4
shr edi, 1
or edx, edi
mov byte [esi + 0x166], dl
and eax, 0xfffffff7
mov byte [esi + 0x16b], al
test al, 0x10
je 0x421739
movzx edx, byte [esi + 0x158]
mov byte [esi + 0x157], dl
and eax, 0xffffffef
mov byte [esi + 0x16b], al
test al, 0x20
je 0x421753
movzx edx, byte [esi + 0x15c]
mov byte [esi + 0x15b], dl
and eax, 0xffffffdf
mov byte [esi + 0x16b], 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 0x421784
mov edx, dword [ecx + 0x34]
test edx, edx
je 0x4217c8
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 [0x4e92e4], eax
jmp 0x42150f
test eax, eax
je 0x42161b
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 0x4217ab
jmp 0x42161b
add ecx, 0x18
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x421784
push 0x4e92c0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x421784
push 0x4e92c0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
call dword [sym.imp.KERNEL32.dll_ExitThread]
cmp dword [esi + 0x18], 0
jne 0x42149f
mov esi, 0
jmp 0x42149f