Function at 0x435b64
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov dword [ebp - 8], edi
mov dword [ebp - 0xc], esi
mov dword [ebp - 4], ebx
mov esi, edx
mov edi, eax
push 0x440fe3c
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [edi + 5]
and eax, 0x7f
mov ebx, dword [eax*4 + 0x44d4900]
test ebx, ebx
je 0x435ba3
cmp edi, dword [ebx + 0x20]
je 0x435e5f
mov ebx, dword [ebx + 0x1c]
test ebx, ebx
jne 0x435b93
mov eax, dword [0x440fe5c]
test eax, eax
je 0x435bcd
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x440fe5c]
je 0x435bcd
push 0x440fe3c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
call dword [sym.imp.KERNEL32.dll_ExitThread]
xor ebx, ebx
test ebx, ebx
je 0x435e52
mov eax, dword [ebx + 0x18]
add eax, 0x10
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp esi, 1
je 0x435bee
cmp esi, 2
jne 0x435c3d
movzx eax, byte [ebx + 0x159]
test al, 0x18
jne 0x435c32
mov edx, dword [ebx + 0x20]
lea ecx, [edx + 5]
and ecx, 0x7f
mov eax, dword [ecx*4 + 0x44d4900]
cmp edx, dword [eax + 0x20]
jne 0x435c1a
mov eax, dword [eax + 0x1c]
mov dword [ecx*4 + 0x44d4900], eax
jmp 0x435c32
mov ecx, dword [eax + 0x1c]
cmp edx, dword [ecx + 0x20]
je 0x435c2c
mov eax, ecx
mov ecx, dword [ecx + 0x1c]
cmp edx, dword [ecx + 0x20]
jne 0x435c22
mov edx, dword [ecx + 0x1c]
mov dword [eax + 0x1c], edx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x440fe5c], eax
push 0x440fe3c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebx + 0x64]
mov dword [ebx + 0x64], 0
test eax, eax
je 0x435c5d
mov dword [eax + 4], 0
test esi, esi
je 0x435dce
mov eax, dword [ebx + 0x18]
mov edx, dword [eax + 0x10]
mov dword [ebp - 0x24], edx
mov ecx, dword [eax + 0x14]
cmp esi, 1
mov dword [ebp - 0x20], ecx
mov edi, dword [eax + 0x18]
mov dword [ebp - 0x1c], edi
mov edx, dword [eax + 0x1c]
mov dword [ebp - 0x18], edx
mov edx, dword [eax + 0x20]
mov dword [ebp - 0x14], edx
mov eax, dword [eax + 0x24]
mov dword [ebp - 0x10], eax
je 0x435e1b
mov edx, dword [ebx + 0x18]
mov eax, dword [edx + 0x2c]
test eax, eax
je 0x435cd7
mov ecx, dword [eax]
mov dword [edx + 0x2c], ecx
mov edx, dword [eax + 4]
test edx, edx
je 0x435ccd
add eax, 4
mov edx, dword [eax]
mov dword [ebp - 0x2c], edx
mov eax, dword [eax + 4]
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 [ebx + 0x18]
mov eax, dword [edx + 0x2c]
test eax, eax
jne 0x435c9f
mov eax, dword [edx + 4]
test eax, eax
jle 0x435d18
xor edi, edi
xor esi, esi
mov ecx, dword [edx]
movzx ecx, byte [ecx + esi + 0x10]
test cl, 4
je 0x435d0e
mov eax, dword [edx]
mov edx, dword [esi + eax + 4]
mov dword [edx], 1
mov ecx, dword [ebx + 0x18]
mov eax, dword [ecx]
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [ebx + 0x18]
mov eax, dword [edx + 4]
add esi, 0x14
add edi, 1
cmp edi, eax
jl 0x435ce2
mov eax, dword [edx + 0xc]
test eax, eax
je 0x435d59
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [ebx + 0x18]
cmp eax, dword [edx + 0xc]
je 0x435d59
mov eax, dword [edx + 8]
test eax, eax
je 0x435d59
add edx, 8
mov eax, dword [edx]
mov dword [ebp - 0x2c], eax
mov edx, dword [edx + 4]
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 [ebx + 0x18]
push dword [edx]
call fcn.004316dc
push dword [ebx + 0x18]
call fcn.004316dc
add esp, 8
movzx eax, byte [ebx + 0x159]
test al, 0x18
je 0x435db1
push 0x170
push 0
mov esi, dword [ebx + 0xec]
push ebx
call fcn.004a3ab8
add esp, 0xc
movzx eax, byte [ebx + 0x159]
or byte [ebx + 0x162], 4
and eax, 0xffffffe7
or eax, 8
mov byte [ebx + 0x159], al
mov dword [ebx + 0xec], esi
mov dword [ebx + 0x20], esi
jmp 0x435db8
push ebx
call fcn.004316dc
pop ecx
lea eax, [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea eax, [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x435e0c
mov eax, dword [ebx + 0x18]
mov dword [eax + 0xc], 0
mov edx, dword [ebx + 0x18]
push dword [edx + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebx + 0x18]
and byte [eax + 0x3c], 0xfe
mov ecx, dword [ebx + 0x18]
movzx edx, byte [ecx + 0x3c]
test dl, 2
jne 0x435e0c
mov edx, dword [ecx + 0x2c]
test edx, edx
je 0x435e46
mov eax, dword [edx]
mov dword [ecx + 0x2c], eax
push dword [edx + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 8]
xor eax, eax
mov esp, ebp
pop ebp
ret
mov edx, dword [ebx + 0x18]
mov eax, dword [edx + 0x2c]
test eax, eax
je 0x435d59
mov ecx, dword [eax]
mov dword [edx + 0x2c], ecx
push dword [eax + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [ebx + 0x18]
mov eax, dword [edx + 0x2c]
test eax, eax
jne 0x435e29
jmp 0x435d59
add ecx, 0x10
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x435e0c
push 0x440fe3c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x435e0c
mov eax, dword [ebx + 0x18]
test eax, eax
jne 0x435bcf
mov ebx, 0
jmp 0x435bcf