Function at 0x10077b3c
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 0x100d9128
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [edi + 5]
and eax, 0x7f
mov ebx, dword [eax*4 + 0x100d9e00]
test ebx, ebx
je 0x10077b7b
cmp edi, dword [ebx + 0x20]
je 0x10077e37
mov ebx, dword [ebx + 0x1c]
test ebx, ebx
jne 0x10077b6b
mov eax, dword [0x100d9148]
test eax, eax
je 0x10077ba5
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x100d9148]
je 0x10077ba5
push 0x100d9128
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
call dword [sym.imp.KERNEL32.dll_ExitThread]
xor ebx, ebx
test ebx, ebx
je 0x10077e2a
mov eax, dword [ebx + 0x18]
add eax, 0x10
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp esi, 1
je 0x10077bc6
cmp esi, 2
jne 0x10077c15
movzx eax, byte [ebx + 0x129]
test al, 0x18
jne 0x10077c0a
mov edx, dword [ebx + 0x20]
lea ecx, [edx + 5]
and ecx, 0x7f
mov eax, dword [ecx*4 + 0x100d9e00]
cmp edx, dword [eax + 0x20]
jne 0x10077bf2
mov eax, dword [eax + 0x1c]
mov dword [ecx*4 + 0x100d9e00], eax
jmp 0x10077c0a
mov ecx, dword [eax + 0x1c]
cmp edx, dword [ecx + 0x20]
je 0x10077c04
mov eax, ecx
mov ecx, dword [ecx + 0x1c]
cmp edx, dword [ecx + 0x20]
jne 0x10077bfa
mov edx, dword [ecx + 0x1c]
mov dword [eax + 0x1c], edx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x100d9148], eax
push 0x100d9128
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebx + 0x64]
mov dword [ebx + 0x64], 0
test eax, eax
je 0x10077c35
mov dword [eax + 4], 0
test esi, esi
je 0x10077da6
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 0x10077df3
mov edx, dword [ebx + 0x18]
mov eax, dword [edx + 0x2c]
test eax, eax
je 0x10077caf
mov ecx, dword [eax]
mov dword [edx + 0x2c], ecx
mov edx, dword [eax + 4]
test edx, edx
je 0x10077ca5
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 0x10077c77
mov eax, dword [edx + 4]
test eax, eax
jle 0x10077cf0
xor edi, edi
xor esi, esi
mov ecx, dword [edx]
movzx ecx, byte [ecx + esi + 0x10]
test cl, 4
je 0x10077ce6
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 0x10077cba
mov eax, dword [edx + 0xc]
test eax, eax
je 0x10077d31
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [ebx + 0x18]
cmp eax, dword [edx + 0xc]
je 0x10077d31
mov eax, dword [edx + 8]
test eax, eax
je 0x10077d31
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.10049680
push dword [ebx + 0x18]
call fcn.10049680
add esp, 8
movzx eax, byte [ebx + 0x129]
test al, 0x18
je 0x10077d89
push 0x138
push 0
mov esi, dword [ebx + 0xc8]
push ebx
call fcn.1007f474
add esp, 0xc
movzx eax, byte [ebx + 0x129]
or byte [ebx + 0x132], 1
and eax, 0xffffffe7
or eax, 8
mov byte [ebx + 0x129], al
mov dword [ebx + 0xc8], esi
mov dword [ebx + 0x20], esi
jmp 0x10077d90
push ebx
call fcn.10049680
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 0x10077de4
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 0x10077de4
mov edx, dword [ecx + 0x2c]
test edx, edx
je 0x10077e1e
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 0x10077d31
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 0x10077e01
jmp 0x10077d31
add ecx, 0x10
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x10077de4
push 0x100d9128
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x10077de4
mov eax, dword [ebx + 0x18]
test eax, eax
jne 0x10077ba7
mov ebx, 0
jmp 0x10077ba7